Documentation
¶
Index ¶
- Variables
- type Breadcrumb
- type BreadcrumbItem
- type BreadcrumbRepo
- type Channel
- type Playlist
- type PlaylistRepo
- type Series
- type SeriesMeta
- type SeriesRepo
- type Store
- func (m *Store) Find(ctx context.Context, path string) (BreadcrumbItem, error)
- func (s *Store) GetChannel(ctx context.Context, urlName string) (Channel, error)
- func (m *Store) GetPlaylist(ctx context.Context, playlistID int) (Playlist, error)
- func (m *Store) GetPlaylistPopular(ctx context.Context, fromPeriod time.Time) (Playlist, error)
- func (m *Store) GetPlaylistPopularByAllTime(ctx context.Context) (Playlist, error)
- func (m *Store) GetPlaylistPopularByPastMonth(ctx context.Context) (Playlist, error)
- func (m *Store) GetPlaylistPopularByPastYear(ctx context.Context) (Playlist, error)
- func (m *Store) GetPlaylistRandom(ctx context.Context) (Playlist, error)
- func (m *Store) GetSeries(ctx context.Context, seriesID int) (Series, error)
- func (m *Store) GetSeriesFromPath(ctx context.Context, path string) (Series, error)
- func (m *Store) GetSeriesImmediateChildrenSeries(ctx context.Context, seriesID int) ([]SeriesMeta, error)
- func (m *Store) GetSeriesMeta(ctx context.Context, seriesID int) (Series, error)
- func (s *Store) GetTeam(ctx context.Context, emailAlias string) (Team, error)
- func (s *Store) GetTeamByYear(ctx context.Context, teamID, year int) (Team, error)
- func (m *Store) GetVideo(ctx context.Context, videoID int) (*VideoItem, error)
- func (s *Store) ListChannels(ctx context.Context) ([]Channel, error)
- func (s *Store) ListOfficers(ctx context.Context) ([]TeamMember, error)
- func (s *Store) ListTeamMembers(ctx context.Context, teamID int) ([]TeamMember, error)
- func (s *Store) ListTeams(ctx context.Context) ([]Team, error)
- func (m *Store) ListVideo(ctx context.Context, offset int, page int) (*[]VideoMeta, error)
- func (m *Store) Search(ctx context.Context, query string) (Series, error)
- func (m *Store) SeriesBreadcrumb(ctx context.Context, seriesID int) ([]Breadcrumb, error)
- func (m *Store) SeriesByYear(ctx context.Context, year int) (Series, error)
- func (m *Store) VideoBreadcrumb(ctx context.Context, videoID int) ([]Breadcrumb, error)
- func (m *Store) VideoOfSeries(ctx context.Context, seriesID int) ([]VideoMeta, error)
- type StreamRepo
- type Team
- type TeamMember
- type TeamRepo
- type VideoFile
- type VideoItem
- type VideoMeta
- type VideoRepo
Constants ¶
This section is empty.
Variables ¶
var ( ErrVideoNotFound = errors.New("video not found") ErrSeriesNotFound = errors.New("series not found") )
Functions ¶
This section is empty.
Types ¶
type Breadcrumb ¶
type Breadcrumb struct {
ID int `db:"id" json:"id"`
URL string `db:"url" json:"url"`
UseInURL bool `db:"use" json:"useInURL"`
Name string `db:"name" json:"name"`
SeriesID int `db:"series_id" json:"-"` // Here since needed
}
Breadcrumb generic to be used for both series and video as a breadcrumb
type BreadcrumbItem ¶
type BreadcrumbItem struct {
Video *VideoItem `json:"video,omitempty"`
Series *Series `json:"series,omitempty"`
}
BreadcrumbItem is either a video or a series
type BreadcrumbRepo ¶
type BreadcrumbRepo interface {
VideoBreadcrumb(ctx context.Context, videoID int) ([]Breadcrumb, error)
SeriesBreadcrumb(ctx context.Context, seriesID int) ([]Breadcrumb, error)
Find(ctx context.Context, path string) (BreadcrumbItem, error)
}
BreadcrumbRepo represents all breadcrumb interactions
type Channel ¶ added in v0.7.0
type Channel struct {
URLName string `db:"url_name" json:"urlName"` // "tennis"
Name string `db:"name" json:"name"` // "YUSU Tennis 2020"
Description string `db:"description" json:"description"` // "Very good tennis"
Thumbnail string `db:"thumbnail" json:"thumbnail"`
OutputType string `db:"output_type" json:"outputType"`
OutputURL string `db:"output_url" json:"outputURL"`
Status string `db:"status" json:"status"` // "live" or "scheduled" or "cancelled" or "finished"
Location string `db:"location" json:"location"` // "Central Hall"
ScheduledStart time.Time `db:"scheduled_start" json:"scheduledStart"`
ScheduledEnd time.Time `db:"scheduled_end" json:"scheduledEnd"`
}
Channel represents a derivative of ystv/playout's channels. These are event only rather than linear or event.
type Playlist ¶ added in v0.7.0
type Playlist struct {
PlaylistID int `db:"playlist_id" json:"id"`
Name string `db:"name" json:"name"`
Description string `db:"description" json:"description"`
Thumbnail string `db:"thumbnail" json:"thumbnail"`
Videos []VideoItem `json:"videos"`
}
Playlist is a list of videos Seperate from series and can contain videos from anywhere
type PlaylistRepo ¶ added in v0.7.0
type PlaylistRepo interface {
GetPlaylist(ctx context.Context, playlistID int) (Playlist, error)
GetPlaylistPopular(ctx context.Context, fromPeriod time.Time) (Playlist, error)
GetPlaylistPopularByAllTime(ctx context.Context) (Playlist, error)
GetPlaylistPopularByPastYear(ctx context.Context) (Playlist, error)
GetPlaylistPopularByPastMonth(ctx context.Context) (Playlist, error)
GetPlaylistRandom(ctx context.Context) (Playlist, error)
}
PlaylistRepo represents all playlist interactions
type Series ¶
type Series struct {
SeriesMeta
ImmediateChildSeries []SeriesMeta `json:"childSeries"`
ChildVideos []VideoMeta `json:"videos"`
}
Series provides basic information about a series this is useful when you want to know the current series and see it's immediate children.
type SeriesMeta ¶
type SeriesMeta struct {
SeriesID int `db:"series_id" json:"id"`
URL string `db:"url" json:"url"`
SeriesName string `db:"name" json:"name"`
Description string `db:"description" json:"description"`
Thumbnail string `db:"thumbnail" json:"thumbnail"`
Depth int `db:"depth" json:"-"`
}
SeriesMeta is used as a children object for a series
type SeriesRepo ¶
type SeriesRepo interface {
GetSeries(ctx context.Context, seriesID int) (Series, error)
GetSeriesMeta(ctx context.Context, seriesID int) (Series, error)
GetSeriesImmediateChildrenSeries(ctx context.Context, seriesID int) ([]SeriesMeta, error)
GetSeriesFromPath(ctx context.Context, path string) (Series, error)
Search(ctx context.Context, query string) (Series, error)
}
SeriesRepo represents all series interactions
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store encapsulates our dependency
func (*Store) Find ¶
Find returns either a series or video for a given path TODO be consistent with creator's find in terms of variables
func (*Store) GetChannel ¶ added in v0.8.0
GetChannel will get a public or unlisted channel
func (*Store) GetPlaylist ¶ added in v0.7.0
GetPlaylist returns a playlist object containing a list of videos and metadata
func (*Store) GetPlaylistPopular ¶ added in v0.7.0
GetPlaylistPopular returns a playlist of the most popular videos
func (*Store) GetPlaylistPopularByAllTime ¶ added in v0.7.0
GetPlaylistPopularByAllTime returns a playlist of the most popular videos of all time
func (*Store) GetPlaylistPopularByPastMonth ¶ added in v0.7.0
GetPlaylistPopularByPastMonth returns a playlist of the most popular videos of past month
func (*Store) GetPlaylistPopularByPastYear ¶ added in v0.7.0
GetPlaylistPopularByPastYear returns a playlist of the most popular videos of past year
func (*Store) GetPlaylistRandom ¶ added in v0.7.0
GetPlaylistRandom retrieves a random list of videos
func (*Store) GetSeriesFromPath ¶
GetSeriesFromPath returns a series from a url path
func (*Store) GetSeriesImmediateChildrenSeries ¶
func (m *Store) GetSeriesImmediateChildrenSeries(ctx context.Context, seriesID int) ([]SeriesMeta, error)
GetSeriesImmediateChildrenSeries returns series directly below the chosen series
func (*Store) GetSeriesMeta ¶
GetSeriesMeta provides basic information for only the selected series TODO probably want to swap this to return SeriesMeta instead
func (*Store) GetTeamByYear ¶ added in v0.7.0
GetTeamByYear returns a team by a calendar year
func (*Store) GetVideo ¶
GetVideo returns a VideoItem, including the files, based on a given VideoItem ID.
func (*Store) ListChannels ¶ added in v0.7.0
ListChannels will list all public channels
func (*Store) ListOfficers ¶ added in v0.7.0
func (s *Store) ListOfficers(ctx context.Context) ([]TeamMember, error)
ListOfficers returns the list of officers of the current officers
func (*Store) ListTeamMembers ¶ added in v0.7.0
ListTeamMembers returns a list of TeamMembers who are part of a team
func (*Store) Search ¶ added in v0.7.0
Search performs a full-text search on video library
Uses postgres' full-text search, video and series tables to try to make some sense
func (*Store) SeriesBreadcrumb ¶
SeriesBreadcrumb will return the breadcrumb from SeriesID to root
func (*Store) SeriesByYear ¶ added in v0.7.0
SeriesByYear a virtual series containing child series / videos of content uploaded in that year
func (*Store) VideoBreadcrumb ¶
VideoBreadcrumb returns the absolute path from a VideoID
type StreamRepo ¶ added in v0.7.0
type StreamRepo interface {
ListChannels(ctx context.Context) ([]Channel, error)
GetChannel(ctx context.Context, urlName string) (Channel, error)
}
StreamRepo represents all stream / playout interactions
type Team ¶
type Team struct {
TeamID int `json:"id" db:"team_id"`
Name string `json:"name" db:"name"`
EmailAlias string `json:"emailAlias" db:"email_alias"`
ShortDescription string `json:"shortDescription" db:"short_description"`
LongDescripton string `json:"longDescription,omitempty" db:"full_description"`
Members []TeamMember `json:"members,omitempty"`
}
Team an organisational group
type TeamMember ¶
type TeamMember struct {
UserID int `json:"userID" db:"user_id"`
UserName string `json:"userName" db:"user_name"`
Avatar string `json:"avatar" db:"avatar"`
OfficerID int `json:"officerID" db:"officer_id"`
EmailAlias string `json:"emailAlias" db:"email_alias"`
OfficerName string `json:"officerName" db:"officer_name"`
OfficerDescription string `json:"officerDescription" db:"officer_description"`
HistoryWikiURL string `json:"historywikiURL" db:"historywiki_url"`
}
TeamMember a position within a group
type TeamRepo ¶
type TeamRepo interface {
ListTeams(ctx context.Context) ([]Team, error)
GetTeam(ctx context.Context, emailAlias string) (Team, error)
GetTeamByYear(ctx context.Context, teamID, year int) (Team, error)
ListTeamMembers(ctx context.Context, teamID int) ([]TeamMember, error)
ListOfficers(ctx context.Context) ([]TeamMember, error)
}
TeamRepo represents all team interactions
type VideoFile ¶
type VideoFile struct {
URI string `json:"uri"`
MimeType string `db:"mime_type" json:"mimeType"`
Mode string `db:"mode" json:"mode"`
Width int `db:"width" json:"width"`
Height int `db:"height" json:"height"`
}
VideoFile represents each file that a video item has stored.
type VideoMeta ¶
type VideoMeta struct {
VideoID int `db:"video_id" json:"id"`
SeriesID int `db:"series_id" json:"seriesID"`
Name string `db:"name" json:"name"`
URL string `db:"url" json:"url"`
Description string `db:"description" json:"description"`
Thumbnail string `db:"thumbnail" json:"thumbnail"`
BroadcastDate time.Time `db:"broadcast_date" json:"broadcastDate"`
Views int `db:"views" json:"views"`
Duration int `db:"duration" json:"duration"`
}
VideoMeta represents basic information about the videoitem used for listing.