election

package
v0.0.0-...-66c35ad Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	WorkingMode_INIT     WorkingMode = "init"
	WorkingMode_FOLLOWER             = "follower"
	WorkingMode_LEADER               = "leader"
	WorkingMode_UNSAFE               = "unsafe"
)
View Source
const (
	StatusKey_WorkMode = "work_mode"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Election

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

func NewElection

func NewElection(config *ElectionConfig) *Election

func (*Election) ChangeNotify

func (o *Election) ChangeNotify() <-chan struct{}

func (*Election) GetEpoch

func (o *Election) GetEpoch() int

func (*Election) IsLeader

func (o *Election) IsLeader() bool

func (*Election) QuitNotify

func (o *Election) QuitNotify() <-chan struct{}

func (*Election) Start

func (o *Election) Start() error

func (*Election) Stop

func (o *Election) Stop() error

type ElectionConfig

type ElectionConfig struct {
	ZkAddrs         []string
	ZkRoot          string
	ElectionTimeout int
}

type WorkingMode

type WorkingMode string

Jump to

Keyboard shortcuts

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