linx-server/backends/storage.go

25 lines
527 B
Go
Raw Normal View History

package backends
import (
2019-01-25 08:33:11 +01:00
"errors"
"io"
2019-01-25 08:33:11 +01:00
"time"
)
type StorageBackend interface {
Delete(key string) error
Exists(key string) (bool, error)
2019-01-25 08:33:11 +01:00
Head(key string) (Metadata, error)
Get(key string) (Metadata, io.ReadCloser, error)
Put(key string, r io.Reader, expiry time.Time, deleteKey string) (Metadata, error)
Size(key string) (int64, error)
}
type MetaStorageBackend interface {
StorageBackend
List() ([]string, error)
}
2019-01-25 08:33:11 +01:00
var NotFoundErr = errors.New("File not found.")
var FileEmptyError = errors.New("Empty file")