leaderelection

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elector

type Elector interface {
	RunOrDie(context.Context, LeaderCallbacks)
}

func NewK8sLeaderElector

func NewK8sLeaderElector(k8sclient kubernetes.Interface, namespace string, leaseName string, identifier string, opts ...Option) Elector

type LeaderCallbacks

type LeaderCallbacks struct {
	OnStartedLeading func(context.Context)
	OnStoppedLeading func()
}

type Option

type Option func(*k8selector)

func WithLeaseDuration

func WithLeaseDuration(f time.Duration) Option

WithLeaseDuration sets lease duration.

func WithRenewDeadline

func WithRenewDeadline(f time.Duration) Option

WithRenewDeadline sets renew deadline.

func WithRetryPeriod

func WithRetryPeriod(f time.Duration) Option

WithRetryPeriod sets retry period.

Jump to

Keyboard shortcuts

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