In-memory Raft log implementation. All state is lost on page refresh — suitable for ephemeral sessions.
Private
Append one or more entries to the end of the log
Get all entries from startIndex to endIndex (both inclusive, 1-based)
Get the entry at the given 1-based index, or undefined if out of range
Get the term of the entry at the given 1-based index, or 0 if out of range
Get the index of the last entry (0 if log is empty)
Get the term of the last entry (0 if log is empty)
Number of entries in the log
Load persistent state (currentTerm, votedFor). Returns defaults if not yet stored.
Persist the current term and votedFor
Delete all entries from the given 1-based index onward (inclusive). Used when resolving log conflicts.
Generated using TypeDoc
In-memory Raft log implementation. All state is lost on page refresh — suitable for ephemeral sessions.