Documentation ¶
Index ¶
- Variables
- type FastLogStore
- func (b *FastLogStore) Close() error
- func (b *FastLogStore) DeleteRange(min, max uint64) error
- func (b *FastLogStore) FirstIndex() (uint64, error)
- func (b *FastLogStore) Get(k []byte) ([]byte, error)
- func (b *FastLogStore) GetLog(idx uint64, log *raft.Log) error
- func (b *FastLogStore) GetUint64(key []byte) (uint64, error)
- func (b *FastLogStore) LastIndex() (uint64, error)
- func (b *FastLogStore) Set(k, v []byte) error
- func (b *FastLogStore) SetUint64(key []byte, val uint64) error
- func (b *FastLogStore) Shrink() error
- func (b *FastLogStore) StoreLog(log *raft.Log) error
- func (b *FastLogStore) StoreLogs(logs []*raft.Log) error
- type Level
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("closed")
var ErrKeyNotFound = errors.New("not found")
An error indicating a given key does not exist
var ErrShrinking = errors.New("shrink in progress")
Functions ¶
This section is empty.
Types ¶
type FastLogStore ¶
type FastLogStore struct {
// contains filtered or unexported fields
}
FastLogStore provides access to FastLogDB for Raft to store and retrieve log entries. It also provides key/value storage, and can be used as a LogStore and StableStore.
func NewFastLogStore ¶
NewFastLogStore takes a file path and returns a connected Raft backend.
func (*FastLogStore) Close ¶
func (b *FastLogStore) Close() error
Close is used to gracefully close the DB connection.
func (*FastLogStore) DeleteRange ¶
func (b *FastLogStore) DeleteRange(min, max uint64) error
DeleteRange is used to delete logs within a given range inclusively.
func (*FastLogStore) FirstIndex ¶
func (b *FastLogStore) FirstIndex() (uint64, error)
FirstIndex returns the first known index from the Raft log.
func (*FastLogStore) Get ¶
func (b *FastLogStore) Get(k []byte) ([]byte, error)
Get is used to retrieve a value from the k/v store by key
func (*FastLogStore) GetLog ¶
func (b *FastLogStore) GetLog(idx uint64, log *raft.Log) error
GetLog is used to retrieve a log from FastLogDB at a given index.
func (*FastLogStore) GetUint64 ¶
func (b *FastLogStore) GetUint64(key []byte) (uint64, error)
GetUint64 is like Get, but handles uint64 values
func (*FastLogStore) LastIndex ¶
func (b *FastLogStore) LastIndex() (uint64, error)
LastIndex returns the last known index from the Raft log.
func (*FastLogStore) Set ¶
func (b *FastLogStore) Set(k, v []byte) error
Set is used to set a key/value set outside of the raft log
func (*FastLogStore) SetUint64 ¶
func (b *FastLogStore) SetUint64(key []byte, val uint64) error
SetUint64 is like Set, but handles uint64 values
func (*FastLogStore) Shrink ¶
func (b *FastLogStore) Shrink() error