client

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

Documentation

Index

Constants

View Source
const ClientTimeoutEnv = "INFRAKIT_CLIENT_TIMEOUT"

ClientTimeoutEnv environment variable for the client timeout (in time.Duration)

Variables

This section is empty.

Functions

func IsErrVersionMismatch

func IsErrVersionMismatch(e error) bool

IsErrVersionMismatch return true if the error is from mismatched api versions.

func NewHandshaker

func NewHandshaker(address string) (rpc.Handshaker, error)

NewHandshaker returns a handshaker object, or a generic, untyped rpc object

Types

type Client

type Client interface {

	// Addr returns the address -- e.g. unix socket path
	Addr() string

	// Call invokes an RPC method with an argument and a pointer to a result that will hold the return value.
	Call(method string, arg interface{}, result interface{}) error
}

Client allows execution of RPCs.

func FromHandshaker

func FromHandshaker(handshaker rpc.Handshaker, api spi.InterfaceSpec) (Client, error)

FromHandshaker returns a full rpc client from handshaker

func New

func New(address string, api spi.InterfaceSpec) (Client, error)

New creates a new Client that communicates with a unix socket and validates the remote API.

type InfoClient

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

InfoClient is the client for retrieving plugin info

func NewPluginInfoClient

func NewPluginInfoClient(address string) (*InfoClient, error)

NewPluginInfoClient returns a plugin informer that can give metadata about a plugin

func (*InfoClient) GetFunctions

func (i *InfoClient) GetFunctions() (map[string][]template.Function, error)

GetFunctions returns metadata about the plugin's template functions, if the plugin supports templating.

func (*InfoClient) GetInfo

func (i *InfoClient) GetInfo() (plugin.Info, error)

GetInfo implements the Info interface and returns the metadata about the plugin

Jump to

Keyboard shortcuts

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