k8s

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ElectionName = "k8s"

ElectionName identifies the kubernetes election implementation.

Variables

This section is empty.

Functions

This section is empty.

Types

type Election

type Election struct {
	// contains filtered or unexported fields
}

func (*Election) Await

func (e *Election) Await(ctx context.Context) error

func (*Election) Close

func (e *Election) Close(ctx context.Context) error

func (*Election) GetLeader

func (e *Election) GetLeader() string

GetLeader returns the identity of the last observed leader or returns the empty string if no leader has yet been observed. This function is for informational purposes. (e.g. monitoring, logs, etc.)

func (*Election) IsLeader

func (e *Election) IsLeader() bool

IsLeader returns true if the last observed leader was this client else returns false.

func (*Election) Resign

func (e *Election) Resign(ctx context.Context) error

func (*Election) WithMastership

func (e *Election) WithMastership(ctx context.Context) (context.Context, error)

WithMastership returns a context that is canceled if mastership is lost.

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory creates Election instances.

func (*Factory) NewElection

func (f *Factory) NewElection(ctx context.Context, resourceID string) (election2.Election, error)

NewElection creates a specific Election instance.

Jump to

Keyboard shortcuts

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