statemachine.go 450 B

123456789101112131415
  1. package raft
  2. //------------------------------------------------------------------------------
  3. //
  4. // Typedefs
  5. //
  6. //------------------------------------------------------------------------------
  7. // StateMachine is the interface for allowing the host application to save and
  8. // recovery the state machine. This makes it possible to make snapshots
  9. // and compact the log.
  10. type StateMachine interface {
  11. Save() ([]byte, error)
  12. Recovery([]byte) error
  13. }