Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { //unique id across Serf cluster. Serf uses hostname if not set NodeName string //Serf listens at this address and port for gossiping BindAddr string //Serf shares tags to other nodes in cluster and should use these tags for simple data that informs the cluster how to handle this node. Tags map[string]string //Configure new nodes to join an existing cluster. Set the field to the addresses of nodes in the cluster, and Serf's gossip protocol takes care of the rest to join your node to the cluster. (in prod: specify at least 3 addresses to make cluster resilient to one or two node failures or a disrupted network) StartJoinAddrs []string }
type Handler ¶
Handler represents some component in the service that needs to know when a server joins or leaves the cluster.
type Membership ¶
type Membership struct { Config // contains filtered or unexported fields }
Membership type wraps Serf to provide discovery and cluster membership to our service.
func (*Membership) Leave ¶
func (m *Membership) Leave() error
Leave tells the Serf member to leave the Serf cluster
func (*Membership) Members ¶
func (m *Membership) Members() []serf.Member
Members return a point-in-time snapshot of thecluster's Serf members.
Click to show internal directories.
Click to hide internal directories.