Documentation ¶
Index ¶
- type Config
- type Peer
- type Persister
- type Raft
- func (r *Raft) AppendEntries(ctx context.Context, req *pb.AppendEntriesRequest) (*pb.AppendEntriesResponse, error)
- func (r *Raft) ApplyCh() <-chan *pb.Entry
- func (r *Raft) ApplyCommand(ctx context.Context, req *pb.ApplyCommandRequest) (*pb.ApplyCommandResponse, error)
- func (r *Raft) RequestVote(ctx context.Context, req *pb.RequestVoteRequest) (*pb.RequestVoteResponse, error)
- func (r *Raft) Run(ctx context.Context)
- type RaftState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer interface { pb.RaftClient }
Peer provides an interface to allow Raft to commnuncate with other nodes
type Raft ¶
type Raft struct { pb.UnimplementedRaftServer // contains filtered or unexported fields }
func (*Raft) AppendEntries ¶
func (r *Raft) AppendEntries(ctx context.Context, req *pb.AppendEntriesRequest) (*pb.AppendEntriesResponse, error)
func (*Raft) ApplyCommand ¶
func (r *Raft) ApplyCommand(ctx context.Context, req *pb.ApplyCommandRequest) (*pb.ApplyCommandResponse, error)
func (*Raft) RequestVote ¶
func (r *Raft) RequestVote(ctx context.Context, req *pb.RequestVoteRequest) (*pb.RequestVoteResponse, error)
Click to show internal directories.
Click to hide internal directories.