Fix state interface

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
Hector Sanjuan 2017-03-13 18:44:42 +01:00
parent 9ac81a8539
commit 8c1bf77287

View File

@ -3,6 +3,8 @@ package state
// State represents the shared state of the cluster and it
import (
cid "github.com/ipfs/go-cid"
"io"
"github.com/ipfs/ipfs-cluster/api"
)
@ -19,4 +21,8 @@ type State interface {
Has(*cid.Cid) bool
// Get returns the information attacthed to this pin
Get(*cid.Cid) api.Pin
// Snapshot writes a snapshot of the state to a writer
Snapshot(w io.Writer) error
// Restore restores a snapshot from a reader
Restore(r io.Reader) error
}