Documentation
¶
Index ¶
Constants ¶
View Source
const SortDirectionAscending = "asc"
View Source
const SortDirectionDescending = "desc"
View Source
const SortFieldTimeCreated = "time_created"
View Source
const SortFieldTimeUpdated = "time_updated"
View Source
const SortFieldTitle = "title"
Variables ¶
View Source
var ErrorVideoNotFound = errors.New("video not found")
View Source
var SortFields = []string{ SortFieldTitle, SortFieldTimeCreated, SortFieldTimeUpdated, }
Functions ¶
func NewDummyVideoRepo ¶
func NewDummyVideoRepo(fs files.FileSystem) *dummyVideoRepo
func NewPostgresVideoRepo ¶
Types ¶
type Video ¶
type Video struct {
ID uint `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Thumbnail string `json:"thumbnail"`
Source string `json:"source"`
OriginalFileName string `json:"original_file_name"`
TimeCreated string `json:"time_created"`
TimeUpdated string `json:"time_updated"`
Tags []string `json:"tags"`
}
func GenerateThumbnail ¶
type VideoFilter ¶
type VideoFilter struct {
Title string
Tags []string
Any string
SortDirection string
SortField string
}
VideoFilter represents a "filter" used for querying stored videos. It's eventually shoved into the `WHERE` part of a query, or equivalent.
func (VideoFilter) Empty ¶
func (filter VideoFilter) Empty() bool
func (VideoFilter) Sort ¶
func (filter VideoFilter) Sort() bool
func (VideoFilter) ValidSortDirection ¶
func (filter VideoFilter) ValidSortDirection() bool
func (VideoFilter) ValidSortField ¶
func (filter VideoFilter) ValidSortField() bool
Click to show internal directories.
Click to hide internal directories.