snapshot.go 282 B

123456789101112131415161718
  1. package raft
  2. var emptySnapshot = Snapshot{}
  3. type Snapshot struct {
  4. Data []byte
  5. // the configuration
  6. Nodes []int64
  7. // the index at which the snapshot was taken.
  8. Index int64
  9. // the log term of the index
  10. Term int64
  11. }
  12. func (s Snapshot) IsEmpty() bool {
  13. return s.Term == 0
  14. }