Versions in this module Expand all Collapse all v0 v0.1.0 Jun 27, 2024 Changes in this version + const Candidate + const Follower + const InvalidAgentID + const InvalidLockHolderID + const Leader + const NoopAgentID + var DemotedToFollower error + var LogMismatch error + func AppendLog(logEntry *LogEntry) error + func BroadcastHeartBeat() error + func Init(id int32, ge []string, ps PersistentStore) + func IsLeader() bool + func LeaderID() int32 + func LockHolderID() int32 + func PendingApplyLogExist() bool + func StartRPCServer(port int) + type LogEntry struct + LockHolderID int32 + Reserved int32 + Term int64 + type PersistentStore interface + AppendLog func(*LogEntry) + CurrentTerm func() int64 + CutOffLogTail func(int64) + LogEntry func(int64) *LogEntry + LogSize func() int64 + PutCurrentTerm func(int64) + PutVotedFor func(int32) + VotedFor func() int32 + type RaftServerImpl struct + func (rsi *RaftServerImpl) AppendEntries(ctx context.Context, req *sfrpc.AppendEntriesRequest) (*sfrpc.AppendEntriesReply, error) + func (rsi *RaftServerImpl) RequestVote(ctx context.Context, req *sfrpc.RequestVoteRequest) (*sfrpc.RequestVoteReply, error) + type Role int32 + type StateMachine struct + LockHolderID int32 + type VolatileLeaderState struct + type VolatileState struct