leader

package
v0.0.0-...-df0bd0c Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Key             string
	OnAcquireLeader func()
	ConsulClient    *consulapi.Client
}

type Election

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

func NewElection

func NewElection(cfg Config) (*Election, error)

func (*Election) IsLeader

func (e *Election) IsLeader() bool

func (*Election) Run

func (e *Election) Run(ctx context.Context)

func (*Election) Stop

func (e *Election) Stop()

Jump to

Keyboard shortcuts

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