Documentation ¶
Index ¶
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
type InterfaceDescription struct { spi.InterfaceSpec Methods []MethodDescription }
InterfaceDescription is a holder for RPC interface version and method descriptions
type MethodDescription ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
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) MarshalJSON ¶ added in v0.2.0
MarshalJSON implements the JSON marshaler interface
func (*Name) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON implements the JSON unmarshaler interface
type Request ¶ added in v0.2.0
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