Versions in this module Expand all Collapse all v1 v1.0.1 Aug 7, 2026 Changes in this version + var ErrNotALeader = errors.New("not a leader") + func Providers(opt ...ProvidersOptionFunc) di.Deps + type Dispatcher interface + Fire func(ctx context.Context, status *Status) error + type Driver interface + Campaign func(ctx context.Context, toLeader func(bool)) error + Resign func(context.Context) error + type DriverArgs struct + Populator contract.DIPopulator + type Election struct + func NewElection(dispatcher Dispatcher, driver Driver) *Election + func (e *Election) Campaign(ctx context.Context) error + func (e *Election) Resign(ctx context.Context) error + func (e *Election) Status() *Status + type Option struct + EtcdName string + type ProvidersOptionFunc func(options *providersOption) + func WithDriver(driver Driver) ProvidersOptionFunc + func WithDriverConstructor(f func(args DriverArgs) (Driver, error)) ProvidersOptionFunc + type Status struct + func (s Status) IsLeader() bool + type StatusChanged interface + On func(func(ctx context.Context, status *Status) error) (unsubscribe func())