2022-01-20 02:40:32 +00:00
|
|
|
package files
|
2022-01-15 18:07:33 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|