package k8s
import "github.com/google/trillian/util/election2/k8s"
Index ¶
- Constants
- type Election
- func (e *Election) Await(ctx context.Context) error
- func (e *Election) Close(ctx context.Context) error
- func (e *Election) GetLeader() string
- func (e *Election) IsLeader() bool
- func (e *Election) Resign(ctx context.Context) error
- func (e *Election) WithMastership(ctx context.Context) (context.Context, error)
- type Factory
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 (*Election) Close ¶
func (*Election) GetLeader ¶
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 ¶
IsLeader returns true if the last observed leader was this client else returns false.
func (*Election) Resign ¶
func (*Election) WithMastership ¶
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 ¶
NewElection creates a specific Election instance.
Source Files ¶
- Version
- v1.7.2 (latest)
- Published
- Apr 25, 2025
- Platform
- js/wasm
- Imports
- 20 packages
- Last checked
- 3 days ago –
Tools for package owners.