Documentation
¶
Index ¶
- type Endpoint
- type Info
- type Informer
- type InterfaceDescription
- type Metadata
- type MethodDescription
- type Name
- func (n Name) Equal(other Name) bool
- func (n Name) GetLookupAndType() (string, string)
- func (n Name) HasType() bool
- func (n Name) IsEmpty() bool
- func (n Name) Lookup() string
- func (n Name) LookupOnly() Name
- func (n Name) MarshalJSON() ([]byte, error)
- func (n Name) Rel(other Name) Name
- func (n Name) String() string
- func (n *Name) UnmarshalJSON(data []byte) error
- func (n Name) WithType(t interface{}) Name
- type Request
- type Response
- type Spec
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct { // Name is the key used to refer to this plugin in all JSON configs Name string // Protocol is the transport protocol -- unix, tcp, etc. Protocol string // Address is the how to connect - socket file, host:port, etc. Address string }
Endpoint is the address of the plugin service
type Info ¶
type Info struct { // Vendor captures vendor-specific information about this plugin Vendor *spi.VendorInfo // Implements is a list of plugin interface and versions this plugin supports Implements []spi.InterfaceSpec // Interfaces (optional) is a slice of interface descriptions by the type and version Interfaces []InterfaceDescription `json:",omitempty"` }
Info is metadata for the plugin
type Informer ¶
type Informer interface { // GetInfo returns metadata about the plugin GetInfo() (Info, error) // GetFunctions returns metadata about the plugin's template functions, if the plugin supports templating. GetFunctions() (map[string][]template.Function, error) }
Informer is the interface that gives information about the plugin such as version and interface methods
type InterfaceDescription ¶
type InterfaceDescription struct { spi.InterfaceSpec Methods []MethodDescription }
InterfaceDescription is a holder for RPC interface version and method descriptions
type Metadata ¶
type Metadata struct { // Kind is the kind of the plugin (e.g. group, ingress, aws) Kind string // Name is the endpoint of the object Name Name // Instance is optionally a key for an object indexable within the remote plugin Instance string // InterfaceSpec is the interface definition of the remote object InterfaceSpec spi.InterfaceSpec }
Metadata describes the plugin
type MethodDescription ¶
type MethodDescription struct { // Request is the RPC request example Request Request // Response is the RPC response example Response Response }
MethodDescription contains information about the RPC method such as the request and response example structs. The request value can be used as an example input, possibly with example plugin-custom properties if the underlying plugin implements the InputExample interface. The response value gives an example of the example response.
type Name ¶
type Name string
Name is a reference to the plugin. Places where it appears include JSON files as type of field `Plugin`.
func (Name) GetLookupAndType ¶
GetLookupAndType returns the plugin name for lookup and sub-type supported by the plugin. The name follows a microformat of $plugin[/$subtype] where $plugin is used for the discovery / lookup by name. The $subtype is used for the Type parameter in the RPC requests. Example: instance-file/json means lookup socket file 'instance-file' and the type is 'json'.
func (Name) LookupOnly ¶
LookupOnly returns the trailing slash form e.g. us-east/
func (Name) MarshalJSON ¶
MarshalJSON implements the JSON marshaler interface
func (Name) Rel ¶
Rel computes the relative form, assuming the receiver is the base path so that Join(other, n.Rel(other)) == other. If it's not relative at all, then the receiver is returned
func (*Name) UnmarshalJSON ¶
UnmarshalJSON implements the JSON unmarshaler interface
type Request ¶
type Request struct { // Version is the version of the JSON RPC protocol Version string `json:"jsonrpc"` // Method is the rpc method to use in the payload field 'method' Method string `json:"method"` // Params contains example inputs. This can be a zero value struct or one with defaults Params interface{} `json:"params"` // ID is the request is ID string `json:"id"` }
Request models the RPC request payload
type Response ¶
type Response struct { // Result is the result of the call Result interface{} `json:"result"` // ID is id matching the request ID ID string `json:"id"` }
Response is the RPC response struct
type Spec ¶
type Spec struct { // Plugin is the name of the plugin Plugin Name // Properties is the configuration of the plugin Properties *types.Any }
Spec models a canonical pattern of fields that exist in a struct/ map / union that indicates the block is a plugin.
type Transport ¶
type Transport struct { // Name is the name of the plugin Name Name // Listen host:port. If not specified, the default behavior is to use unix socket locally Listen string // Advertise is the host:port used for others to discover this endpoint Advertise string // Dir is the directory for discovery (ie location of the socket files, etc.) // If not specified, it will default to system settings (via environment variable -- see pkg/discovery/local Dir string }
Transport describes how the plugin communicates
func DefaultTransport ¶
DefaultTransport returns the default transport based on a simple name. The default is to use unix socket, at directory specified by the pkg/discovery/local discovery mechanism.