leadership

package
v0.0.0-...-1d907cd Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 13 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

func SetLeading(leading bool)

func Subscribe

func Subscribe(client kubernetes.Interface, 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

func Unsubscribe(name string)

Types

type Manager

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

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

NewManager creates a new leadership manager for a given system

func (*Manager) Start

func (lm *Manager) Start()

func (*Manager) Stop

func (lm *Manager) Stop()

type Resumer

type Resumer interface {
	Resume()
	Pause()
}

Jump to

Keyboard shortcuts

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