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 cluster. NodeName string // BindAddr is used by Serf for gossiping. BindAddr string // Tags are shared to other nodes, they are used // to inform the cluster how to handle the node. Tags map[string]string // StartJoinAddrs is used to configure how to // add new nodes to an existing cluster. StartJoinAddrs []string }
Config holds node configuration.
type Handler ¶
Handler represents a component in a 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 is a Serf wrapper to provide discovery and cluster membership to services.
func New ¶
func New(handler Handler, config Config) (*Membership, error)
New is a factory function to create a Membership.
func (*Membership) Leave ¶
func (m *Membership) Leave() error
Leave removes a member from the cluster.
func (*Membership) Members ¶
func (m *Membership) Members() []serf.Member
Members returns all members in the cluster.
Click to show internal directories.
Click to hide internal directories.