election

package
v0.0.0-...-2e52d37 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Election

type Election interface {
	IsLeader(id identity.NodeID, view types.View) bool
	FindLeaderFor(view types.View) identity.NodeID
}

type Rotation

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

func NewRotation

func NewRotation(peerNo int) *Rotation

func (*Rotation) FindLeaderFor

func (r *Rotation) FindLeaderFor(view types.View) identity.NodeID

func (*Rotation) IsLeader

func (r *Rotation) IsLeader(id identity.NodeID, view types.View) bool

type Static

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

func NewStatic

func NewStatic(master identity.NodeID) *Static

func (*Static) FindLeaderFor

func (st *Static) FindLeaderFor(view types.View) identity.NodeID

func (*Static) IsLeader

func (st *Static) IsLeader(id identity.NodeID, view types.View) bool

Jump to

Keyboard shortcuts

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