raft

package
v0.0.0-...-f1513bb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFSM

func NewFSM(cache cache.ICache) raft.FSM

Types

type Entity

type Entity struct {
	Key   string
	Value string
}

type IRaft

type IRaft interface {
	IsLeader() bool
	Set(entity *Entity) (err error)
	Join(peerAddr string)
}

func New

func New(opts ...Option) (IRaft, error)

type Option

type Option func(o *options)

func WithAddr

func WithAddr(addr string) Option

func WithBootstrap

func WithBootstrap(bootstrap bool) Option

func WithCache

func WithCache(cache cache.ICache) Option

func WithDataDir

func WithDataDir(dataDir string) Option

func WithJoinAddr

func WithJoinAddr(joinAddr string) Option

Jump to

Keyboard shortcuts

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