Documentation ¶
Index ¶
- type SimpleRaft
- func (rw *SimpleRaft) CommitState(state consensus.State) (consensus.State, error)
- func (rw *SimpleRaft) GetLeader() (peer.AddrInfo, error)
- func (rw *SimpleRaft) GetLeaderID() (leaderAddress hraft.ServerAddress, serverID hraft.ServerID)
- func (rw *SimpleRaft) GetPeers() []peer.AddrInfo
- func (rw *SimpleRaft) GetState() (consensus.State, error)
- func (rw *SimpleRaft) IsLeader() bool
- func (rw *SimpleRaft) VerifyLeader() error
- func (rw *SimpleRaft) WaitForLeader(ctx context.Context) (string, error)
- func (rw *SimpleRaft) WaitForSync(ctx context.Context) error
- func (rw *SimpleRaft) WaitForUpdates(ctx context.Context) error
- func (rw *SimpleRaft) WaitForVoter(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleRaft ¶
func NewSimpleRaft ¶
func (*SimpleRaft) CommitState ¶
func (*SimpleRaft) GetLeaderID ¶
func (rw *SimpleRaft) GetLeaderID() (leaderAddress hraft.ServerAddress, serverID hraft.ServerID)
func (*SimpleRaft) GetPeers ¶
func (rw *SimpleRaft) GetPeers() []peer.AddrInfo
func (*SimpleRaft) IsLeader ¶
func (rw *SimpleRaft) IsLeader() bool
func (*SimpleRaft) VerifyLeader ¶
func (rw *SimpleRaft) VerifyLeader() error
func (*SimpleRaft) WaitForLeader ¶
func (rw *SimpleRaft) WaitForLeader(ctx context.Context) (string, error)
WaitForLeader holds until Raft says we have a leader. Returns if ctx is canceled.
func (*SimpleRaft) WaitForSync ¶
func (rw *SimpleRaft) WaitForSync(ctx context.Context) error
WaitForSync waits for a leader and for the state to be up to date, then returns.
func (*SimpleRaft) WaitForUpdates ¶
func (rw *SimpleRaft) WaitForUpdates(ctx context.Context) error
WaitForUpdates holds until Raft has synced to the last index in the log
func (*SimpleRaft) WaitForVoter ¶
func (rw *SimpleRaft) WaitForVoter(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.