gpaste/filestore.go

23 lines
408 B
Go
Raw Normal View History

2022-01-15 18:07:33 +00:00
package gpaste
import (
"io"
"time"
)
type File struct {
2022-01-19 00:03:24 +00:00
ID string `json:"id"`
OriginalFilename string `json:"original_filename"`
MaxViews uint `json:"max_views"`
ExpiresOn time.Time `json:"expires_on"`
2022-01-15 18:07:33 +00:00
2022-01-19 00:03:24 +00:00
Body io.ReadCloser
2022-01-15 18:07:33 +00:00
}
type FileStore interface {
Store(f *File) error
Get(id string) (*File, error)
Delete(id string) error
List() ([]string, error)
}