Documentation ¶
Index ¶
- type InstallSnapshotRequest
- type Service
- func (s *Service) AppendEntries(r *raft.AppendEntriesRequest, w *raft.AppendEntriesResponse) error
- func (s *Service) InstallSnapshot(r *InstallSnapshotRequest, w *raft.InstallSnapshotResponse) error
- func (s *Service) RequestVote(r *raft.RequestVoteRequest, w *raft.RequestVoteResponse) error
- func (s *Service) TimeoutNow(r *raft.TimeoutNowRequest, w *raft.TimeoutNowResponse) error
- type Transport
- func (t *Transport) AppendEntries(id raft.ServerID, addr raft.ServerAddress, args *raft.AppendEntriesRequest, ...) error
- func (t *Transport) AppendEntriesPipeline(id raft.ServerID, addr raft.ServerAddress) (raft.AppendPipeline, error)
- func (t *Transport) Consumer() <-chan raft.RPC
- func (t *Transport) DecodePeer(data []byte) raft.ServerAddress
- func (t *Transport) EncodePeer(id raft.ServerID, addr raft.ServerAddress) []byte
- func (t *Transport) GetClient(id raft.ServerID, addr raft.ServerAddress) (*rpc.Client, error)
- func (t *Transport) InstallSnapshot(id raft.ServerID, addr raft.ServerAddress, args *raft.InstallSnapshotRequest, ...) error
- func (t *Transport) LocalAddr() raft.ServerAddress
- func (t *Transport) RequestVote(id raft.ServerID, addr raft.ServerAddress, args *raft.RequestVoteRequest, ...) error
- func (t *Transport) SetHeartbeatHandler(cb func(rpc raft.RPC))
- func (t *Transport) TimeoutNow(id raft.ServerID, addr raft.ServerAddress, args *raft.TimeoutNowRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstallSnapshotRequest ¶
type InstallSnapshotRequest struct { *raft.InstallSnapshotRequest Data json.RawMessage }
merge data to InstallSnapshotRequest
type Service ¶
type Service Transport
func (*Service) AppendEntries ¶
func (s *Service) AppendEntries(r *raft.AppendEntriesRequest, w *raft.AppendEntriesResponse) error
func (*Service) InstallSnapshot ¶
func (s *Service) InstallSnapshot(r *InstallSnapshotRequest, w *raft.InstallSnapshotResponse) error
func (*Service) RequestVote ¶
func (s *Service) RequestVote(r *raft.RequestVoteRequest, w *raft.RequestVoteResponse) error
func (*Service) TimeoutNow ¶
func (s *Service) TimeoutNow(r *raft.TimeoutNowRequest, w *raft.TimeoutNowResponse) error
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) AppendEntries ¶
func (t *Transport) AppendEntries(id raft.ServerID, addr raft.ServerAddress, args *raft.AppendEntriesRequest, resp *raft.AppendEntriesResponse) error
func (*Transport) AppendEntriesPipeline ¶
func (t *Transport) AppendEntriesPipeline(id raft.ServerID, addr raft.ServerAddress) (raft.AppendPipeline, error)
func (*Transport) DecodePeer ¶
func (t *Transport) DecodePeer(data []byte) raft.ServerAddress
func (*Transport) EncodePeer ¶
func (*Transport) InstallSnapshot ¶
func (t *Transport) InstallSnapshot(id raft.ServerID, addr raft.ServerAddress, args *raft.InstallSnapshotRequest, resp *raft.InstallSnapshotResponse, data io.Reader) error
func (*Transport) LocalAddr ¶
func (t *Transport) LocalAddr() raft.ServerAddress
func (*Transport) RequestVote ¶
func (t *Transport) RequestVote(id raft.ServerID, addr raft.ServerAddress, args *raft.RequestVoteRequest, resp *raft.RequestVoteResponse) error
func (*Transport) SetHeartbeatHandler ¶
func (*Transport) TimeoutNow ¶
func (t *Transport) TimeoutNow(id raft.ServerID, addr raft.ServerAddress, args *raft.TimeoutNowRequest, resp *raft.TimeoutNowResponse) error
Click to show internal directories.
Click to hide internal directories.