gpaste/files/filestore.go

25 lines
439 B
Go
Raw Normal View History

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"`
2022-01-24 19:25:52 +00:00
OriginalFilename string `json:"originalFilename"`
MaxViews uint `json:"maxViews"`
ExpiresOn time.Time `json:"expiresOn"`
2022-01-15 18:07:33 +00:00
2022-01-19 00:03:24 +00:00
Body io.ReadCloser
2022-01-24 14:52:15 +00:00
2022-01-24 19:25:52 +00:00
FileSize int64 `json:"fileSize"`
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)
}