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 ¶
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 New ¶
New returns a new instance of the cluster, created using the given Config.
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) GetNodeByID ¶
func (cluster *Cluster) GetNodeByID(id uint8) *memberlist.Node
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)
Source Files
¶
- cluster.go
- cluster_conflict.go
- cluster_delegate.go
- cluster_event_delegate.go
- codec.go
- logger.go
- synchronizer.go
Click to show internal directories.
Click to hide internal directories.