Documentation ¶
Index ¶
Constants ¶
View Source
const KeyLen = 32
KeyLen is the fixed length of cluster keys, must be checked by callers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { LocalName string // contains filtered or unexported fields }
Cluster represents a running cluster configuration
func New ¶
func New(name string, init bool, clusterKey []byte, bindAddr string, bindPort int, advertiseAddr string, advertisePort int, useIPAsName bool) (*Cluster, error)
New is used to create a new Cluster instance The returned instance is ready to be updated with the local node settings then joined
func (*Cluster) Join ¶
Join tries to join the cluster by contacting provided addresses Provided addresses are passed as is, if no address is provided, known cluster nodes are contacted instead. Joining fail if none of the provided addresses or none of the known nodes can be joined.
func (*Cluster) Leave ¶
func (c *Cluster) Leave()
Leave saves the current state before leaving, then leaves the cluster
Click to show internal directories.
Click to hide internal directories.