diff options
author | Radek Simko <radek.simko@gmail.com> | 2017-08-10 14:38:14 +0200 |
---|---|---|
committer | Radek Simko <radek.simko@gmail.com> | 2017-08-10 14:38:14 +0200 |
commit | c680a8e1622ed0f18751d9d167c836ee24f5e897 (patch) | |
tree | 864f925049d422033dd25a73bafce32b361c8827 /vendor/github.com/hashicorp/terraform/moduledeps/provider.go | |
parent | 38f8880ac81bfabc6d7f82e4dc89661f20fc559e (diff) | |
download | terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.tar.gz terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.tar.zst terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.zip |
vendor: github.com/hashicorp/terraform/...@v0.10.0
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/moduledeps/provider.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/moduledeps/provider.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/moduledeps/provider.go b/vendor/github.com/hashicorp/terraform/moduledeps/provider.go new file mode 100644 index 0000000..89ceefb --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/moduledeps/provider.go | |||
@@ -0,0 +1,30 @@ | |||
1 | package moduledeps | ||
2 | |||
3 | import ( | ||
4 | "strings" | ||
5 | ) | ||
6 | |||
7 | // ProviderInstance describes a particular provider instance by its full name, | ||
8 | // like "null" or "aws.foo". | ||
9 | type ProviderInstance string | ||
10 | |||
11 | // Type returns the provider type of this instance. For example, for an instance | ||
12 | // named "aws.foo" the type is "aws". | ||
13 | func (p ProviderInstance) Type() string { | ||
14 | t := string(p) | ||
15 | if dotPos := strings.Index(t, "."); dotPos != -1 { | ||
16 | t = t[:dotPos] | ||
17 | } | ||
18 | return t | ||
19 | } | ||
20 | |||
21 | // Alias returns the alias of this provider, if any. An instance named "aws.foo" | ||
22 | // has the alias "foo", while an instance named just "docker" has no alias, | ||
23 | // so the empty string would be returned. | ||
24 | func (p ProviderInstance) Alias() string { | ||
25 | t := string(p) | ||
26 | if dotPos := strings.Index(t, "."); dotPos != -1 { | ||
27 | return t[dotPos+1:] | ||
28 | } | ||
29 | return "" | ||
30 | } | ||