Documentation ¶
Index ¶
- Constants
- Variables
- func NewLFSM() dbsm.CreateConcurrentStateMachineFunc
- type LFSM
- func (fsm *LFSM) Close() (err error)
- func (fsm *LFSM) Lookup(e interface{}) (interface{}, error)
- func (fsm *LFSM) PrepareSnapshot() (interface{}, error)
- func (fsm *LFSM) RecoverFromSnapshot(r io.Reader, _ []dbsm.SnapshotFile, _ <-chan struct{}) error
- func (fsm *LFSM) SaveSnapshot(ctx interface{}, w io.Writer, _ dbsm.ISnapshotFileCollection, ...) error
- func (fsm *LFSM) Update(entries []dbsm.Entry) ([]dbsm.Entry, error)
- type MapStore
- func (s *MapStore) Delete(key string, ver uint64) error
- func (s *MapStore) Exists(key string) (bool, error)
- func (s *MapStore) Get(key string) (Pair, error)
- func (s *MapStore) GetAll(pattern string) ([]Pair, error)
- func (s *MapStore) GetAllValues(pattern string) ([]string, error)
- func (s *MapStore) List(filePath string) ([]string, error)
- func (s *MapStore) ListDir(filePath string) ([]string, error)
- func (s *MapStore) MarshalJSON() ([]byte, error)
- func (s *MapStore) Set(key string, value string, ver uint64) (Pair, error)
- func (s *MapStore) UnmarshalJSON(bytes []byte) error
- type Pair
- type QueryAll
- type QueryAllValues
- type QueryExist
- type QueryKey
- type QueryList
- type QueryListDir
- type RaftConfig
- type RaftStore
- func (r *RaftStore) Delete(key string, ver uint64) error
- func (r *RaftStore) Exists(key string) (bool, error)
- func (r *RaftStore) Get(key string) (Pair, error)
- func (r *RaftStore) GetAll(pattern string) ([]Pair, error)
- func (r *RaftStore) GetAllValues(pattern string) ([]string, error)
- func (r *RaftStore) HasLeader() bool
- func (r *RaftStore) List(filePath string) ([]string, error)
- func (r *RaftStore) ListDir(filePath string) ([]string, error)
- func (r *RaftStore) Set(key string, value string, ver uint64) (Pair, error)
- func (r *RaftStore) Start(cfg RaftConfig) error
- func (r *RaftStore) WaitForLeader(ctx context.Context) error
- type Update
Constants ¶
View Source
const ( ResultCodeFailure = iota ResultCodeSuccess ResultCodeVersionMismatch )
View Source
const ( UpdateOpSet = "set" UpdateOpDelete = "delete" )
Variables ¶
View Source
var ( // ErrNotExist key does not exist in the store. ErrNotExist = errors.New("key does not exist") // ErrVersionMismatch version provided does not match the version stored. ErrVersionMismatch = errors.New("version mismatch") )
Functions ¶
func NewLFSM ¶
func NewLFSM() dbsm.CreateConcurrentStateMachineFunc
Types ¶
type LFSM ¶
type LFSM struct {
// contains filtered or unexported fields
}
func (*LFSM) PrepareSnapshot ¶
func (*LFSM) RecoverFromSnapshot ¶
func (*LFSM) SaveSnapshot ¶
type MapStore ¶
type MapStore struct {
// contains filtered or unexported fields
}
A MapStore represents an in-memory key-value store safe for concurrent access.
func (*MapStore) Get ¶
Get gets the Pair associated with key. If there is no Pair associated with key, Get returns Pair{}, ErrNotExist.
func (*MapStore) GetAll ¶
GetAll returns a Pair for all nodes with keys matching pattern. The syntax of patterns is the same as in path.Match.
func (*MapStore) GetAllValues ¶
GetAllValues returns a []string for all nodes with keys matching pattern. The syntax of patterns is the same as in path.Match.
func (*MapStore) MarshalJSON ¶ added in v0.2.0
func (*MapStore) UnmarshalJSON ¶ added in v0.2.0
type Pair ¶
type Pair struct { // Key a full path in KV store. Key string // Value a value assigned to the Key. Value string // Ver a key version, version must be supplied for consecutive updates. Ver uint64 }
Pair represents a single versioned KV pair.
type QueryAllValues ¶
type QueryAllValues struct {
Pattern string
}
type QueryExist ¶ added in v0.2.0
type QueryExist struct {
Key string
}
type QueryListDir ¶
type QueryListDir struct {
Path string
}
type RaftConfig ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.