1
0
mirror of https://github.com/Luzifer/preserve.git synced 2024-09-19 16:32:56 +00:00
preserve/storage.go

20 lines
396 B
Go

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
}