some comments, package comments

This commit is contained in:
Mitchell Hashimoto 2014-05-28 21:27:10 -07:00
parent 8163d364c9
commit 0cda9a7539
2 changed files with 14 additions and 0 deletions

10
plugin/plugin.go Normal file
View File

@ -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

View File

@ -6,6 +6,8 @@ import (
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
) )
// ResourceProvider is an implementation of terraform.ResourceProvider
// that communicates over RPC.
type ResourceProvider struct { type ResourceProvider struct {
Client *rpc.Client Client *rpc.Client
Name string Name string
@ -24,6 +26,8 @@ func (p *ResourceProvider) Configure(c map[string]interface{}) ([]string, error)
return resp.Warnings, err return resp.Warnings, err
} }
// ResourceProviderServer is a net/rpc compatible structure for serving
// a ResourceProvider. This should not be used directly.
type ResourceProviderServer struct { type ResourceProviderServer struct {
Provider terraform.ResourceProvider Provider terraform.ResourceProvider
} }