Documentation ¶
Index ¶
- Constants
- func NewFSM(base db.Provider) raft.FSM
- func NewProvider(r *raft.Raft, base db.Provider) db.Provider
- type DB
- func (db *DB) DeleteRange(min, max uint64) error
- func (db *DB) FirstIndex() (v uint64, err error)
- func (db *DB) Get(key []byte) (v []byte, err error)
- func (db *DB) GetLog(index uint64, log *raft.Log) error
- func (db *DB) GetUint64(key []byte) (uint64, error)
- func (db *DB) LastIndex() (v uint64, err error)
- func (db *DB) Set(key, value []byte) error
- func (db *DB) SetUint64(key []byte, value uint64) error
- func (db *DB) StoreLog(log *raft.Log) error
- func (db *DB) StoreLogs(logs []*raft.Log) error
- type Ha
- type ProtoTransit
- func (t *ProtoTransit) AppendEntries(ctx context.Context, req *raftv1.AppendEntriesRequest) (*raftv1.AppendEntriesResponse, error)
- func (t *ProtoTransit) AppendEntriesPipeline(s raftv1.Transport_AppendEntriesPipelineServer) error
- func (t *ProtoTransit) InstallSnapshot(s raftv1.Transport_InstallSnapshotServer) error
- func (t *ProtoTransit) RequestVote(ctx context.Context, req *raftv1.RequestVoteRequest) (*raftv1.RequestVoteResponse, error)
- func (t *ProtoTransit) TimeoutNow(ctx context.Context, req *raftv1.TimeoutNowRequest) (*raftv1.TimeoutNowResponse, error)
- type RPCRequest
- type RPCResponse
- type Transit
- func (t *Transit) AppendEntries(id raft.ServerID, target raft.ServerAddress, args *raft.AppendEntriesRequest, ...) error
- func (t *Transit) AppendEntriesPipeline(id raft.ServerID, target raft.ServerAddress) (raft.AppendPipeline, error)
- func (t *Transit) Close() error
- func (t *Transit) Consumer() <-chan raft.RPC
- func (*Transit) DecodePeer(buf []byte) raft.ServerAddress
- func (*Transit) EncodePeer(id raft.ServerID, p raft.ServerAddress) []byte
- func (t *Transit) InstallSnapshot(id raft.ServerID, target raft.ServerAddress, args *raft.InstallSnapshotRequest, ...) error
- func (t *Transit) LocalAddr() raft.ServerAddress
- func (t *Transit) Register(s *grpc.Server)
- func (t *Transit) RequestVote(id raft.ServerID, target raft.ServerAddress, args *raft.RequestVoteRequest, ...) error
- func (t *Transit) SetHeartbeatHandler(cb func(rpc raft.RPC))
- func (t *Transit) TimeoutNow(id raft.ServerID, target raft.ServerAddress, args *raft.TimeoutNowRequest, ...) error
Constants ¶
View Source
const ApplyTTL = time.Second
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteRange ¶
func (*DB) FirstIndex ¶
type ProtoTransit ¶ added in v0.0.31
type ProtoTransit struct { raftv1.UnsafeTransportServer // contains filtered or unexported fields }
func (*ProtoTransit) AppendEntries ¶ added in v0.0.31
func (t *ProtoTransit) AppendEntries(ctx context.Context, req *raftv1.AppendEntriesRequest) (*raftv1.AppendEntriesResponse, error)
func (*ProtoTransit) AppendEntriesPipeline ¶ added in v0.0.31
func (t *ProtoTransit) AppendEntriesPipeline(s raftv1.Transport_AppendEntriesPipelineServer) error
func (*ProtoTransit) InstallSnapshot ¶ added in v0.0.31
func (t *ProtoTransit) InstallSnapshot(s raftv1.Transport_InstallSnapshotServer) error
func (*ProtoTransit) RequestVote ¶ added in v0.0.31
func (t *ProtoTransit) RequestVote(ctx context.Context, req *raftv1.RequestVoteRequest) (*raftv1.RequestVoteResponse, error)
func (*ProtoTransit) TimeoutNow ¶ added in v0.0.31
func (t *ProtoTransit) TimeoutNow(ctx context.Context, req *raftv1.TimeoutNowRequest) (*raftv1.TimeoutNowResponse, error)
type RPCRequest ¶
type RPCRequest interface { *raft.AppendEntriesRequest | *raft.RequestVoteRequest | *raft.InstallSnapshotRequest | *raft.TimeoutNowRequest }
type RPCResponse ¶
type RPCResponse interface { *raft.AppendEntriesResponse | *raft.RequestVoteResponse | *raft.InstallSnapshotResponse | *raft.TimeoutNowResponse }
type Transit ¶
type Transit struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func (*Transit) AppendEntries ¶
func (t *Transit) AppendEntries( id raft.ServerID, target raft.ServerAddress, args *raft.AppendEntriesRequest, resp *raft.AppendEntriesResponse) error
func (*Transit) AppendEntriesPipeline ¶
func (t *Transit) AppendEntriesPipeline(id raft.ServerID, target raft.ServerAddress) (raft.AppendPipeline, error)
func (*Transit) DecodePeer ¶
func (*Transit) DecodePeer(buf []byte) raft.ServerAddress
func (*Transit) EncodePeer ¶
func (*Transit) InstallSnapshot ¶
func (t *Transit) InstallSnapshot(id raft.ServerID, target raft.ServerAddress, args *raft.InstallSnapshotRequest, resp *raft.InstallSnapshotResponse, data io.Reader) error
func (*Transit) LocalAddr ¶
func (t *Transit) LocalAddr() raft.ServerAddress
func (*Transit) RequestVote ¶
func (t *Transit) RequestVote(id raft.ServerID, target raft.ServerAddress, args *raft.RequestVoteRequest, resp *raft.RequestVoteResponse) error
func (*Transit) SetHeartbeatHandler ¶
func (*Transit) TimeoutNow ¶
func (t *Transit) TimeoutNow(id raft.ServerID, target raft.ServerAddress, args *raft.TimeoutNowRequest, resp *raft.TimeoutNowResponse) error
Click to show internal directories.
Click to hide internal directories.