raft

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Follower  = graft.FOLLOWER
	Candidate = graft.CANDIDATE
	Leader    = graft.LEADER
	Closed    = graft.CLOSED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*params)

func WithContext

func WithContext(ctx context.Context) Option

func WithErrorHandler

func WithErrorHandler(f func(error)) Option

func WithLog

func WithLog(log string) Option

func WithName

func WithName(name string) Option

func WithSize

func WithSize(size int) Option

func WithStateChangeHandler

func WithStateChangeHandler(f func(from State, to State) error) Option

type Raft

type Raft interface {
	State() State
	IsLeader() bool
	Wait(context.Context, State) error
}

func NewRaft

func NewRaft(nc *nats.Conn, opts ...Option) (Raft, error)

type State

type State = graft.State

Jump to

Keyboard shortcuts

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