Documentation ¶
Index ¶
- Variables
- type BuntStore
- func (b *BuntStore) Close() error
- func (b *BuntStore) DeleteRange(min, max uint64) error
- func (b *BuntStore) FirstIndex() (uint64, error)
- func (b *BuntStore) Get(k []byte) ([]byte, error)
- func (b *BuntStore) GetLog(idx uint64, log *raft.Log) error
- func (b *BuntStore) GetUint64(key []byte) (uint64, error)
- func (b *BuntStore) LastIndex() (uint64, error)
- func (b *BuntStore) Peers() ([]string, error)
- func (b *BuntStore) Set(k, v []byte) error
- func (b *BuntStore) SetPeers(peers []string) error
- func (b *BuntStore) SetUint64(key []byte, val uint64) error
- func (b *BuntStore) Shrink() error
- func (b *BuntStore) StoreLog(log *raft.Log) error
- func (b *BuntStore) StoreLogs(logs []*raft.Log) error
- type Level
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // An error indicating a given key does not exist ErrKeyNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type BuntStore ¶
type BuntStore struct {
// contains filtered or unexported fields
}
BuntStore provides access to BuntDB for Raft to store and retrieve log entries. It also provides key/value storage, and can be used as a LogStore and StableStore.
func NewBuntStore ¶
NewBuntStore takes a file path and returns a connected Raft backend.
func (*BuntStore) DeleteRange ¶
DeleteRange is used to delete logs within a given range inclusively.
func (*BuntStore) FirstIndex ¶
FirstIndex returns the first known index from the Raft log.
func (*BuntStore) Shrink ¶
Shrink will trigger a shrink operation on the aof file. Useful after a log compaction is completed.
Click to show internal directories.
Click to hide internal directories.