linx-server/backends/storage.go
mutantmonkey b7fadd9676 Add linx-cleanup tool
This doesn't completely fix #116, but it makes setting up a cron job to
do cleanup much more pleasant.
2017-05-01 21:27:28 -07:00

29 lines
520 B
Go

package backends
import (
"io"
"net/http"
)
type ReadSeekCloser interface {
io.Reader
io.Closer
io.Seeker
io.ReaderAt
}
type StorageBackend interface {
Delete(key string) error
Exists(key string) (bool, error)
Get(key string) ([]byte, error)
Put(key string, r io.Reader) (int64, error)
Open(key string) (ReadSeekCloser, error)
ServeFile(key string, w http.ResponseWriter, r *http.Request)
Size(key string) (int64, error)
}
type MetaStorageBackend interface {
StorageBackend
List() ([]string, error)
}