leadership

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Leader

func Leader() string

func Leading

func Leading() bool

func SetLeading added in v1.12.0

func SetLeading(leading bool)

func Subscribe

func Subscribe(client v1.CoreV1Interface, name string) (<-chan bool, error)

Subscribe starts the leader election process if not already started and returns a channel subscriber can listen on for election results

func Unsubscribe added in v1.0.0

func Unsubscribe(name string)

Types

type Manager added in v1.0.6

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

Manager manages the pausing and resumption of a given system based on changes in leadership

func NewManager added in v1.0.6

func NewManager(system Resumer, name string, kubeClient kubernetes.Interface) *Manager

NewManager creates a new leadership manager for a given system

func (*Manager) Start added in v1.0.6

func (lm *Manager) Start()

func (*Manager) Stop added in v1.0.6

func (lm *Manager) Stop()

type Resumer added in v1.0.6

type Resumer interface {
	Resume()
	Pause()
}

Jump to

Keyboard shortcuts

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