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
- func (b *BoltStore) Sync() error
- type Options
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 New ¶
New uses the supplied options to open the BoltDB and prepare it for use as a raft backend.
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.
type Options ¶
type Options struct { // Path is the file path to the BoltDB to use Path string // BoltOptions contains any specific BoltDB options you might // want to specify [e.g. open timeout] BoltOptions *bolt.Options // NoSync causes the database to skip fsync calls after each // write to the log. This is unsafe, so it should be used // with caution. NoSync bool }
Options contains all the configuration used to open the BoltDB
Click to show internal directories.
Click to hide internal directories.