Documentation ¶
Index ¶
- type Store
- func (self *Store) Apply(raftLog *raft.Log) interface{}
- func (self *Store) Delete(key string) error
- func (self *Store) Get(key string) string
- func (self *Store) Restore(rc io.ReadCloser) error
- func (self *Store) Set(key, value string) error
- func (self *Store) Snapshot() (raft.FSMSnapshot, error)
- func (self *Store) StartRaft(localID string, singleNode, inMemory bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { InMemory bool RaftDirectory string RaftAddress string RaftPort string RetainSnapshotCount int RaftTimeout time.Duration // contains filtered or unexported fields }
func (*Store) Restore ¶
func (self *Store) Restore(rc io.ReadCloser) error
Restore Recovers a previous state of the key-value store from snapshot.
func (*Store) Snapshot ¶
func (self *Store) Snapshot() (raft.FSMSnapshot, error)
Snapshot returns a snapshot of the key-value store.
Click to show internal directories.
Click to hide internal directories.