Documentation ¶
Overview ¶
Package election implements master elections. Currently only etcd is supported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Election ¶
type Election interface { // Run enters into the election using id as the identifier. Run(ctx context.Context, id string) error // IsMaster returns a channel on which the status of the // election will be broadcasted (true means that this is the // master). IsMaster() chan bool // Current returns a channel on which the name of the current // master is broadcasted. The empty string means that the // master is currently unknown. Current() chan string }
Election represents a master election.
func Etcd ¶
Etcd returns an etcd based master election (endpoints are used to connect to the etcd cluster). The participants synchronize on lock, and the master has delay time to renew its lease. Higher values of delay may lead to more stable mastership at the cost of potentially longer periods without any master.
Click to show internal directories.
Click to hide internal directories.