terraform/terraform/graph_config_node.go

42 lines
1.3 KiB
Go
Raw Normal View History

2015-01-21 23:39:16 +01:00
package terraform
import (
2015-01-23 02:12:32 +01:00
"github.com/hashicorp/terraform/dag"
2015-01-21 23:39:16 +01:00
)
// graphNodeConfig is an interface that all graph nodes for the
// configuration graph need to implement in order to build the variable
// dependencies properly.
type graphNodeConfig interface {
dag.NamedVertex
2015-01-21 23:39:16 +01:00
2015-01-27 23:56:01 +01:00
// All graph nodes should be dependent on other things, and able to
// be depended on.
GraphNodeDependable
GraphNodeDependent
// ConfigType returns the type of thing in the configuration that
// this node represents, such as a resource, module, etc.
ConfigType() GraphNodeConfigType
2015-01-21 23:39:16 +01:00
}
// GraphNodeAddressable is an interface that all graph nodes for the
// configuration graph need to implement in order to be be addressed / targeted
// properly.
type GraphNodeAddressable interface {
graphNodeConfig
ResourceAddress() *ResourceAddress
}
// GraphNodeTargetable is an interface for graph nodes to implement when they
// need to be told about incoming targets. This is useful for nodes that need
// to respect targets as they dynamically expand. Note that the list of targets
// provided will contain every target provided, and each implementing graph
// node must filter this list to targets considered relevant.
type GraphNodeTargetable interface {
GraphNodeAddressable
SetTargets([]ResourceAddress)
}