gpaste/files/filestore.go
Torjus Håkestad 17a484db91
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add filesize to file metadata
2022-01-24 15:52:15 +01:00

25 lines
443 B
Go

package files
import (
"io"
"time"
)
type File struct {
ID string `json:"id"`
OriginalFilename string `json:"original_filename"`
MaxViews uint `json:"max_views"`
ExpiresOn time.Time `json:"expires_on"`
Body io.ReadCloser
FileSize int64 `json:"file_size"`
}
type FileStore interface {
Store(f *File) error
Get(id string) (*File, error)
Delete(id string) error
List() ([]string, error)
}