mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
21 lines
447 B
Go
21 lines
447 B
Go
package raft
|
|
|
|
type Snapshot struct {
|
|
Data []byte
|
|
|
|
// the configuration
|
|
Nodes []int64
|
|
// the index at which the snapshot was taken.
|
|
Index int64
|
|
// the log term of the index
|
|
Term int64
|
|
}
|
|
|
|
// A snapshoter can make a snapshot of its current state atomically.
|
|
// It can restore from a snapshot and get the latest snapshot it took.
|
|
type Snapshoter interface {
|
|
Snap(index, term int64, nodes []int64)
|
|
Restore(snap Snapshot)
|
|
GetSnap() Snapshot
|
|
}
|