leaderelection

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenIdentity

func GenIdentity() (string, error)

func NewResourceLock

func NewResourceLock(rc *rest.Config, options Options) (resourcelock.Interface, error)

func Start

func Start(ctx context.Context, rc *rest.Config, options Options) error

Start leader election loop

Types

type Options

type Options struct {
	Identity                   string
	LeaderElectionResourceLock string
	LeaderElectionNamespace    string
	LeaderElectionID           string

	LeaseDuration time.Duration
	RenewDeadline time.Duration
	RetryPeriod   time.Duration

	EventRecorder resourcelock.EventRecorder

	OnNewLeaderFun   func(identity string)
	OnStartedLeading func(ctx context.Context)
	OnStoppedLeading func()
}

Jump to

Keyboard shortcuts

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