Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) Broadcast(m Message)
- func (c *Cluster) Close() error
- func (c *Cluster) LocalNode() Node
- func (c *Cluster) Name() string
- func (c *Cluster) Nodes() []Node
- func (c *Cluster) Notify()
- func (c *Cluster) NotifyJoin(node *memberlist.Node)
- func (c *Cluster) NotifyLeave(node *memberlist.Node)
- func (c *Cluster) NotifyUpdate(node *memberlist.Node)
- func (c *Cluster) SendTo(n Node, m Message) error
- func (c *Cluster) ShardInfo(id uint64) dragonboat.ShardView
- func (c *Cluster) Start(join []string)
- func (c *Cluster) WatchKey(key string, f func(message Message))
- func (c *Cluster) WatchPrefix(key string, f func(message Message))
- type Info
- type Message
- type Node
- type NodeMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster holds information about the memberlist cluster and active listeners.
func New ¶
New configures and creates a new memberlist. To connect the node to the cluster, see (*Cluster).Start.
func (*Cluster) Close ¶
Close gracefully disconnects the node from the memberlist cluster. It tries to wait to broadcast currently pending outgoing messages before leaving.
func (*Cluster) NotifyJoin ¶
func (c *Cluster) NotifyJoin(node *memberlist.Node)
func (*Cluster) NotifyLeave ¶
func (c *Cluster) NotifyLeave(node *memberlist.Node)
func (*Cluster) NotifyUpdate ¶
func (c *Cluster) NotifyUpdate(node *memberlist.Node)
func (*Cluster) WatchKey ¶
WatchKey sets up a background listener for the given key. Anytime a message with the key is received, the supplied function f is called.
func (*Cluster) WatchPrefix ¶
WatchPrefix sets up a background listener for the given key prefix. Anytime a message with a key matching the specified prefix is received, the supplied function f is called.
type Info ¶
type Info struct { // NodeHostID is the unique identifier of the NodeHost instance. NodeHostID string // NodeID is the ID of this replica. NodeID uint64 // RaftAddress is the public address of the NodeHost used for exchanging Raft // messages, snapshots and other metadata with other NodeHost instances. RaftAddress string // ClientAddress is the public address of the Regatta host used for client requests. ClientAddress string // ShardInfo is a list of all Raft shards managed by the NodeHost ShardInfoList []dragonboat.ShardInfo // LogInfo is a list of raftio.NodeInfo values representing all Raft logs // stored on the NodeHost. LogInfo []raftio.NodeInfo }
Info carries Raft-related information to the particular NodeHost in the cluster.
type Message ¶
Message sent between the members of the memberlist.
func (Message) Finished ¶
func (m Message) Finished()
Finished is invoked when the message will no longer be broadcast, either due to invalidation or to the transmit limit being reached.
func (Message) Invalidates ¶
func (m Message) Invalidates(b memberlist.Broadcast) bool
Invalidates checks if enqueuing the current broadcast invalidates a previous broadcast.
type Node ¶
type Node struct { memberlist.Node NodeMeta }