client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2014 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Member

type Member struct {
	Name        string
	Addr        net.IP
	Port        uint16
	Tags        map[string]string
	Status      string
	ProtocolMin uint8
	ProtocolMax uint8
	ProtocolCur uint8
	DelegateMin uint8
	DelegateMax uint8
	DelegateCur uint8
}

type RPCClient

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

RPCClient is the RPC client to make requests to the agent RPC.

func NewRPCClient

func NewRPCClient(addr string) (*RPCClient, error)

NewRPCClient is used to create a new RPC client given the address. This will properly dial, handshake, and start listening

func (*RPCClient) Close

func (c *RPCClient) Close() error

Close is used to free any resources associated with the client

func (*RPCClient) ForceLeave

func (c *RPCClient) ForceLeave(node string) error

ForceLeave is used to ask the agent to issue a leave command for a given node

func (*RPCClient) Join

func (c *RPCClient) Join(addrs []string, replay bool) (int, error)

Join is used to instruct the agent to attempt a join

func (*RPCClient) Leave

func (c *RPCClient) Leave() error

Leave is used to trigger a graceful leave and shutdown

func (*RPCClient) Members

func (c *RPCClient) Members() ([]Member, error)

Members is used to fetch a list of known members

func (*RPCClient) Monitor

func (c *RPCClient) Monitor(level logutils.LogLevel, ch chan<- string) (StreamHandle, error)

Monitor is used to subscribe to the logs of the agent

func (*RPCClient) Stop

func (c *RPCClient) Stop(handle StreamHandle) error

Stop is used to unsubscribe from logs or event streams

func (*RPCClient) Stream

func (c *RPCClient) Stream(filter string, ch chan<- map[string]interface{}) (StreamHandle, error)

Stream is used to subscribe to events

func (*RPCClient) UserEvent

func (c *RPCClient) UserEvent(name string, payload []byte, coalesce bool) error

UserEvent is used to trigger sending an event

type StreamHandle

type StreamHandle uint64

StreamHandle is an opaque handle passed to stop to stop streaming

Jump to

Keyboard shortcuts

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