package client
import "github.com/hashicorp/serf/client"
Index ¶
- type Member
- type RPCClient
- func NewRPCClient(addr string) (*RPCClient, error)
- func (c *RPCClient) Close() error
- func (c *RPCClient) ForceLeave(node string) error
- func (c *RPCClient) Join(addrs []string, replay bool) (int, error)
- func (c *RPCClient) Leave() error
- func (c *RPCClient) Members() ([]Member, error)
- func (c *RPCClient) Monitor(level logutils.LogLevel, ch chan<- string) (StreamHandle, error)
- func (c *RPCClient) Stop(handle StreamHandle) error
- func (c *RPCClient) Stream(filter string, ch chan<- map[string]interface{}) (StreamHandle, error)
- func (c *RPCClient) UpdateTags(tags map[string]string, delTags []string) error
- func (c *RPCClient) UserEvent(name string, payload []byte, coalesce bool) error
- type StreamHandle
Types ¶
type Member ¶
type Member struct { Name string // Node name Addr net.IP // Address of the Serf node Port uint16 // Gossip port used by Serf Tags map[string]string Status string ProtocolMin uint8 // Minimum supported Memberlist protocol ProtocolMax uint8 // Maximum supported Memberlist protocol ProtocolCur uint8 // Currently set Memberlist protocol DelegateMin uint8 // Minimum supported Serf protocol DelegateMax uint8 // Maximum supported Serf protocol DelegateCur uint8 // Currently set Serf protocol }
Member is used to represent a single member of the Serf cluster
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient is used to make requests to the Agent using an RPC mechanism. Additionally, the client manages event streams and monitors, enabling a client to easily receive event notifications instead of using the fork/exec mechanism.
func NewRPCClient ¶
NewRPCClient is used to create a new RPC client given the RPC address of the Serf agent. This will return a client, or an error if the connection could not be established.
func (*RPCClient) Close ¶
Close is used to free any resources associated with the client
func (*RPCClient) ForceLeave ¶
ForceLeave is used to ask the agent to issue a leave command for a given node
func (*RPCClient) Join ¶
Join is used to instruct the agent to attempt a join
func (*RPCClient) Leave ¶
Leave is used to trigger a graceful leave and shutdown of the agent
func (*RPCClient) Members ¶
Members is used to fetch a list of known members
func (*RPCClient) Monitor ¶
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) UpdateTags ¶
UpdateTags will modify the tags on a running serf agent
func (*RPCClient) UserEvent ¶
UserEvent is used to trigger sending an event
type StreamHandle ¶
type StreamHandle uint64
StreamHandle is an opaque handle passed to stop to stop streaming
Source Files ¶
- Version
- v0.4.5
- Published
- Feb 25, 2014
- Platform
- windows/amd64
- Imports
- 9 packages
- Last checked
- 2 days ago –
Tools for package owners.