Documentation ¶
Index ¶
- Constants
- type Channel
- type Peer
- func (p *Peer) AddState(key string, s State) *Channel
- func (p *Peer) ClusterSize() int
- func (p *Peer) Info() map[string]interface{}
- func (p *Peer) Leave(timeout time.Duration) error
- func (p *Peer) Name() string
- func (p *Peer) Peers() []*memberlist.Node
- func (p *Peer) Position() int
- func (p *Peer) Self() *memberlist.Node
- type State
Constants ¶
View Source
const ( DefaultPushPullInterval = 60 * time.Second DefaultGossipInterval = 200 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel allows clients to send messages for a specific state type that will be broadcasted in a best-effort manner.
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer is a single peer in a gossip cluster.
func (*Peer) AddState ¶
AddState adds a new state that will be gossiped. It returns a channel to which broadcast messages for the state can be sent.
func (*Peer) ClusterSize ¶
ClusterSize returns the current number of alive members in the cluster.
func (*Peer) Peers ¶
func (p *Peer) Peers() []*memberlist.Node
Peers returns the peers in the cluster.
func (*Peer) Self ¶
func (p *Peer) Self() *memberlist.Node
Self returns the node information about the peer itself.
Click to show internal directories.
Click to hide internal directories.