package k8s

import "github.com/google/trillian/util/election2/k8s"

Index

Constants

const ElectionName = "k8s"

ElectionName identifies the kubernetes election implementation.

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.

Source Files

election.go provider.go

Version
v1.7.2 (latest)
Published
Apr 25, 2025
Platform
js/wasm
Imports
20 packages
Last checked
3 days ago

Tools for package owners.