2019-10-15 14:21:32 +02:00
|
|
|
package media
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"gopkg.in/volatiletech/null.v6"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Media represents an uploaded object.
|
|
|
|
type Media struct {
|
|
|
|
ID int `db:"id" json:"id"`
|
|
|
|
UUID string `db:"uuid" json:"uuid"`
|
|
|
|
Filename string `db:"filename" json:"filename"`
|
2020-07-05 14:05:05 +02:00
|
|
|
Thumb string `db:"thumb" json:"thumb"`
|
2019-10-15 14:21:32 +02:00
|
|
|
CreatedAt null.Time `db:"created_at" json:"created_at"`
|
2020-07-05 14:05:05 +02:00
|
|
|
ThumbURL string `json:"thumb_url"`
|
|
|
|
Provider string `json:"provider"`
|
|
|
|
URL string `json:"url"`
|
2019-10-15 14:21:32 +02:00
|
|
|
}
|
|
|
|
|
2020-07-05 14:05:05 +02:00
|
|
|
// Store represents functions to store and retrieve media (files).
|
2019-10-15 14:21:32 +02:00
|
|
|
type Store interface {
|
|
|
|
Put(string, string, io.ReadSeeker) (string, error)
|
|
|
|
Delete(string) error
|
|
|
|
Get(string) string
|
|
|
|
}
|