2014-09-23 20:39:12 +00:00
|
|
|
package backend
|
|
|
|
|
|
|
|
type Type string
|
|
|
|
|
|
|
|
const (
|
|
|
|
Blob Type = "blob"
|
|
|
|
Key = "key"
|
|
|
|
Lock = "lock"
|
|
|
|
Snapshot = "snapshot"
|
|
|
|
Tree = "tree"
|
|
|
|
)
|
|
|
|
|
2014-10-04 14:49:39 +00:00
|
|
|
const (
|
|
|
|
BackendVersion = 1
|
|
|
|
)
|
|
|
|
|
2014-09-23 20:39:12 +00:00
|
|
|
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
|
2014-10-04 14:49:39 +00:00
|
|
|
Version() uint
|
2014-09-23 20:39:12 +00:00
|
|
|
|
|
|
|
Location() string
|
|
|
|
}
|