Documentation ¶
Index ¶
- Variables
- type LogStore
- func (store *LogStore) DeleteRange(min, max uint64) error
- func (store *LogStore) FirstIndex() (uint64, error)
- func (store *LogStore) GetLog(index uint64, log *raft.Log) error
- func (store *LogStore) LastIndex() (uint64, error)
- func (store *LogStore) StoreLog(log *raft.Log) error
- func (store *LogStore) StoreLogs(logs []*raft.Log) error
- type StableStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type LogStore ¶
type LogStore struct {
Conn *badger.DB
}
func NewLogStore ¶
func (*LogStore) DeleteRange ¶
DeleteRange deletes a range of log entries. The range is inclusive.
func (*LogStore) FirstIndex ¶
FirstIndex returns the first index written. 0 for no entries.
type StableStore ¶
type StableStore struct {
Conn *badger.DB
}
func NewStableStore ¶
func NewStableStore(path string) (*StableStore, error)
func (*StableStore) Get ¶
func (store *StableStore) Get(key []byte) ([]byte, error)
Get returns the value for key, or an empty byte slice if key was not found.
func (*StableStore) GetUint64 ¶
func (store *StableStore) GetUint64(key []byte) (uint64, error)
GetUint64 returns the uint64 value for key, or 0 if key was not found.
func (*StableStore) Set ¶
func (store *StableStore) Set(key, val []byte) error
Set is used to set a key/value set
Click to show internal directories.
Click to hide internal directories.