Documentation ¶
Index ¶
- Constants
- type StateMachine
- type Sync
- func (m *Sync) Close() error
- func (m *Sync) Read(index uint64) (*pb.LogEntry, error)
- func (m *Sync) ReadFrom(index uint64) ([]*pb.LogEntry, error)
- func (m *Sync) ReadMeta() (*pb.LogMeta, error)
- func (m *Sync) Reset()
- func (m *Sync) Trunc(index uint64) error
- func (m *Sync) UseError(method string, err error)
- func (m *Sync) Write(entries ...*pb.LogEntry) error
- func (m *Sync) WriteMeta(meta *pb.LogMeta) error
Constants ¶
View Source
const ( CommitEntry = "CommitEntry" DropEntry = "DropEntry" )
View Source
const ( Write = "Write" WriteMeta = "WriteMeta" Trunc = "Trunc" Read = "Read" ReadFrom = "ReadFrom" ReadMeta = "ReadMeta" Close = "Close" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateMachine ¶
type StateMachine struct { Calls map[string]int OnCommitEntry func(*pb.LogEntry) error OnDropEntry func(*pb.LogEntry) error }
func NewStateMachine ¶
func NewStateMachine() *StateMachine
func (*StateMachine) CommitEntry ¶
func (m *StateMachine) CommitEntry(entry *pb.LogEntry) error
func (*StateMachine) Reset ¶
func (m *StateMachine) Reset()
func (*StateMachine) UseError ¶
func (m *StateMachine) UseError(method string, err error)
type Sync ¶
Click to show internal directories.
Click to hide internal directories.