mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 19:08:55 +00:00
40 lines
576 B
Go
40 lines
576 B
Go
package backend
|
|
|
|
import "errors"
|
|
|
|
type Type string
|
|
|
|
const (
|
|
Data Type = "data"
|
|
Key = "key"
|
|
Lock = "lock"
|
|
Snapshot = "snapshot"
|
|
Tree = "tree"
|
|
Map = "map"
|
|
)
|
|
|
|
const (
|
|
BackendVersion = 1
|
|
)
|
|
|
|
var (
|
|
ErrAlreadyPresent = errors.New("blob is already present in backend")
|
|
)
|
|
|
|
type Lister interface {
|
|
List(Type) (IDs, error)
|
|
}
|
|
|
|
type Server interface {
|
|
Create(Type, []byte) (ID, error)
|
|
Get(Type, ID) ([]byte, error)
|
|
Lister
|
|
Test(Type, ID) (bool, error)
|
|
Remove(Type, ID) error
|
|
Version() uint
|
|
|
|
Close() error
|
|
|
|
Location() string
|
|
}
|