Documentation ¶
Index ¶
- Constants
- func StopServer()
- type GrpcRaftNode
- func (w *GrpcRaftNode) AddPeer(id uint64, rc protos.RaftContext)
- func (w *GrpcRaftNode) Disconnect()
- func (rn *GrpcRaftNode) Echo(ctx context.Context, in *protos.Payload) (*protos.Payload, error)
- func (rn *GrpcRaftNode) GetPeer(pid uint64) (string, bool)
- func (rn *GrpcRaftNode) JoinCluster(ctx context.Context, rc *protos.RaftContext) (*protos.Payload, error)
- func (rn *GrpcRaftNode) RaftMessage(ctx context.Context, query *protos.Payload) (*protos.Payload, error)
- func (w *GrpcRaftNode) RemovePeer(id uint64)
- func (w *GrpcRaftNode) Send(m raftpb.Message)
- func (rn *GrpcRaftNode) SetPeer(pid uint64, addr string, poolOrNil *pool)
- func (w *GrpcRaftNode) Start(grpc *grpc.Server)
- type Raft
- type Transport
Constants ¶
View Source
const (
GrpcMaxSize = 256 << 20
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GrpcRaftNode ¶
GrpcRaftNode struct implements the gRPC server interface.
func (*GrpcRaftNode) AddPeer ¶
func (w *GrpcRaftNode) AddPeer(id uint64, rc protos.RaftContext)
func (*GrpcRaftNode) Disconnect ¶
func (w *GrpcRaftNode) Disconnect()
func (*GrpcRaftNode) Echo ¶
Hello rpc call is used to check connection with other workers after mon tcp server for this instance starts.
func (*GrpcRaftNode) GetPeer ¶
func (rn *GrpcRaftNode) GetPeer(pid uint64) (string, bool)
Never returns ("", true)
func (*GrpcRaftNode) JoinCluster ¶
func (rn *GrpcRaftNode) JoinCluster(ctx context.Context, rc *protos.RaftContext) (*protos.Payload, error)
func (*GrpcRaftNode) RaftMessage ¶
func (*GrpcRaftNode) RemovePeer ¶
func (w *GrpcRaftNode) RemovePeer(id uint64)
func (*GrpcRaftNode) Send ¶
func (w *GrpcRaftNode) Send(m raftpb.Message)
func (*GrpcRaftNode) SetPeer ¶
func (rn *GrpcRaftNode) SetPeer(pid uint64, addr string, poolOrNil *pool)
addr must not be empty.
func (*GrpcRaftNode) Start ¶
func (w *GrpcRaftNode) Start(grpc *grpc.Server)
type Raft ¶
type Raft interface { Process(ctx context.Context, m raftpb.Message) error IsIDRemoved(id uint64) bool ReportUnreachable(id uint64) ReportSnapshot(id uint64, status raft.SnapshotStatus) }
Raft is used to call functions in draft
Click to show internal directories.
Click to hide internal directories.