package
0.2.0-beta.2
Repository: https://github.com/btmorr/leifdb.git
Documentation: pkg.go.dev

# Functions

NewForeignNode constructs a ForeignNode from an address ("host:port").
NewNode initializes a Node with a randomized election timeout.
NewNodeConfig creates a config for a Node.
ReadLogs attempts to unmarshal and return a LogStore from the specified file, and if unable to do so returns an empty LogStore.
ReadTerm attempts to unmarshal and return a TermRecord from the specified file, and if unable to do so returns an initialized TermRecord.
WriteLogs persists the node's log.
WriteTerm persists the node's most recent term and vote.

# Constants

Follower is a read-only member of a cluster Leader is a read/write member of a cluster.
Follower is a read-only member of a cluster Leader is a read/write member of a cluster.

# Variables

ErrAppendFailed indicates that an append job ran out of retry attempts without successfully appending to a majority of nodes.
ErrAppendRangeMet indicates that reverse-iteration has reached the beginning of the log and still not gotten a response--aborting.
ErrCommitFailed indicates that the leader's commit index after append is less than the index of the record being added.
ErrExpiredTerm indicates that an append request was generated for a past term, so it should not be sent.
ErrNotLeaderRecv indicates that a client attempted to make a write to a node that is not currently the leader of the cluster.
ErrNotLeaderSend indicates that a server attempted to send an append request while it is not the leader of the cluster.

# Structs

A ForeignNode is another member of the cluster, with connections needed to manage gRPC interaction with that node and track recent availability.
A Node is one member of a Raft cluster, with all state needed to operate the algorithm's state machine.
NodeConfig contains configurable properties for a node.

# Type aliases

ForeignNodeChecker functions are used to determine if a request comes from a valid participant in a cluster.
Role is either Leader or Follower.