election

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Election

type Election struct {
	RoleCh chan role.Role
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (e *Election, err error)

func (*Election) Leader

func (e *Election) Leader() (name string, err error)

func (*Election) Resign

func (e *Election) Resign(ctx context.Context) (err error)

func (*Election) Role

func (e *Election) Role() role.Role

func (*Election) Run

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

func (*Election) SetRole

func (e *Election) SetRole(r role.Role)

type Option

type Option func(e *Election)

func OptionNode

func OptionNode(node *node.Node) Option

func OptionPrefix

func OptionPrefix(prefix string) Option

func OptionTTL

func OptionTTL(ttl int) Option

Jump to

Keyboard shortcuts

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