From 0cda9a7539dd97b34588e5d496e131be76fcc3b9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 28 May 2014 21:27:10 -0700 Subject: [PATCH] some comments, package comments --- plugin/plugin.go | 10 ++++++++++ rpc/resource_provider.go | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 plugin/plugin.go diff --git a/plugin/plugin.go b/plugin/plugin.go new file mode 100644 index 000000000..858946700 --- /dev/null +++ b/plugin/plugin.go @@ -0,0 +1,10 @@ +// The plugin package exposes functions and helpers for communicating to +// Terraform plugins which are implemented as standalone binary applications. +// +// plugin.Client fully manages the lifecycle of executing the application, +// connecting to it, and returning the RPC client and service names for +// connecting to it using the terraform/rpc package. +// +// plugin.Serve fully manages listeners to expose an RPC server from a binary +// that plugin.Client can connect to. +package plugin diff --git a/rpc/resource_provider.go b/rpc/resource_provider.go index c52a965e6..ed4c31b1e 100644 --- a/rpc/resource_provider.go +++ b/rpc/resource_provider.go @@ -6,6 +6,8 @@ import ( "github.com/hashicorp/terraform/terraform" ) +// ResourceProvider is an implementation of terraform.ResourceProvider +// that communicates over RPC. type ResourceProvider struct { Client *rpc.Client Name string @@ -24,6 +26,8 @@ func (p *ResourceProvider) Configure(c map[string]interface{}) ([]string, error) return resp.Warnings, err } +// ResourceProviderServer is a net/rpc compatible structure for serving +// a ResourceProvider. This should not be used directly. type ResourceProviderServer struct { Provider terraform.ResourceProvider }