Documentation ¶
Index ¶
- type Image
- type MediaProps
- type Storage
- func (s *Storage) AddImage(ctx context.Context, props *MediaProps) (dest string, id int64, err error)
- func (s *Storage) AddVideo(v *Video) error
- func (s *Storage) DeleteImage(ctx context.Context, imageID int64) (path string, err error)
- func (s *Storage) GetImageSource(ctx context.Context, id int64) (source string, err error)
- func (s *Storage) GetOwner(ctx context.Context, imageID int64) (owner string, err error)
- func (s *Storage) LookupHash(ctx context.Context, hash, uploader string) (id int64, err error)
- type Video
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { ID int64 `json:"id" db:"id,pk,unique,autoinc"` Source string `json:"source" db:"source"` Thumbnail sql.NullString `json:"thumbnail" db:"thumbnail"` Alt sql.NullString `json:"alt" db:"alt"` }
type MediaProps ¶ added in v0.8.5
type MediaProps struct { Uploader string `json:"uploader"` Ext string `json:"ext"` Hash string `json:"hash,omitempty"` ImageType string `json:"imageType,omitempty"` MediaID *uuid.UUID `json:"mediaID,omitempty"` }
MediaProps are used in upload requests to specify the media type and uploader etc.
type Storage ¶
func (*Storage) DeleteImage ¶ added in v0.7.3
DeleteImage looks up the path of the image to delete based on it's id, then deletes the database record and returns the path to be deleted by the controller
func (*Storage) GetImageSource ¶ added in v0.7.0
type Video ¶
type Video struct { ID int64 `json:"id" db:"id,pk,unique,autoinc"` Source string `json:"source" db:"source"` Thumbnail sql.NullString `json:"thumbnail" db:"thumbnail"` Alt sql.NullString `json:"alt" db:"alt"` }
Click to show internal directories.
Click to hide internal directories.