raft

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPeer

type IPeer interface {
	Join(nodeID, addr string) error
	Leave(nodeID string) error
	Propose(msg *message.Message) error
	Lookup(key string) []string
	IsApplyRight() bool
	GetLeader() (addr, id string)
	GenPeersFile(file string) error
	Stop()
}

type KV added in v2.5.1

type KV struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewKV added in v2.5.1

func NewKV() *KV

func (*KV) Add added in v2.5.1

func (k *KV) Add(key, value string) (new bool)

Add return true if key is set for the first time

func (*KV) Del added in v2.5.1

func (k *KV) Del(key, value string) (empty bool)

Del return true if the array corresponding to key is deleted If the value is "", the key-values pair is deleted

func (*KV) DelByValue added in v2.5.1

func (k *KV) DelByValue(value string) int

DelByValue delete the specified value from the key-values array and delete the key-value pair if the key-values array is empty

func (*KV) Get added in v2.5.1

func (k *KV) Get(key string) []string

func (*KV) GetAll added in v2.5.1

func (k *KV) GetAll() *data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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