]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/github.com/hashicorp/terraform/terraform/node_root_variable.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / node_root_variable.go
CommitLineData
bae9f6d2
JC
1package terraform
2
3import (
107c1cdb
ND
4 "github.com/hashicorp/terraform/addrs"
5 "github.com/hashicorp/terraform/configs"
6 "github.com/hashicorp/terraform/dag"
bae9f6d2
JC
7)
8
9// NodeRootVariable represents a root variable input.
10type NodeRootVariable struct {
107c1cdb
ND
11 Addr addrs.InputVariable
12 Config *configs.Variable
bae9f6d2
JC
13}
14
107c1cdb
ND
15var (
16 _ GraphNodeSubPath = (*NodeRootVariable)(nil)
17 _ GraphNodeReferenceable = (*NodeRootVariable)(nil)
18 _ dag.GraphNodeDotter = (*NodeApplyableModuleVariable)(nil)
19)
20
bae9f6d2 21func (n *NodeRootVariable) Name() string {
107c1cdb
ND
22 return n.Addr.String()
23}
24
25// GraphNodeSubPath
26func (n *NodeRootVariable) Path() addrs.ModuleInstance {
27 return addrs.RootModuleInstance
bae9f6d2
JC
28}
29
30// GraphNodeReferenceable
107c1cdb
ND
31func (n *NodeRootVariable) ReferenceableAddrs() []addrs.Referenceable {
32 return []addrs.Referenceable{n.Addr}
33}
34
35// dag.GraphNodeDotter impl.
36func (n *NodeRootVariable) DotNode(name string, opts *dag.DotOpts) *dag.DotNode {
37 return &dag.DotNode{
38 Name: name,
39 Attrs: map[string]string{
40 "label": n.Name(),
41 "shape": "note",
42 },
43 }
bae9f6d2 44}