Documentation
¶
Index ¶
- type Command
- type ReplicaServer
- func (rs *ReplicaServer) AddCommand(commandName string, command Command)
- func (rs *ReplicaServer) GetState() State
- func (rs *ReplicaServer) GetTerm() uint64
- func (rs *ReplicaServer) IncomingElectionRequests() chan string
- func (rs *ReplicaServer) IncomingHeartbeats() chan string
- func (rs *ReplicaServer) NewTerm() uint64
- func (rs *ReplicaServer) SendElectionRequest(ctx context.Context, request *protocol.ElectionRequest) (*protocol.ElectionResponse, error)
- func (rs *ReplicaServer) SendExecuteCommand(ctx context.Context, command *protocol.CommandName) (*protocol.Nothing, error)
- func (rs *ReplicaServer) SendHeartBeat(ctx context.Context, heartbeatRequest *protocol.HeartbeatRequest) (*protocol.Nothing, error)
- func (rs *ReplicaServer) SetState(state State)
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReplicaServer ¶
type ReplicaServer struct { protocol.UnimplementedFollowerServer // contains filtered or unexported fields }
func NewReplicaServer ¶
func NewReplicaServer(storage raftstorage.Storage) *ReplicaServer
func (*ReplicaServer) AddCommand ¶
func (rs *ReplicaServer) AddCommand(commandName string, command Command)
func (*ReplicaServer) GetState ¶
func (rs *ReplicaServer) GetState() State
func (*ReplicaServer) GetTerm ¶
func (rs *ReplicaServer) GetTerm() uint64
func (*ReplicaServer) IncomingElectionRequests ¶
func (rs *ReplicaServer) IncomingElectionRequests() chan string
func (*ReplicaServer) IncomingHeartbeats ¶
func (rs *ReplicaServer) IncomingHeartbeats() chan string
func (*ReplicaServer) NewTerm ¶
func (rs *ReplicaServer) NewTerm() uint64
func (*ReplicaServer) SendElectionRequest ¶
func (rs *ReplicaServer) SendElectionRequest(ctx context.Context, request *protocol.ElectionRequest) (*protocol.ElectionResponse, error)
func (*ReplicaServer) SendExecuteCommand ¶
func (rs *ReplicaServer) SendExecuteCommand(ctx context.Context, command *protocol.CommandName) (*protocol.Nothing, error)
func (*ReplicaServer) SendHeartBeat ¶
func (rs *ReplicaServer) SendHeartBeat(ctx context.Context, heartbeatRequest *protocol.HeartbeatRequest) (*protocol.Nothing, error)
func (*ReplicaServer) SetState ¶
func (rs *ReplicaServer) SetState(state State)
Click to show internal directories.
Click to hide internal directories.