Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // NodeName acts as the node's unique identifier across the Serf cluster. NodeName string // Serf listens on this address for gossiping. [Ref: gossip protocol serf] BindAddr string // Used for sharing data to other nodes in the cluster. This information is // used by the cluster to decide how to handle this node. Tags map[string]string // Used for joining a new node to the cluster. Joining a new node requires // pointing to atleast one in-cluster node. In a prod env., it's advisable // to specify at least 3 addrs to increase cluster resliency. StartJoinAddrs []string }
Configuration of a single node in a Surf cluster.
type Membership ¶
type Membership struct { Config // contains filtered or unexported fields }
Represents membership of a node to a cluster. It wraps a Serf instance, providing a handle to cluster membership operations.
func New ¶
func New(handler Handler, config Config) (*Membership, error)
Creates a new Serf cluster member with the given config and cluster handler. It internally setups up the Serf configuration and event handlers.
func (*Membership) Leave ¶
func (m *Membership) Leave() error
Telles this member to leave the Serf cluster.
func (*Membership) Members ¶
func (m *Membership) Members() []serf.Member
Returns a point-in-time snapshot of the cluster's Serf members.
Click to show internal directories.
Click to hide internal directories.