Documentation
¶
Index ¶
- Constants
- type IndexedEntry
- type Indexes
- type Log
- func (l *Log) AppendEntries(entries []*schema.Entry)
- func (l *Log) EntryByIndex(i int32) *IndexedEntry
- func (l *Log) EntryByIndexDecomposed(i int32) (int32, int32)
- func (l *Log) GetCommitIndex() int32
- func (l *Log) GetEntriesFrom(i int32) []*schema.Entry
- func (l *Log) GetLastApplied() int32
- func (l *Log) IsCandidatesLogAtLeastAsUpToDateAsCurrent(lastLogTerm, lastLogIndex int32) bool
- func (l *Log) IsEmpty() bool
- func (l *Log) LastEntry() *IndexedEntry
- func (l *Log) LastEntryDecomposed() (int32, int32)
- func (l *Log) Len() int32
- func (l *Log) SaveNewEntries(in schema.AppendEntriesInput)
- func (l *Log) SetCommitIndex(i int32)
- type Logger
- type Raft
- type S
- type State
Constants ¶
View Source
const ( PrefixHeartbeat = "[HEARTBEAT] " PrefixStateChanged = "[STATE CHANGED] " PrefixTermChanged = "[TERM CHANGED] " PrefixElection = "[ELECTION] " PrefixElectionResult = "[ELECTION RESULT] " PrefixElectionStop = "[ELECTION STOPPED] " PrefixInfo = "[INFO] " PrefixError = "[ERROR] " PrefixAppendEntries = "[APPEND ENTRIES] " PrefixRequestVote = "[REQUEST VOTE] " )
View Source
const ( Follower = S(iota) Candidate Leader )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexedEntry ¶
type Indexes ¶
func (*Indexes) DecrementIndex ¶
type Log ¶
func (*Log) AppendEntries ¶
func (*Log) EntryByIndex ¶
func (l *Log) EntryByIndex(i int32) *IndexedEntry
func (*Log) GetCommitIndex ¶
func (*Log) GetLastApplied ¶
func (*Log) IsCandidatesLogAtLeastAsUpToDateAsCurrent ¶
func (*Log) LastEntry ¶
func (l *Log) LastEntry() *IndexedEntry
func (*Log) LastEntryDecomposed ¶
func (*Log) SaveNewEntries ¶
func (l *Log) SaveNewEntries(in schema.AppendEntriesInput)
func (*Log) SetCommitIndex ¶
type Raft ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) IncrementTerm ¶
func (s *State) IncrementTerm()
func (*State) VotedInThisTerm ¶
Click to show internal directories.
Click to hide internal directories.