metadata

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(rpcClient rpc_client.Client) metadata.Plugin

Adapt converts a rpc client to a Metadata plugin object

func NewClient

func NewClient(socketPath string) (metadata.Plugin, error)

NewClient returns a plugin interface implementation connected to a remote plugin

Types

type GetRequest

type GetRequest struct {
	Path metadata.Path
}

GetRequest is the rpc wrapper of the params to Get

type GetResponse

type GetResponse struct {
	Value *types.Any
}

GetResponse is the rpc wrapper of the result of Get

type ListRequest

type ListRequest struct {
	Path metadata.Path
}

ListRequest is the rpc wrapper for request parameters to List

type ListResponse

type ListResponse struct {
	Nodes []string
}

ListResponse is the rpc wrapper for the results of List

type Metadata

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

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

func PluginServer

func PluginServer(p metadata.Plugin) *Metadata

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

func PluginServerWithTypes

func PluginServerWithTypes(typed map[string]metadata.Plugin) *Metadata

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

func (*Metadata) Funcs

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

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

func (*Metadata) FuncsByType

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

FuncsByType implements server.TypedFunctionExporter

func (*Metadata) Get

func (p *Metadata) Get(_ *http.Request, req *GetRequest, resp *GetResponse) error

Get retrieves the value at path given.

func (*Metadata) ImplementedInterface

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

ImplementedInterface returns the interface implemented by this RPC service.

func (*Metadata) List

func (p *Metadata) List(_ *http.Request, req *ListRequest, resp *ListResponse) error

List returns a list of child nodes given a path.

func (*Metadata) Types

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

Types implements server.TypedFunctionExporter

func (*Metadata) VendorInfo

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

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

func (*Metadata) WithBase

func (p *Metadata) WithBase(m metadata.Plugin) *Metadata

WithBase sets the base plugin to the given plugin object

func (*Metadata) WithTypes

func (p *Metadata) WithTypes(typed map[string]metadata.Plugin) *Metadata

WithTypes sets the typed plugins to the given map of plugins (by type name)

Jump to

Keyboard shortcuts

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