Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendEntryPayload ¶
type AppendEntryPayload struct { Term uint64 LeaderId string PrevLogIndex uint64 PrevLogTerm uint64 Entries []byte LeaderCommit uint64 }
func (*AppendEntryPayload) ToRequest ¶
func (aep *AppendEntryPayload) ToRequest() (Request, error)
type AppendEntryResponse ¶
func (*AppendEntryResponse) FromPayload ¶
func (aer *AppendEntryResponse) FromPayload(payload []byte) error
type ClientCommandPayload ¶
type ClientCommandPayload struct {
ClientCommand []byte
}
func (*ClientCommandPayload) ToRequest ¶
func (ccp *ClientCommandPayload) ToRequest() (Request, error)
type Request ¶
type Request struct { RequestType RequestType Payload []byte }
type RequestConverter ¶
type RequestType ¶
type RequestType int
RequestType defines the kind of request received by the RaftServer, it can be one of 'AppendEntry' 'RequestVote' or 'ClientCommand'
const ( AppendEntry RequestType = iota RequestVote ClientCommand )
func (RequestType) String ¶
func (i RequestType) String() string
type RequestVotePayload ¶
type RequestVotePayload struct { Term uint64 CandidateId string LastLogIndex uint64 LastLogTerm uint64 }
func (*RequestVotePayload) ToRequest ¶
func (rvp *RequestVotePayload) ToRequest() (Request, error)
type RequestVoteResponse ¶
func (*RequestVoteResponse) FromPayload ¶
func (rvr *RequestVoteResponse) FromPayload(payload []byte) error
Click to show internal directories.
Click to hide internal directories.