diff options
author | Jake Champlin <jake.champlin.27@gmail.com> | 2017-06-06 12:40:07 -0400 |
---|---|---|
committer | Jake Champlin <jake.champlin.27@gmail.com> | 2017-06-06 12:40:07 -0400 |
commit | bae9f6d2fd5eb5bc80929bd393932b23f14d7c93 (patch) | |
tree | ca9ab12a7d78b1fc27a8f734729081357ce6d252 /vendor/github.com/hashicorp/terraform/dag/edge.go | |
parent | 254c495b6bebab3fb72a243c4bce858d79e6ee99 (diff) | |
download | terraform-provider-statuscake-bae9f6d2fd5eb5bc80929bd393932b23f14d7c93.tar.gz terraform-provider-statuscake-bae9f6d2fd5eb5bc80929bd393932b23f14d7c93.tar.zst terraform-provider-statuscake-bae9f6d2fd5eb5bc80929bd393932b23f14d7c93.zip |
Initial transfer of provider code
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/dag/edge.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/dag/edge.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/dag/edge.go b/vendor/github.com/hashicorp/terraform/dag/edge.go new file mode 100644 index 0000000..f0d99ee --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/dag/edge.go | |||
@@ -0,0 +1,37 @@ | |||
1 | package dag | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | ) | ||
6 | |||
7 | // Edge represents an edge in the graph, with a source and target vertex. | ||
8 | type Edge interface { | ||
9 | Source() Vertex | ||
10 | Target() Vertex | ||
11 | |||
12 | Hashable | ||
13 | } | ||
14 | |||
15 | // BasicEdge returns an Edge implementation that simply tracks the source | ||
16 | // and target given as-is. | ||
17 | func BasicEdge(source, target Vertex) Edge { | ||
18 | return &basicEdge{S: source, T: target} | ||
19 | } | ||
20 | |||
21 | // basicEdge is a basic implementation of Edge that has the source and | ||
22 | // target vertex. | ||
23 | type basicEdge struct { | ||
24 | S, T Vertex | ||
25 | } | ||
26 | |||
27 | func (e *basicEdge) Hashcode() interface{} { | ||
28 | return fmt.Sprintf("%p-%p", e.S, e.T) | ||
29 | } | ||
30 | |||
31 | func (e *basicEdge) Source() Vertex { | ||
32 | return e.S | ||
33 | } | ||
34 | |||
35 | func (e *basicEdge) Target() Vertex { | ||
36 | return e.T | ||
37 | } | ||