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