metadata

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(name plugin.Name, rpcClient rpc_client.Client) metadata.Plugin

Adapt converts a rpc client to a Metadata plugin object

func AdaptUpdatable

func AdaptUpdatable(name plugin.Name, rpcClient rpc_client.Client) metadata.Updatable

AdaptUpdatable converts a rpc client to a Metadata plugin object

func FromHandshaker

func FromHandshaker(name plugin.Name, handshaker rpc.Handshaker) (metadata.Plugin, error)

FromHandshaker returns a Plugin client. If the backend implements the Updatable interface, this can be type casted to metadata.Updatable

func NewClient

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

NewClient returns a plugin interface implementation connected to a remote plugin If the backend implements Updatable then the returned Plugin can be casted to Updatable.

func NewClientUpdatable

func NewClientUpdatable(name plugin.Name, socketPath string) (metadata.Updatable, error)

NewClientUpdatable returns a plugin interface implementation connected to a remote plugin

Types

type ChangesRequest

type ChangesRequest struct {
	Name    plugin.Name
	Changes []metadata.Change
}

ChangesRequest is the rpc wrapper of the params to Changes

func (ChangesRequest) Plugin

func (r ChangesRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type ChangesResponse

type ChangesResponse struct {
	Name     plugin.Name
	Original *types.Any
	Proposed *types.Any
	Cas      string
}

ChangesResponse is the rpc wrapper of the params to Changes

type CommitRequest

type CommitRequest struct {
	Name     plugin.Name
	Proposed *types.Any
	Cas      string
}

CommitRequest is the rpc wrapper of the params to Commit

func (CommitRequest) Plugin

func (r CommitRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type CommitResponse

type CommitResponse struct {
	Name plugin.Name
}

CommitResponse is the rpc wrapper of the params to Commit

type GetRequest

type GetRequest struct {
	Name plugin.Name
	Path types.Path
}

GetRequest is the rpc wrapper of the params to Get

func (GetRequest) Plugin

func (r GetRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type GetResponse

type GetResponse struct {
	Name  plugin.Name
	Value *types.Any
}

GetResponse is the rpc wrapper of the result of Get

type ListRequest

type ListRequest struct {
	Name plugin.Name
	Path types.Path
}

ListRequest is the rpc wrapper for request parameters to List

func (ListRequest) Plugin

func (r ListRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type ListResponse

type ListResponse struct {
	Name  plugin.Name
	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 Server

func Server(p metadata.Plugin) *Metadata

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

func ServerWithNames

func ServerWithNames(subplugins func() (map[string]metadata.Plugin, error)) *Metadata

ServerWithNames which supports namespaced plugins

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 returns the types exposed by this kind of RPC service

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

type Updatable

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

Updatable is a rpc object with methods that are exported as JSON RPC service methods

func UpdatableServer

func UpdatableServer(p metadata.Updatable) *Updatable

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

func UpdatableServerWithNames

func UpdatableServerWithNames(subplugins func() (map[string]metadata.Plugin, error)) *Updatable

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

func (*Updatable) Changes

func (u *Updatable) Changes(_ *http.Request, req *ChangesRequest, resp *ChangesResponse) error

Changes sends a batch of changes to get a proposed view and cas

func (*Updatable) Commit

func (u *Updatable) Commit(_ *http.Request, req *CommitRequest, resp *CommitResponse) error

Commit commits the changes

func (*Updatable) Get

func (u *Updatable) Get(_ *http.Request, req *GetRequest, resp *GetResponse) error

Get retrieves the value at path given.

func (*Updatable) ImplementedInterface

func (u *Updatable) ImplementedInterface() spi.InterfaceSpec

ImplementedInterface returns the interface implemented by this RPC service.

func (*Updatable) List

func (u *Updatable) List(_ *http.Request, req *ListRequest, resp *ListResponse) error

List returns a list of child nodes given a path.

func (*Updatable) Types

func (u *Updatable) Types() []string

Types returns the types exposed by this kind of RPC service

func (*Updatable) VendorInfo

func (u *Updatable) VendorInfo() *spi.VendorInfo

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

Jump to

Keyboard shortcuts

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