mirror of
https://github.com/Luzifer/preserve.git
synced 2024-11-08 14:20:05 +00:00
19 lines
396 B
Go
19 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
|
|
}
|