Better error handling and annotation

This commit is contained in:
Alexander Neumann 2014-10-07 23:19:26 +02:00
parent cbee80fc6d
commit 9b75f2cab0
3 changed files with 46 additions and 29 deletions

View file

@ -1,5 +1,7 @@
package backend
import "errors"
type Type string
const (
@ -14,6 +16,10 @@ 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)