store

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RaftStore

type RaftStore interface {
	Open(enableSingle bool, localID string) error

	// Get returns the value for the given key
	Get(key string) (string, error)

	// ScanKvs 根据前缀获取符合前缀的所有Key value
	ScanKvs(p string) map[string]string

	// ScanKeys 仅扫描KEY
	ScanKeys(p string) []string

	// Set sets the value for the given key, via distributed consensus
	Set(key, value string, exp int64) error

	// Delete removes the given key, via distributed consensus
	Delete(key string) error

	// Join joins the node, identified by nodeID and reachable at addr, to the cluster
	Join(nodeID string, addr string) error

	Remove(nodeID, addr string) error

	Raft() *raft.Raft
}

func GetRaftStore

func GetRaftStore() RaftStore

func New

func New(dataDir, raftDir, raftBindAddr string) RaftStore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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