cluster

package
v0.0.0-...-4c5efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotLeader      = errors.New("not leader")
	ErrKeyNotFound    = errors.New("key not found")
	ErrPrefixNotFound = errors.New("prefix not found")
	ErrRestart        = errors.New("restart")
)

Functions

This section is empty.

Types

type CallbackContext

type CallbackContext interface {
	KV
	Logger() logr.Logger
	ID() string
	Fatal(error)
}

type Callbacks

type Callbacks struct {
	Leader   func(context.Context, CallbackContext)
	Follower func(context.Context, CallbackContext)
	Cleanup  func(context.Context, CallbackContext)
}

type Cluster

type Cluster interface {
	Start(*config.Config) error
	SetCallbacks(Callbacks) error
	Stepdown()
	Stop()
	Reset()
}

type KV

type KV interface {
	Get(k string) ([]byte, error)
	GetPrefix(k string) (map[string][]byte, error)
	Set(k string, v []byte) error
	Delete(k string) error
}

Jump to

Keyboard shortcuts

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