Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeaderElection ¶
type LeaderElection interface { // RunOrDie runs the leader election. RunOrDie(ctx context.Context, id string) error // Leader gets the address of the elected leader. Leader() (multiaddr.Multiaddr, error) }
LeaderElection provides an interface to elect a leader in a kubernetes cluster.
func New ¶
func New(namespace, name, kubeConfigPath string) LeaderElection
New build a new LeaderElection instance in the given namespace, with the given name. The kubeConfigPath is used to create the kubernetes interface. It may be empty if the runtime environment is a pod.
Click to show internal directories.
Click to hide internal directories.