leader

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunOrDie

func RunOrDie(ctx context.Context, namespace, name string, client kubernetes.Interface, cb Callback)

Types

type Callback

type Callback func(cb context.Context)

type Manager added in v0.7.0

type Manager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewManager added in v0.7.0

func NewManager(namespace, name string, k8s kubernetes.Interface) *Manager

func (*Manager) OnLeader added in v0.7.0

func (m *Manager) OnLeader(f func(ctx context.Context) error)

OnLeader this function will be called when leadership is acquired.

func (*Manager) Start added in v0.7.0

func (m *Manager) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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