leader

package
v0.0.2 Latest Latest
Warning

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

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

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

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

func NewManager

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

func (*Manager) OnLeader

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

OnLeader this function will be called when leadership is acquired.

func (*Manager) Start

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