Documentation ¶
Index ¶
- Constants
- 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 Node
- type Options
- type Store
- func (s *Store) AddNode(nodeID, addr string) error
- func (s *Store) DataDir(raftAddr string) string
- func (s *Store) Delete(key string) error
- func (s *Store) Get(key string) string
- func (s *Store) Keys() []string
- func (s *Store) Leader() Node
- func (s *Store) NodeList() ([]Node, error)
- func (s *Store) Open(bootstrapCluster bool, localID string) error
- func (s *Store) Set(key string, value string) error
- func (s *Store) Snapshot() error
Constants ¶
View Source
const ( CmdSet = "SET" CmdDelete = "DELETE" )
Variables ¶
View Source
var ( ErrKeyNotFound = errors.New("not found") ErrCorrupt = errors.New("corrupt") )
Functions ¶
This section is empty.
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
BoltStore wraps boltdb and implements the interfaces raft.LogStore to store raft logs and raft.StableStore for key/value storage. The interfaces are defined in hashicorp/raft library
func NewBoltStore ¶
func (*BoltStore) DeleteRange ¶
DeleteRange deletes a range of log entries. The range is inclusive.
func (*BoltStore) FirstIndex ¶
FirstIndex returns the first index of raft logs written. 0 for no entries.
func (*BoltStore) LastIndex ¶
LastIndex returns the last index of raft logs written. 0 for no entries.
Click to show internal directories.
Click to hide internal directories.