Documentation
¶
Index ¶
- Variables
- type Breadcrumb
- type BreadcrumbItem
- type BreadcrumbRepo
- type Channel
- type CustomSetting
- type CustomSettingsRepo
- type Playlist
- type PlaylistRepo
- type Repos
- type Series
- type SeriesMeta
- type SeriesRepo
- type Store
- func (s *Store) Find(ctx context.Context, path string) (BreadcrumbItem, error)
- func (s *Store) GetChannel(ctx context.Context, urlName string) (Channel, error)
- func (s *Store) GetCustomSettingPublic(ctx context.Context, settingID string) (CustomSetting, error)
- func (s *Store) GetPlaylist(ctx context.Context, playlistID int) (Playlist, error)
- func (s *Store) GetPlaylistPopular(ctx context.Context, fromPeriod time.Time) (Playlist, error)
- func (s *Store) GetPlaylistPopularByAllTime(ctx context.Context) (Playlist, error)
- func (s *Store) GetPlaylistPopularByPastMonth(ctx context.Context) (Playlist, error)
- func (s *Store) GetPlaylistPopularByPastYear(ctx context.Context) (Playlist, error)
- func (s *Store) GetPlaylistRandom(ctx context.Context) (Playlist, error)
- func (s *Store) GetSeries(ctx context.Context, seriesID int) (Series, error)
- func (s *Store) GetSeriesBreadcrumb(ctx context.Context, seriesID int) ([]Breadcrumb, error)
- func (s *Store) GetSeriesByYear(ctx context.Context, year int) (Series, error)
- func (s *Store) GetSeriesFromPath(ctx context.Context, path string) (Series, error)
- func (s *Store) GetSeriesFullMeta(ctx context.Context, seriesID int) (Series, error)
- func (s *Store) GetSeriesImmediateChildrenSeries(ctx context.Context, seriesID int) ([]SeriesMeta, error)
- func (s *Store) GetSeriesMeta(ctx context.Context, seriesID int) (SeriesMeta, error)
- func (s *Store) GetTeamByEmail(ctx context.Context, emailAlias string) (Team, error)
- func (s *Store) GetTeamByID(ctx context.Context, teamID int) (Team, error)
- func (s *Store) GetTeamByStartEndYearByEmail(ctx context.Context, emailAlias string, startYear, endYear int) (Team, error)
- func (s *Store) GetTeamByStartEndYearByID(ctx context.Context, teamID, startYear, endYear int) (Team, error)
- func (s *Store) GetTeamByYearByEmail(ctx context.Context, emailAlias string, year int) (Team, error)
- func (s *Store) GetTeamByYearByID(ctx context.Context, teamID, year int) (Team, error)
- func (s *Store) GetVideo(ctx context.Context, videoID int) (*VideoItem, error)
- func (s *Store) GetVideoBreadcrumb(ctx context.Context, videoID int) ([]Breadcrumb, error)
- func (s *Store) ListChannels(ctx context.Context) ([]Channel, error)
- func (s *Store) ListOfficers(ctx context.Context) ([]TeamMemberDB, error)
- func (s *Store) ListTeamMembers(ctx context.Context, teamID int) ([]TeamMemberDB, error)
- func (s *Store) ListTeams(ctx context.Context) ([]Team, error)
- func (s *Store) ListVideos(ctx context.Context, offset int, page int) (*[]VideoMeta, error)
- func (s *Store) Search(ctx context.Context, query string) (Series, error)
- func (s *Store) TeamMemberDBToTeamMember(teamMember TeamMemberDB) TeamMember
- func (s *Store) VideoOfSeries(ctx context.Context, seriesID int) ([]VideoMeta, error)
- type StreamRepo
- type Team
- type TeamMember
- type TeamMemberDB
- 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 {
GetVideoBreadcrumb(ctx context.Context, videoID int) ([]Breadcrumb, error)
GetSeriesBreadcrumb(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 events only rather than linear or events.
type CustomSetting ¶ added in v0.9.8
type CustomSetting struct {
SettingID string `db:"setting_id" json:"settingID"`
// Value will be returned in Base64 from PostgreSQL
Value interface{} `db:"value" json:"value"`
}
type CustomSettingsRepo ¶ added in v0.9.8
type CustomSettingsRepo interface {
GetCustomSettingPublic(ctx context.Context, settingID string) (CustomSetting, error)
}
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 Separate 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 Repos ¶ added in v0.9.6
type Repos interface {
VideoRepo
SeriesRepo
PlaylistRepo
BreadcrumbRepo
TeamRepo
StreamRepo
CustomSettingsRepo
}
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 its 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) (SeriesMeta, error)
GetSeriesFullMeta(ctx context.Context, seriesID int) (Series, error)
GetSeriesImmediateChildrenSeries(ctx context.Context, seriesID int) ([]SeriesMeta, error)
GetSeriesFromPath(ctx context.Context, path string) (Series, error)
GetSeriesByYear(ctx context.Context, year int) (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) GetCustomSettingPublic ¶ added in v0.9.8
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 from all time
func (*Store) GetPlaylistPopularByPastMonth ¶ added in v0.7.0
GetPlaylistPopularByPastMonth returns a playlist of the most popular videos from the past month
func (*Store) GetPlaylistPopularByPastYear ¶ added in v0.7.0
GetPlaylistPopularByPastYear returns a playlist of the most popular videos from the past year
func (*Store) GetPlaylistRandom ¶ added in v0.7.0
GetPlaylistRandom retrieves a random list of videos
func (*Store) GetSeriesBreadcrumb ¶ added in v0.9.5
GetSeriesBreadcrumb will return the breadcrumb from SeriesID to root
func (*Store) GetSeriesByYear ¶ added in v0.9.5
GetSeriesByYear a virtual series containing child series / videos of content uploaded in that year
func (*Store) GetSeriesFromPath ¶
GetSeriesFromPath returns a series from an url path
func (*Store) GetSeriesFullMeta ¶ added in v0.9.5
GetSeriesFullMeta provides basic information for only the selected series
func (*Store) GetSeriesImmediateChildrenSeries ¶
func (s *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
func (*Store) GetTeamByEmail ¶ added in v0.9.5
GetTeamByEmail returns a single team including its members
func (*Store) GetTeamByID ¶ added in v0.9.5
GetTeamByID returns a single team including its members
func (*Store) GetTeamByStartEndYearByEmail ¶ added in v0.9.5
func (s *Store) GetTeamByStartEndYearByEmail(ctx context.Context, emailAlias string, startYear, endYear int) (Team, error)
GetTeamByStartEndYearByEmail returns a team by an academic year
func (*Store) GetTeamByStartEndYearByID ¶ added in v0.9.5
func (s *Store) GetTeamByStartEndYearByID(ctx context.Context, teamID, startYear, endYear int) (Team, error)
GetTeamByStartEndYearByID returns a team by an academic year
func (*Store) GetTeamByYearByEmail ¶ added in v0.9.5
func (s *Store) GetTeamByYearByEmail(ctx context.Context, emailAlias string, year int) (Team, error)
GetTeamByYearByEmail returns a team by a calendar year
func (*Store) GetTeamByYearByID ¶ added in v0.9.5
GetTeamByYearByID 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) GetVideoBreadcrumb ¶ added in v0.9.5
GetVideoBreadcrumb returns the absolute path from a VideoID
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) ([]TeamMemberDB, error)
ListOfficers returns the list of current officers
func (*Store) ListTeamMembers ¶ added in v0.7.0
ListTeamMembers returns a list of TeamMembers who are part of a team
func (*Store) ListVideos ¶ added in v0.9.7
ListVideos returns all video metadata
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) TeamMemberDBToTeamMember ¶ added in v0.9.6
func (s *Store) TeamMemberDBToTeamMember(teamMember TeamMemberDB) TeamMember
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"`
LongDescription string `json:"longDescription,omitempty" db:"full_description"`
Members []TeamMember `json:"members,omitempty"`
}
Team an organisational group
type TeamMember ¶
type TeamMember struct {
UserName string `json:"userName"`
Avatar string `json:"avatar"`
EmailAlias string `json:"emailAlias"`
Pronouns *string `json:"pronouns,omitempty"`
OfficerName string `json:"officerName"`
OfficerDescription string `json:"officerDescription"`
HistoryWikiURL string `json:"historywikiURL"`
TeamEmail string `json:"teamEmail"`
IsLeader bool `json:"isLeader"`
IsDeputy bool `json:"isDeputy"`
StartDate *time.Time `json:"startDate,omitempty"`
EndDate *time.Time `json:"endDate,omitempty"`
}
TeamMember a position within a group
type TeamMemberDB ¶ added in v0.9.6
type TeamMemberDB struct {
UserID int `db:"user_id"`
UserName string `db:"user_name"`
UserEmail string `db:"user_email"`
Avatar string `db:"avatar"`
UseGravatar bool `db:"use_gravatar"`
EmailAlias string `db:"email_alias"`
Pronouns null.String `db:"pronouns"`
OfficerName string `db:"officer_name"`
OfficerDescription string `db:"officer_description"`
HistoryWikiURL string `db:"historywiki_url"`
TeamEmail string `db:"team_email"`
IsLeader bool `db:"is_leader"`
IsDeputy bool `db:"is_deputy"`
StartDate null.Time `db:"start_date"`
EndDate null.Time `db:"end_date"`
}
TeamMemberDB a position within a group
type TeamRepo ¶
type TeamRepo interface {
ListTeams(ctx context.Context) ([]Team, error)
GetTeamByEmail(ctx context.Context, emailAlias string) (Team, error)
GetTeamByID(ctx context.Context, teamID int) (Team, error)
GetTeamByYearByEmail(ctx context.Context, emailAlias string, year int) (Team, error)
GetTeamByYearByID(ctx context.Context, teamID, year int) (Team, error)
GetTeamByStartEndYearByEmail(ctx context.Context, emailAlias string, startYear, endYear int) (Team, error)
GetTeamByStartEndYearByID(ctx context.Context, teamID, startYear, endYear int) (Team, error)
ListTeamMembers(ctx context.Context, teamID int) ([]TeamMemberDB, error)
ListOfficers(ctx context.Context) ([]TeamMemberDB, 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.