Documentation ¶
Index ¶
- func Adapt(name plugin.Name, rpcClient rpc_client.Client) flavor.Plugin
- func NewClient(name plugin.Name, socketPath string) (flavor.Plugin, error)
- type DrainRequest
- type DrainResponse
- type Flavor
- func (p *Flavor) Drain(_ *http.Request, req *DrainRequest, resp *DrainResponse) error
- func (p *Flavor) Funcs() []template.Function
- func (p *Flavor) FuncsByType(t string) []template.Function
- func (p *Flavor) Healthy(_ *http.Request, req *HealthyRequest, resp *HealthyResponse) error
- func (p *Flavor) ImplementedInterface() spi.InterfaceSpec
- func (p *Flavor) Prepare(_ *http.Request, req *PrepareRequest, resp *PrepareResponse) error
- func (p *Flavor) SetExampleProperties(request interface{})
- func (p *Flavor) Types() []string
- func (p *Flavor) Validate(_ *http.Request, req *ValidateRequest, resp *ValidateResponse) error
- func (p *Flavor) VendorInfo() *spi.VendorInfo
- type HealthyRequest
- type HealthyResponse
- type PrepareRequest
- type PrepareResponse
- type ValidateRequest
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
PluginServer returns a Flavor that conforms to the net/rpc rpc call convention.
func PluginServerWithTypes ¶
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 ¶
Funcs implements the template.FunctionExporter method to expose help for plugin's template functions
func (*Flavor) FuncsByType ¶
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 ¶
func (p *Flavor) SetExampleProperties(request interface{})
SetExampleProperties sets the rpc request with any example properties/ custom type
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 ¶
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 ¶
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 Index group_types.Index }
PrepareRequest is the rpc wrapper of the params to Prepare
type PrepareResponse ¶
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 ¶
ValidateResponse is the rpc wrapper for the results of Validate