election

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elector

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

func NewElector

func NewElector(opts Opts) (leader *Elector, onPromote <-chan time.Time, onDemote <-chan time.Time, onError <-chan error)

func (*Elector) IsLeader

func (i *Elector) IsLeader(context.Context) error

func (*Elector) Start

func (i *Elector) Start()

func (*Elector) Stop

func (i *Elector) Stop() error

type Opts

type Opts struct {
	Redis    redis.Scripter
	TTL      time.Duration
	Wait     time.Duration
	JitterMS int
	Key      string
}

Jump to

Keyboard shortcuts

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