Documentation ¶
Index ¶
- type AppendEntriesArgs
- type AppendEntriesReply
- type ApplyMsg
- type LogEntry
- type Raft
- func (rf *Raft) AppendEntries(args AppendEntriesArgs, reply *AppendEntriesReply)
- func (rf *Raft) ApplyCommittedLogEntries()
- func (rf *Raft) GetState() (int, bool)
- func (rf *Raft) Kill()
- func (rf *Raft) RequestVote(args RequestVoteArgs, reply *RequestVoteReply)
- func (rf *Raft) Start(command interface{}) (int, int, bool)
- func (rf *Raft) TakeMin(x1 int, x2 int) int
- type RequestVoteArgs
- type RequestVoteReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendEntriesArgs ¶
type AppendEntriesReply ¶
type Raft ¶
type Raft struct { Log []LogEntry // contains filtered or unexported fields }
A Go object implementing a single Raft peer.
func (*Raft) AppendEntries ¶
func (rf *Raft) AppendEntries(args AppendEntriesArgs, reply *AppendEntriesReply)
func (*Raft) ApplyCommittedLogEntries ¶
func (rf *Raft) ApplyCommittedLogEntries()
func (*Raft) RequestVote ¶
func (rf *Raft) RequestVote(args RequestVoteArgs, reply *RequestVoteReply)
example RequestVote RPC handler.
type RequestVoteArgs ¶
type RequestVoteArgs struct { // Your data here. Term int CandidateID int LastLogIndex int LastLogTerm int }
example RequestVote RPC arguments structure.
type RequestVoteReply ¶
example RequestVote RPC reply structure.
Click to show internal directories.
Click to hide internal directories.