You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
640 B
27 lines
640 B
package backends
|
|
|
|
import (
|
|
"errors"
|
|
"io"
|
|
"time"
|
|
|
|
"github.com/andreimarcu/linx-server/torrent"
|
|
)
|
|
|
|
type StorageBackend interface {
|
|
Delete(key string) error
|
|
Exists(key string) (bool, error)
|
|
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)
|
|
GetTorrent(fileName string, url string) (torrent.Torrent, error)
|
|
}
|
|
|
|
type MetaStorageBackend interface {
|
|
StorageBackend
|
|
List() ([]string, error)
|
|
}
|
|
|
|
var NotFoundErr = errors.New("File not found.")
|
|
var FileEmptyError = errors.New("Empty file")
|