github.com/articulate/terraform@v0.6.13-0.20160303003731-8d31c93862de/terraform/graph_config_node.go (about)

     1  package terraform
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/dag"
     5  )
     6  
     7  // graphNodeConfig is an interface that all graph nodes for the
     8  // configuration graph need to implement in order to build the variable
     9  // dependencies properly.
    10  type graphNodeConfig interface {
    11  	dag.NamedVertex
    12  
    13  	// All graph nodes should be dependent on other things, and able to
    14  	// be depended on.
    15  	GraphNodeDependable
    16  	GraphNodeDependent
    17  
    18  	// ConfigType returns the type of thing in the configuration that
    19  	// this node represents, such as a resource, module, etc.
    20  	ConfigType() GraphNodeConfigType
    21  }
    22  
    23  // GraphNodeAddressable is an interface that all graph nodes for the
    24  // configuration graph need to implement in order to be be addressed / targeted
    25  // properly.
    26  type GraphNodeAddressable interface {
    27  	graphNodeConfig
    28  
    29  	ResourceAddress() *ResourceAddress
    30  }
    31  
    32  // GraphNodeTargetable is an interface for graph nodes to implement when they
    33  // need to be told about incoming targets. This is useful for nodes that need
    34  // to respect targets as they dynamically expand. Note that the list of targets
    35  // provided will contain every target provided, and each implementing graph
    36  // node must filter this list to targets considered relevant.
    37  type GraphNodeTargetable interface {
    38  	GraphNodeAddressable
    39  
    40  	SetTargets([]ResourceAddress)
    41  }