election

package
v0.0.0-...-9146478 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionPut = Action(iota + 1)
	ActionDelete
)

Action values

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int32

Action .

func (Action) String

func (a Action) String() string

type Event

type Event struct {
	Action Action
	Node   Node
}

Event .

type Interface

type Interface interface {
	Node() Node
	Nodes() ([]Node, error)
	Leader() (*Node, error)
	IsLeader() bool
	ResignLeader() error
	OnLeader(handler func(context.Context))
	Watch(ctx context.Context, opts ...WatchOption) <-chan Event
	SetNonVoter(b bool)
}

Interface .

type Node

type Node struct {
	ID string
}

Node .

type WatchOption

type WatchOption interface{}

WatchOption .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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