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/plugin/client.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/plugin/client.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/plugin/client.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/plugin/client.go b/vendor/github.com/hashicorp/terraform/plugin/client.go new file mode 100644 index 0000000..3a5cb7a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/plugin/client.go | |||
@@ -0,0 +1,24 @@ | |||
1 | package plugin | ||
2 | |||
3 | import ( | ||
4 | "os/exec" | ||
5 | |||
6 | plugin "github.com/hashicorp/go-plugin" | ||
7 | "github.com/hashicorp/terraform/plugin/discovery" | ||
8 | ) | ||
9 | |||
10 | // ClientConfig returns a configuration object that can be used to instantiate | ||
11 | // a client for the plugin described by the given metadata. | ||
12 | func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig { | ||
13 | return &plugin.ClientConfig{ | ||
14 | Cmd: exec.Command(m.Path), | ||
15 | HandshakeConfig: Handshake, | ||
16 | Managed: true, | ||
17 | Plugins: PluginMap, | ||
18 | } | ||
19 | } | ||
20 | |||
21 | // Client returns a plugin client for the plugin described by the given metadata. | ||
22 | func Client(m discovery.PluginMeta) *plugin.Client { | ||
23 | return plugin.NewClient(ClientConfig(m)) | ||
24 | } | ||