Documentation ¶
Index ¶
- Variables
- func ElectionTimeout() time.Duration
- func GetClientConnection(address string) (protocol.ClusterClient, error)
- type Event
- type Map
- type Peer
- type PeerState
- type RaftHub
- func (r *RaftHub) AddPeer(name, address string)
- func (r *RaftHub) ChangeLeader(name string) error
- func (r *RaftHub) CheckFollowersHealth(d time.Duration)
- func (r *RaftHub) CheckLeaderHealth()
- func (r *RaftHub) DeRegister(ctx context.Context, request *protocol.AddPeerRequest) error
- func (r *RaftHub) GetLogFilename(ctx context.Context) (*protocol.RPCResponse, error)
- func (r RaftHub) GetPeer(name string) *Peer
- func (r RaftHub) GetPeerList() Map[string, *Peer]
- func (r *RaftHub) GetPeers(ctx context.Context) (*protocol.PeerList, error)
- func (r *RaftHub) InitiateElection()
- func (r *RaftHub) InvokePeerElection(ctx context.Context, address string, message *protocol.InitiateElectionMessage, ...) (*protocol.InitiateElectionMessage, error)
- func (r *RaftHub) Register(ctx context.Context, request *protocol.AddPeerRequest) error
- func (r *RaftHub) RemovePeer(name string)
- func (r *RaftHub) Synchronize()
- func (r *RaftHub) UpdatePeerStatus(name string, state protocol.PeerState)
- type Vote
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ElectionTimeout ¶
func GetClientConnection ¶
func GetClientConnection(address string) (protocol.ClusterClient, error)
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func NewMap ¶
func NewMap[K comparable, V any]() Map[K, V]
func (*Map[K, V]) GetEntries ¶
func (m *Map[K, V]) GetEntries() map[K]V
type Peer ¶
type Peer struct { Address string Name string State protocol.PeerState `protobuf:"enum=State" json:"State"` }
func (*Peer) CheckIsAlive ¶
type RaftHub ¶
type RaftHub struct { Self *Peer Leader *Peer EventCh chan string // contains filtered or unexported fields }
func (*RaftHub) ChangeLeader ¶
func (*RaftHub) CheckFollowersHealth ¶
func (*RaftHub) CheckLeaderHealth ¶
func (r *RaftHub) CheckLeaderHealth()
func (*RaftHub) DeRegister ¶
func (*RaftHub) GetLogFilename ¶
func (*RaftHub) InitiateElection ¶
func (r *RaftHub) InitiateElection()
func (*RaftHub) InvokePeerElection ¶
func (*RaftHub) RemovePeer ¶
func (*RaftHub) Synchronize ¶
func (r *RaftHub) Synchronize()
Click to show internal directories.
Click to hide internal directories.