Documentation ¶
Index ¶
- Variables
- type BoltStore
- func (b *BoltStore) Close() error
- func (b *BoltStore) DeleteRange(min, max uint64) error
- func (b *BoltStore) FirstIndex() (uint64, error)
- func (b *BoltStore) Get(k []byte) ([]byte, error)
- func (b *BoltStore) GetLog(idx uint64, log *raft.Log) error
- func (b *BoltStore) GetUint64(key []byte) (uint64, error)
- func (b *BoltStore) LastIndex() (uint64, error)
- func (b *BoltStore) Set(k, v []byte) error
- func (b *BoltStore) SetUint64(key []byte, val uint64) error
- func (b *BoltStore) StoreLog(log *raft.Log) error
- func (b *BoltStore) StoreLogs(logs []*raft.Log) error
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 BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
BoltStore provides access to BoltDB for Raft to store and retrieve log entries. It also provides key/value storage, and can be used as a LogStore and StableStore.
func NewBoltStore ¶
NewBoltStore takes a file path and returns a connected Raft backend.
func (*BoltStore) DeleteRange ¶
DeleteRange is used to delete logs within a given range inclusively.
func (*BoltStore) FirstIndex ¶
FirstIndex returns the first known index from the Raft log.
Click to show internal directories.
Click to hide internal directories.