Documentation ¶
Index ¶
- Variables
- type Cluster
- func (cluster *Cluster) BroadcastMessage(pMessage *protocol.Message) error
- func (cluster *Cluster) BroadcastString(sMessage *string) error
- func (cluster *Cluster) Check() error
- func (cluster *Cluster) GetBroadcasts(overhead, limit int) [][]byte
- func (cluster *Cluster) GetNodeByID(id uint8) *memberlist.Node
- func (cluster *Cluster) LocalState(join bool) []byte
- func (cluster *Cluster) MergeRemoteState(s []byte, join bool)
- func (cluster *Cluster) NodeMeta(limit int) []byte
- func (cluster *Cluster) NotifyConflict(existing, other *memberlist.Node)
- func (cluster *Cluster) NotifyJoin(node *memberlist.Node)
- func (cluster *Cluster) NotifyLeave(node *memberlist.Node)
- func (cluster *Cluster) NotifyMsg(data []byte)
- func (cluster *Cluster) NotifyUpdate(node *memberlist.Node)
- func (cluster *Cluster) Start() error
- func (cluster *Cluster) Stop() error
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNodeNotInSync = errors.New("Node not found in syncPartitions list.") ErrMissingSyncPartition = errors.New("Missing sync partition") )
View Source
var (
ErrNodeNotFound = errors.New("Node not found.")
)
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { // Pointer to a Config struct, based on which the Cluster node is created and runs. Config *Config // Router is used for dispatching messages received by this node. // Should be set after the node is created with New(), and before Start(). Router router // contains filtered or unexported fields }
Cluster is a struct for managing the `local view` of the guble cluster, as seen by a node.
func (*Cluster) BroadcastMessage ¶
BroadcastMessage broadcasts a guble-protocol-message to all the other nodes in the guble cluster.
func (*Cluster) BroadcastString ¶
BroadcastString broadcasts a string to all the other nodes in the guble cluster
func (*Cluster) Check ¶
Check returns a non-nil error if the health status of the cluster (as seen by this node) is not perfect.
func (*Cluster) GetBroadcasts ¶
func (*Cluster) GetNodeByID ¶
func (cluster *Cluster) GetNodeByID(id uint8) *memberlist.Node
func (*Cluster) LocalState ¶
func (*Cluster) MergeRemoteState ¶
func (*Cluster) NotifyConflict ¶
func (cluster *Cluster) NotifyConflict(existing, other *memberlist.Node)
func (*Cluster) NotifyJoin ¶
func (cluster *Cluster) NotifyJoin(node *memberlist.Node)
func (*Cluster) NotifyLeave ¶
func (cluster *Cluster) NotifyLeave(node *memberlist.Node)
func (*Cluster) NotifyMsg ¶
NotifyMsg is invoked each time a message is received by this node of the cluster; it decodes and dispatches the messages.
func (*Cluster) NotifyUpdate ¶
func (cluster *Cluster) NotifyUpdate(node *memberlist.Node)
Click to show internal directories.
Click to hide internal directories.