election

package
v0.0.0-...-3231407 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

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