Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidMessageType = errors.New("Invalid message type") ErrNoAvailablePeers = errors.New("No available peers") )
Functions ¶
Types ¶
type Agent ¶
type Agent interface { // Serve starts a standalone agent, waiting for // incoming connections. Serve() error // Join joins the peers. Join(peerAddrs ...string) error // Leave causes the agent to leave the cluster. Leave() // Broadcast broadcasts a message to the cluster. Broadcast(msg []byte) error // RegisterMessageHandler registers a user provided callback. RegisterMessageHandler(mh MessageHandler) // List prints the infomation in two views. List() ([]byte, error) }
Agent describes the interface of an agent.
Click to show internal directories.
Click to hide internal directories.