Versions in this module Expand all Collapse all v0 v0.10.1 Dec 14, 2024 Changes in this version + const CommandAddConsistentHashEntry + const LeaderElectionTimeout + const RaftLeaderState + type ConsistentHashCommand struct + BlockName string + Hash uint64 + Type string + type FSM struct + func NewFSM() *FSM + func (f *FSM) Apply(log *raft.Log) interface{} + func (f *FSM) GetProxyBlock(hash uint64) (string, bool) + func (f *FSM) Restore(rc io.ReadCloser) error + func (f *FSM) Snapshot() (raft.FSMSnapshot, error) + type FSMSnapshot struct + func (f *FSMSnapshot) Persist(sink raft.SnapshotSink) error + func (f *FSMSnapshot) Release() + type Node struct + Fsm *FSM + Logger zerolog.Logger + Peers []config.RaftPeer + func NewRaftNode(logger zerolog.Logger, raftConfig config.Raft) (*Node, error) + func (n *Node) AddPeer(peerID, peerAddr string) error + func (n *Node) Apply(data []byte, timeout time.Duration) error + func (n *Node) GetState() raft.RaftState + func (n *Node) RemovePeer(peerID string) error + func (n *Node) Shutdown() error