Documentation ¶
Overview ¶
Package fsm implements the Raft FSM.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalLogEntry ¶
func MarshalLogEntry(logEntry *v1.RaftLogEntry) ([]byte, error)
MarshalLogEntry marshals a RaftLogEntry.
func UnmarshalLogEntry ¶
func UnmarshalLogEntry(data []byte) (*v1.RaftLogEntry, error)
UnmarshalLogEntry unmarshals a RaftLogEntry.
Types ¶
type Options ¶
type Options struct { // ApplyTimeout is the timeout for applying a log entry. ApplyTimeout time.Duration }
Options are options for the FSM.
type RaftFSM ¶
type RaftFSM struct {
// contains filtered or unexported fields
}
RaftFSM is the Raft FSM.
func New ¶
New returns a new RaftFSM. The storage interface must be a direct connection to the underlying database.
func (*RaftFSM) ApplyBatch ¶
ApplyBatch implements the raft.BatchingFSM interface.
func (*RaftFSM) CurrentTerm ¶
CurrentTerm returns the current term.
func (*RaftFSM) LastAppliedIndex ¶
LastAppliedIndex returns the last applied index.
Click to show internal directories.
Click to hide internal directories.