media.go 672 B

1234567891011121314151617181920212223242526
  1. package media
  2. import (
  3. "io"
  4. "gopkg.in/volatiletech/null.v6"
  5. )
  6. // Media represents an uploaded object.
  7. type Media struct {
  8. ID int `db:"id" json:"id"`
  9. UUID string `db:"uuid" json:"uuid"`
  10. Filename string `db:"filename" json:"filename"`
  11. Thumb string `db:"thumb" json:"thumb"`
  12. CreatedAt null.Time `db:"created_at" json:"created_at"`
  13. ThumbURL string `json:"thumb_url"`
  14. Provider string `json:"provider"`
  15. URL string `json:"url"`
  16. }
  17. // Store represents functions to store and retrieve media (files).
  18. type Store interface {
  19. Put(string, string, io.ReadSeeker) (string, error)
  20. Delete(string) error
  21. Get(string) string
  22. }