diff options
Diffstat (limited to 'vendor/github.com/hashicorp/go-getter/get_base.go')
-rw-r--r-- | vendor/github.com/hashicorp/go-getter/get_base.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/go-getter/get_base.go b/vendor/github.com/hashicorp/go-getter/get_base.go new file mode 100644 index 0000000..09e9b63 --- /dev/null +++ b/vendor/github.com/hashicorp/go-getter/get_base.go | |||
@@ -0,0 +1,20 @@ | |||
1 | package getter | ||
2 | |||
3 | import "context" | ||
4 | |||
5 | // getter is our base getter; it regroups | ||
6 | // fields all getters have in common. | ||
7 | type getter struct { | ||
8 | client *Client | ||
9 | } | ||
10 | |||
11 | func (g *getter) SetClient(c *Client) { g.client = c } | ||
12 | |||
13 | // Context tries to returns the Contex from the getter's | ||
14 | // client. otherwise context.Background() is returned. | ||
15 | func (g *getter) Context() context.Context { | ||
16 | if g == nil || g.client == nil { | ||
17 | return context.Background() | ||
18 | } | ||
19 | return g.client.Ctx | ||
20 | } | ||