leader

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leader

type Leader struct {
	// contains filtered or unexported fields
}

Leader uses zookeeper to conduct leadership elections and expose whether or not the current node is a leader to applications.

func NewLeader

func NewLeader(instanceID string, zkHosts string, zkPath string) *Leader

NewLeader creates a new leader election and starts the election process. Only a single level zk path is supported at this time; node creation will fail if a multi-level node like '/foo/bar' is used.

func (*Leader) IsLeader

func (l *Leader) IsLeader() bool

IsLeader returns an indication of whether this instance is the leader in the cluster.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL