flavor

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(name plugin.Name, socketPath string) (flavor.Plugin, error)

NewClient returns a plugin interface implementation connected to a remote plugin

Types

type DrainRequest

type DrainRequest struct {
	Type       string
	Properties *types.Any
	Instance   instance.Description
}

DrainRequest is the rpc wrapper of the params to Drain

type DrainResponse

type DrainResponse struct {
	Type string
	OK   bool
}

DrainResponse is the rpc wrapper of the result of Drain

type Flavor

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

Flavor the exported type needed to conform to json-rpc call convention

func PluginServer

func PluginServer(p flavor.Plugin) *Flavor

PluginServer returns a Flavor that conforms to the net/rpc rpc call convention.

func PluginServerWithTypes added in v0.2.0

func PluginServerWithTypes(typed map[string]flavor.Plugin) *Flavor

PluginServerWithTypes which supports multiple types of flavor plugins. The de-multiplexing is done by the server's RPC method implementations.

func (*Flavor) Drain

func (p *Flavor) Drain(_ *http.Request, req *DrainRequest, resp *DrainResponse) error

Drain drains the instance. It's the inverse of prepare before provision and happens before destroy.

func (*Flavor) Funcs added in v0.3.1

func (p *Flavor) Funcs() []template.Function

Funcs implements the template.FunctionExporter method to expose help for plugin's template functions

func (*Flavor) FuncsByType added in v0.3.1

func (p *Flavor) FuncsByType(t string) []template.Function

FuncsByType implements server.TypedFunctionExporter

func (*Flavor) Healthy

func (p *Flavor) Healthy(_ *http.Request, req *HealthyRequest, resp *HealthyResponse) error

Healthy determines whether an instance is healthy.

func (*Flavor) ImplementedInterface

func (p *Flavor) ImplementedInterface() spi.InterfaceSpec

ImplementedInterface returns the interface implemented by this RPC service.

func (*Flavor) Prepare

func (p *Flavor) Prepare(_ *http.Request, req *PrepareRequest, resp *PrepareResponse) error

Prepare allows the Flavor to modify the provisioning instructions for an instance. For example, a helper could be used to place additional tags on the machine, or generate a specialized Init command based on the flavor configuration.

func (*Flavor) SetExampleProperties added in v0.2.0

func (p *Flavor) SetExampleProperties(request interface{})

SetExampleProperties sets the rpc request with any example properties/ custom type

func (*Flavor) Types added in v0.3.1

func (p *Flavor) Types() []string

Types implements server.TypedFunctionExporter

func (*Flavor) Validate

func (p *Flavor) Validate(_ *http.Request, req *ValidateRequest, resp *ValidateResponse) error

Validate checks whether the helper can support a configuration.

func (*Flavor) VendorInfo added in v0.2.0

func (p *Flavor) VendorInfo() *spi.VendorInfo

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

type HealthyRequest

type HealthyRequest struct {
	Type       string
	Properties *types.Any
	Instance   instance.Description
}

HealthyRequest is the rpc wrapper of the params to Healthy

type HealthyResponse

type HealthyResponse struct {
	Type   string
	Health flavor.Health
}

HealthyResponse is the rpc wrapper of the result of Healthy

type PrepareRequest

type PrepareRequest struct {
	Type       string
	Properties *types.Any
	Spec       instance.Spec
	Allocation group_types.AllocationMethod
}

PrepareRequest is the rpc wrapper of the params to Prepare

type PrepareResponse

type PrepareResponse struct {
	Type string
	Spec instance.Spec
}

PrepareResponse is the rpc wrapper of the result of Prepare

type ValidateRequest

type ValidateRequest struct {
	Type       string
	Properties *types.Any
	Allocation group_types.AllocationMethod
}

ValidateRequest is the rpc wrapper for request parameters to Validate

type ValidateResponse

type ValidateResponse struct {
	Type string
	OK   bool
}

ValidateResponse is the rpc wrapper for the results of Validate

Jump to

Keyboard shortcuts

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