1
0
Fork 0
mirror of https://github.com/Luzifer/preserve.git synced 2024-11-08 22:30:05 +00:00
preserve/storage.go

20 lines
396 B
Go
Raw Normal View History

package main
import (
"context"
"io"
"time"
)
type meta struct {
ContentType string
LastCached time.Time
LastModified time.Time
}
type storage interface {
GetFile(ctx context.Context, cachePath string) (io.ReadSeekCloser, error)
LoadMeta(ctx context.Context, cachePath string) (*meta, error)
StoreFile(ctx context.Context, cachePath string, metadata *meta, data io.Reader) error
}