controller

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(name plugin.Name, rpcClient rpc_client.Client) controller.Controller

Adapt converts a rpc client to a Controller object

func NewClient

func NewClient(name plugin.Name, socketPath string) (controller.Controller, error)

NewClient returns a plugin interface implementation connected to a remote plugin

Types

type ChangeRequest

type ChangeRequest struct {
	Name      plugin.Name
	Operation controller.Operation
	Spec      types.Spec
}

ChangeRequest is the common request message for Plan and Commit

func (ChangeRequest) Plugin

func (r ChangeRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type ChangeResponse

type ChangeResponse struct {
	Name   plugin.Name
	Object types.Object
	Plan   controller.Plan
}

ChangeResponse is the common response message for Plan and Commit

type Controller

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

Controller is the exported type for json-rpc

func Server

func Server(c controller.Controller) *Controller

Server returns a Controller that conforms to the net/rpc rpc call convention.

func ServerWithNames

func ServerWithNames(subcontrollers func() (map[string]controller.Controller, error)) *Controller

ServerWithNames returns a Controller map

func (*Controller) Commit

func (c *Controller) Commit(_ *http.Request, req *ChangeRequest, resp *ChangeResponse) error

Commit is the rpc method for Commit

func (*Controller) Describe

func (c *Controller) Describe(_ *http.Request, req *FindRequest, resp *FindResponse) error

Describe is the rpc method for Describe

func (*Controller) ExampleProperties

func (c *Controller) ExampleProperties() *types.Any

ExampleProperties returns an example properties used by the plugin

func (*Controller) Free

func (c *Controller) Free(_ *http.Request, req *FindRequest, resp *FindResponse) error

Free is the rpc method for Free

func (*Controller) ImplementedInterface

func (c *Controller) ImplementedInterface() spi.InterfaceSpec

ImplementedInterface returns the interface implemented by this RPC service.

func (*Controller) Plan

func (c *Controller) Plan(_ *http.Request, req *ChangeRequest, resp *ChangeResponse) error

Plan is the rpc method for Plan

func (*Controller) Types

func (c *Controller) Types() []string

Types returns the types exposed by this kind of RPC service

func (*Controller) VendorInfo

func (c *Controller) VendorInfo() *spi.VendorInfo

VendorInfo returns a metadata object about the plugin, if the plugin implements it. See plugin.Vendor

type FindRequest

type FindRequest struct {
	Name     plugin.Name
	Metadata *types.Metadata
}

FindRequest is the common request message for Describe and Free

func (FindRequest) Plugin

func (r FindRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type FindResponse

type FindResponse struct {
	Name    plugin.Name
	Objects []types.Object
}

FindResponse is the common response message for Describe and Free

Jump to

Keyboard shortcuts

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