internal

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addressable

type Addressable interface {
	Plugin() (plugin.Name, error)
}

Addressable is for RPC requests to implement so that the rpc handler can extract key from the RPC request.

type Keyed

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

Keyed is a helper that manages multiple keyed rpc objects in a common namespace

func ServeKeyed

func ServeKeyed(listFunc func() (map[string]interface{}, error)) *Keyed

ServeKeyed returns a map containing keyed rpc objects

func ServeSingle

func ServeSingle(c interface{}) *Keyed

ServeSingle returns a keyed that conforms to the net/rpc rpc call convention.

func (*Keyed) Do

func (k *Keyed) Do(request Addressable, work func(resolved interface{}) error) error

Do performs work calling the work function once the request resolves to an object

func (*Keyed) Keyed

func (k *Keyed) Keyed(name plugin.Name) (interface{}, error)

Keyed performs a lookup of the object by plugin name

func (*Keyed) Resolve

func (k *Keyed) Resolve(request Addressable) (interface{}, error)

Resolve resolves input (a request object for example) that implements the Addressable interface into a plugin

func (*Keyed) Types

func (k *Keyed) Types() []string

Types returns the types exposed by this kind of RPC service

Jump to

Keyboard shortcuts

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