Documentation ¶
Index ¶
- Constants
- type Logger
- type Raft
- func (rf *Raft) GetState() (uint64, bool, int)
- func (rf *Raft) IsLeader() bool
- func (rf *Raft) SendHeartbeat(context context.Context, hreqt *protocol.HeartbeatRequest) (repe *protocol.Response, err error)
- func (rf *Raft) SendVoteRequest(context context.Context, vreqt *protocol.VoteRequest) (vrepe *protocol.VoteResponse, err error)
- func (rf *Raft) Stop()
Constants ¶
View Source
const ( // LEADER raft LEADER = iota // CANDIDATE raft CANDIDATE // FLLOWER raft FLLOWER //CLOSED closed CLOSED //HBINTERVAL 50 ms HBINTERVAL = 50 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Raft ¶
type Raft struct {
// contains filtered or unexported fields
}
Raft raft peer
func (*Raft) SendHeartbeat ¶
func (rf *Raft) SendHeartbeat(context context.Context, hreqt *protocol.HeartbeatRequest) (repe *protocol.Response, err error)
SendHeartbeat rpc handler
func (*Raft) SendVoteRequest ¶
func (rf *Raft) SendVoteRequest(context context.Context, vreqt *protocol.VoteRequest) (vrepe *protocol.VoteResponse, err error)
SendVoteRequest rpc handler
Click to show internal directories.
Click to hide internal directories.