Versions in this module Expand all Collapse all v1 v1.11.0 Dec 19, 2024 Changes in this version + var ErrInvalidCommand = fmt.Errorf("invalid command format; expected at least 4 bytes") + func MarshalEntry(t RaftLogEntryType, payload proto.Message) ([]byte, error) + func RegisterRaftCommandHandler[Req, Resp proto.Message](fsm *FSM, t RaftLogEntryType, handler RaftHandler[Req, Resp]) + type FSM struct + func New(logger log.Logger, reg prometheus.Registerer, dir string) (*FSM, error) + func (fsm *FSM) Apply(log *raft.Log) any + func (fsm *FSM) Init() error + func (fsm *FSM) Read(fn func(*bbolt.Tx)) error + func (fsm *FSM) RegisterRestorer(r ...StateRestorer) + func (fsm *FSM) Restore(snapshot io.ReadCloser) (err error) + func (fsm *FSM) Shutdown() + func (fsm *FSM) Snapshot() (raft.FSMSnapshot, error) + type RaftHandler func(*bbolt.Tx, *raft.Log, Req) (Resp, error) + type RaftLogEntry struct + Data []byte + Type RaftLogEntryType + func (c *RaftLogEntry) UnmarshalBinary(b []byte) error + type RaftLogEntryType uint32 + type Response struct + Data proto.Message + Err error + type StateRestorer interface + Init func(*bbolt.Tx) error + Restore func(*bbolt.Tx) error