rpc

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2015 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(server *rpc.Server, thing interface{}) (name string, err error)

Register registers a Terraform thing with the RPC server and returns the name it is registered under.

Types

type BasicError

type BasicError struct {
	Message string
}

This is a type that wraps error types so that they can be messaged across RPC channels. Since "error" is an interface, we can't always gob-encode the underlying structure. This is a valid error interface implementer that we will push across.

func NewBasicError

func NewBasicError(err error) *BasicError

func (*BasicError) Error

func (e *BasicError) Error() string

type Client added in v0.3.0

type Client struct {
	// contains filtered or unexported fields
}

Client connects to a Server in order to request plugin implementations for Terraform.

func Dial added in v0.3.0

func Dial(network, address string) (*Client, error)

Dial opens a connection to a Terraform RPC server and returns a client.

func NewClient added in v0.3.0

func NewClient(conn io.ReadWriteCloser) (*Client, error)

NewClient creates a client from an already-open connection-like value. Dial is typically used instead.

func (*Client) Close added in v0.3.0

func (c *Client) Close() error

Close closes the connection. The client is no longer usable after this is called.

func (*Client) ResourceProvider added in v0.3.0

func (c *Client) ResourceProvider() (terraform.ResourceProvider, error)

func (*Client) ResourceProvisioner added in v0.3.0

func (c *Client) ResourceProvisioner() (terraform.ResourceProvisioner, error)

type ProviderFunc added in v0.3.0

type ProviderFunc func() terraform.ResourceProvider

ProviderFunc creates terraform.ResourceProviders when they're requested from the server.

type ProvisionerFunc added in v0.3.0

type ProvisionerFunc func() terraform.ResourceProvisioner

ProvisionerFunc creates terraform.ResourceProvisioners when they're requested from the server.

type ResourceProvider

type ResourceProvider struct {
	Broker *muxBroker
	Client *rpc.Client
	Name   string
}

ResourceProvider is an implementation of terraform.ResourceProvider that communicates over RPC.

func (*ResourceProvider) Close added in v0.6.0

func (p *ResourceProvider) Close() error

func (*ResourceProvider) Configure

func (*ResourceProvider) Input added in v0.3.0

func (*ResourceProvider) Refresh

func (*ResourceProvider) Resources

func (p *ResourceProvider) Resources() []terraform.ResourceType

func (*ResourceProvider) Validate

func (p *ResourceProvider) Validate(c *terraform.ResourceConfig) ([]string, []error)

func (*ResourceProvider) ValidateResource

func (p *ResourceProvider) ValidateResource(
	t string, c *terraform.ResourceConfig) ([]string, []error)

type ResourceProviderApplyArgs

type ResourceProviderApplyArgs struct {
	Info  *terraform.InstanceInfo
	State *terraform.InstanceState
	Diff  *terraform.InstanceDiff
}

type ResourceProviderApplyResponse

type ResourceProviderApplyResponse struct {
	State *terraform.InstanceState
	Error *BasicError
}

type ResourceProviderConfigureResponse

type ResourceProviderConfigureResponse struct {
	Error *BasicError
}

type ResourceProviderDiffArgs

type ResourceProviderDiffArgs struct {
	Info   *terraform.InstanceInfo
	State  *terraform.InstanceState
	Config *terraform.ResourceConfig
}

type ResourceProviderDiffResponse

type ResourceProviderDiffResponse struct {
	Diff  *terraform.InstanceDiff
	Error *BasicError
}

type ResourceProviderInputArgs added in v0.3.0

type ResourceProviderInputArgs struct {
	InputId uint32
	Config  *terraform.ResourceConfig
}

type ResourceProviderInputResponse added in v0.3.0

type ResourceProviderInputResponse struct {
	Config *terraform.ResourceConfig
	Error  *BasicError
}

type ResourceProviderRefreshArgs added in v0.3.0

type ResourceProviderRefreshArgs struct {
	Info  *terraform.InstanceInfo
	State *terraform.InstanceState
}

type ResourceProviderRefreshResponse

type ResourceProviderRefreshResponse struct {
	State *terraform.InstanceState
	Error *BasicError
}

type ResourceProviderServer

type ResourceProviderServer struct {
	Broker   *muxBroker
	Provider terraform.ResourceProvider
}

ResourceProviderServer is a net/rpc compatible structure for serving a ResourceProvider. This should not be used directly.

func (*ResourceProviderServer) Apply

func (*ResourceProviderServer) Configure

func (*ResourceProviderServer) Diff

func (*ResourceProviderServer) Input added in v0.3.0

func (*ResourceProviderServer) Refresh

func (*ResourceProviderServer) Resources

func (s *ResourceProviderServer) Resources(
	nothing interface{},
	result *[]terraform.ResourceType) error

func (*ResourceProviderServer) Validate

func (*ResourceProviderServer) ValidateResource

type ResourceProviderValidateArgs

type ResourceProviderValidateArgs struct {
	Config *terraform.ResourceConfig
}

type ResourceProviderValidateResourceArgs

type ResourceProviderValidateResourceArgs struct {
	Config *terraform.ResourceConfig
	Type   string
}

type ResourceProviderValidateResourceResponse

type ResourceProviderValidateResourceResponse struct {
	Warnings []string
	Errors   []*BasicError
}

type ResourceProviderValidateResponse

type ResourceProviderValidateResponse struct {
	Warnings []string
	Errors   []*BasicError
}

type ResourceProvisioner

type ResourceProvisioner struct {
	Broker *muxBroker
	Client *rpc.Client
	Name   string
}

ResourceProvisioner is an implementation of terraform.ResourceProvisioner that communicates over RPC.

func (*ResourceProvisioner) Apply

func (*ResourceProvisioner) Close added in v0.6.0

func (p *ResourceProvisioner) Close() error

func (*ResourceProvisioner) Validate

func (p *ResourceProvisioner) Validate(c *terraform.ResourceConfig) ([]string, []error)

type ResourceProvisionerApplyArgs

type ResourceProvisionerApplyArgs struct {
	OutputId uint32
	State    *terraform.InstanceState
	Config   *terraform.ResourceConfig
}

type ResourceProvisionerApplyResponse

type ResourceProvisionerApplyResponse struct {
	Error *BasicError
}

type ResourceProvisionerServer

type ResourceProvisionerServer struct {
	Broker      *muxBroker
	Provisioner terraform.ResourceProvisioner
}

ResourceProvisionerServer is a net/rpc compatible structure for serving a ResourceProvisioner. This should not be used directly.

func (*ResourceProvisionerServer) Apply

func (*ResourceProvisionerServer) Validate

type ResourceProvisionerValidateArgs

type ResourceProvisionerValidateArgs struct {
	Config *terraform.ResourceConfig
}

type ResourceProvisionerValidateResponse

type ResourceProvisionerValidateResponse struct {
	Warnings []string
	Errors   []*BasicError
}

type Server added in v0.3.0

type Server struct {
	ProviderFunc    ProviderFunc
	ProvisionerFunc ProvisionerFunc
}

Server listens for network connections and then dispenses interface implementations for Terraform over net/rpc.

func (*Server) Accept added in v0.3.0

func (s *Server) Accept(lis net.Listener)

Accept accepts connections on a listener and serves requests for each incoming connection. Accept blocks; the caller typically invokes it in a go statement.

func (*Server) ServeConn added in v0.3.0

func (s *Server) ServeConn(conn io.ReadWriteCloser)

ServeConn runs a single connection.

ServeConn blocks, serving the connection until the client hangs up.

type UIInput added in v0.3.0

type UIInput struct {
	Client *rpc.Client
	Name   string
}

UIInput is an implementatin of terraform.UIInput that communicates over RPC.

func (*UIInput) Input added in v0.3.0

func (i *UIInput) Input(opts *terraform.InputOpts) (string, error)

type UIInputInputResponse added in v0.3.0

type UIInputInputResponse struct {
	Value string
	Error *BasicError
}

type UIInputServer added in v0.3.0

type UIInputServer struct {
	UIInput terraform.UIInput
}

UIInputServer is a net/rpc compatible structure for serving a UIInputServer. This should not be used directly.

func (*UIInputServer) Input added in v0.3.0

func (s *UIInputServer) Input(
	opts *terraform.InputOpts,
	reply *UIInputInputResponse) error

type UIOutput added in v0.3.0

type UIOutput struct {
	Client *rpc.Client
	Name   string
}

UIOutput is an implementatin of terraform.UIOutput that communicates over RPC.

func (*UIOutput) Output added in v0.3.0

func (o *UIOutput) Output(v string)

type UIOutputServer added in v0.3.0

type UIOutputServer struct {
	UIOutput terraform.UIOutput
}

UIOutputServer is the RPC server for serving UIOutput.

func (*UIOutputServer) Output added in v0.3.0

func (s *UIOutputServer) Output(
	v string,
	reply *interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL