Documentation ¶
Index ¶
- Constants
- Variables
- type Achieved
- type Achievement
- type AchievementCondition
- type AchievementGroup
- type AppConfig
- type Application
- type ApplicationGroup
- type Availability
- type BatchLoaders
- type CalendarEntry
- type Collection
- type CollectionItem
- type ComputedCondition
- type ComputedData
- type ContentType
- type Contribution
- type ContributionType
- type Device
- type Episode
- type EpisodeContext
- type Event
- type FAQCategory
- type File
- type Filter
- type FilteredLoaders
- type Game
- type GlobalConfig
- type Identifier
- type ImageStyle
- type ImageTaskType
- type Images
- type ItemCollection
- type Lesson
- type Link
- type LinkType
- type LocaleMap
- type LocaleString
- func (localeString LocaleString) Any() bool
- func (localeString LocaleString) AsJSON() []byte
- func (localeString LocaleString) Get(languages []string) string
- func (localeString LocaleString) GetValueOrNil(languages []string) *string
- func (localeString LocaleString) Has(key string) bool
- func (localeString LocaleString) Placeholder(placeholder string, replacementMap LocaleString) LocaleString
- func (localeString LocaleString) Prefix(prefix string) LocaleString
- type MediaProgress
- type Message
- type MessageGroup
- type Notification
- type Page
- type Permissions
- type Person
- type Phrase
- type Playlist
- type Profile
- type ProfileLoaders
- type Progress
- type Prompt
- type Question
- type QuestionAlternative
- type QuestionTaskType
- type Redirect
- type Roles
- type SearchQuery
- type SearchResult
- type SearchResultItem
- type Season
- type Section
- type SectionOptions
- type SelectedAlternatives
- type Short
- type ShortIDWithMeta
- type Show
- type Song
- type Status
- type Stream
- type StudyTaskType
- type StudyTopic
- type Survey
- type SurveyQuestion
- type Tag
- type Target
- type Task
- type TimedMetadata
- type TranslationData
- type User
- type UserCollection
- type UserCollectionEntry
- type UserCollectionMetadata
- type Visibility
Constants ¶
const ( TypeHLSCmaf = "hls_cmaf" TypeDash = "dash" )
const ( ImageStyleDefault = ImageStyle("default") ImageStyleIcon = ImageStyle("icon") ImageStyleFeatured = ImageStyle("featured") ImageStylePoster = ImageStyle("poster") )
ImageStyles
const ( StatusDraft = Status("draft") StatusPublished = Status("published") StatusUnlisted = Status("unlisted") StatusArchived = Status("archived") )
Status constants
const ( TaskTypeQuestion = StudyTaskType("question") TaskTypeImage = StudyTaskType("image") TaskTypeVideo = StudyTaskType("video") TaskTypeLink = StudyTaskType("link") QuestionTaskTypeAlternatives = QuestionTaskType("alternatives") QuestionTaskTypeText = QuestionTaskType("text") ImageTaskTypePoster = ImageTaskType("poster") ImageTaskTypeQuote = ImageTaskType("quote") )
TaskTypes
const (
StreamServiceAzureMedia = "azure_media_services"
)
StreamServiceAzureMedia Various media services that we have available
const TargetTypeUsergroups = "usergroups"
Variables ¶
var ( ContributionTypeLyricist = ContributionType{"lyricist"} ContributionTypeArranger = ContributionType{"arranger"} ContributionTypeSinger = ContributionType{"singer"} ContributionTypeSpeaker = ContributionType{"speaker"} ContributionTypeUnknown = ContributionType{"unknown"} ContributionTypes = enum.New( ContributionTypeLyricist, ContributionTypeArranger, ContributionTypeSinger, ContributionTypeSpeaker, ContributionTypeUnknown, ) )
var ( ErrItemNotFound = newError("item/not-found", "item not found", "Item not found!") ErrProfileNotSet = newError("user/not-authenticated", "profile not set / user unauthenticated", "You must be authenticated for this to work!") ErrItemNotPublished = newError("item/not-published", "item is not published", "Item is not published!") ErrItemNoAccess = newError("item/no-access", "user has no access to this item", "You do not have access to this item!") ErrTaskAlreadyCompleted = newError("task/already-completed", "task was already completed", "Task is already completed!") ErrInvalidUUID = newError("uuid/invalid", "invalid uuid passed", "UUID is invalid!") )
Errors
var ( CollectionUnknown = ItemCollection{"unknown"} CollectionShows = ItemCollection{"shows"} CollectionSeasons = ItemCollection{"seasons"} CollectionEpisodes = ItemCollection{"episodes"} CollectionPages = ItemCollection{"pages"} CollectionGames = ItemCollection{"games"} CollectionLinks = ItemCollection{"links"} CollectionPlaylists = ItemCollection{"playlists"} CollectionStudyTopics = ItemCollection{"studytopics"} CollectionShorts = ItemCollection{"shorts"} CollectionPersons = ItemCollection{"persons"} Collections = enum.New( CollectionUnknown, CollectionShows, CollectionSeasons, CollectionEpisodes, CollectionPages, CollectionGames, CollectionLinks, CollectionPlaylists, CollectionStudyTopics, CollectionShorts, CollectionPersons, ) )
Types of items
var ( ContentTypeSong = ContentType{Value: "song"} ContentTypeSpeech = ContentType{Value: "speech"} ContentTypeTestimony = ContentType{Value: "testimony"} ContentTypeSingAlong = ContentType{Value: "sing_along"} ContentTypeOther = ContentType{Value: "other"} ContentTypeTheme = ContentType{Value: "theme"} ContentTypeInterview = ContentType{Value: "interview"} ContentTypes = enum.New(OrderedContentTypes...) )
var DefaultLanguages = []string{"en", "no"}
DefaultLanguages is the order of languages if none is defined by the user
var ( // IgnoreEpisodeAssetEndpoint is here for ignoring a specific endpoint because it doesn't work. IgnoreEpisodeAssetEndpoints = []string{ "7c011f242c6f4875a52e400061ef784a", "942b3eed46ad4ec48e539fa12f81b50e", } )
var OrderedContentTypes = []ContentType{ ContentTypeSpeech, ContentTypeInterview, ContentTypeTheme, ContentTypeSong, ContentTypeOther, ContentTypeSingAlong, }
Functions ¶
This section is empty.
Types ¶
type Achievement ¶
type Achievement struct { ID uuid.UUID Title LocaleString Description LocaleString Images LocaleMap[null.String] GroupID uuid.NullUUID Conditions []AchievementCondition }
Achievement is the struct for achievements.sql
func (Achievement) GetKey ¶
func (a Achievement) GetKey() uuid.UUID
GetKey returns key for this item
type AchievementCondition ¶
AchievementCondition is a condition for which an achievement should be completed
type AchievementGroup ¶
type AchievementGroup struct { ID uuid.UUID Title LocaleString }
AchievementGroup is a group of different achievements.sql
func (AchievementGroup) GetKey ¶
func (a AchievementGroup) GetKey() uuid.UUID
GetKey returns key for this item
type AppConfig ¶
type AppConfig struct {
MinVersion string
}
AppConfig contains configuration of the app.
type Application ¶
type Application struct { ID int UUID uuid.UUID GroupID uuid.UUID Default bool Code string ClientVersion string DefaultPageID null.Int SearchPageID null.Int GamesPageID null.Int RelatedCollectionID null.Int SupportEmail null.String Roles []string LivestreamRoles []string }
Application contains data for
type ApplicationGroup ¶
ApplicationGroup contains data for
func (ApplicationGroup) GetKey ¶
func (i ApplicationGroup) GetKey() uuid.UUID
GetKey returns the key for this item
type Availability ¶
type Availability struct { Unlisted bool Published bool From time.Time To time.Time PublishedOn time.Time }
Availability struct for availability on items
type BatchLoaders ¶
type BatchLoaders struct { ApplicationLoader *loaders.Loader[int, *Application] ApplicationIDFromCodeLoader *loaders.Loader[string, *int] ApplicationGroupLoader *loaders.Loader[uuid.UUID, *ApplicationGroup] RedirectLoader *loaders.Loader[uuid.UUID, *Redirect] RedirectIDFromCodeLoader *loaders.Loader[string, *uuid.UUID] PageLoader *loaders.Loader[int, *Page] PageIDFromCodeLoader *loaders.Loader[string, *int] CollectionIDFromSlugLoader *loaders.Loader[string, *int] SectionLoader *loaders.Loader[int, *Section] CollectionLoader *loaders.Loader[int, *Collection] CollectionItemLoader *loaders.Loader[int, []*CollectionItem] StudyTopicLoader *loaders.Loader[uuid.UUID, *StudyTopic] StudyLessonLoader *loaders.Loader[uuid.UUID, *Lesson] StudyTaskLoader *loaders.Loader[uuid.UUID, *Task] StudyQuestionAlternativesLoader *loaders.Loader[uuid.UUID, []*QuestionAlternative] ShowLoader *loaders.Loader[int, *Show] SeasonLoader *loaders.Loader[int, *Season] EpisodeLoader *loaders.Loader[int, *Episode] EpisodeIDFromLegacyIDLoader *loaders.Loader[int, *int] EpisodeIDFromLegacyProgramIDLoader *loaders.Loader[int, *int] LinkLoader *loaders.Loader[int, *Link] PlaylistLoader *loaders.Loader[uuid.UUID, *Playlist] FilesLoader *loaders.Loader[int, []*File] StreamsLoader *loaders.Loader[int, []*Stream] AssetFilesLoader *loaders.Loader[int, []*File] AssetStreamsLoader *loaders.Loader[int, []*Stream] EventLoader *loaders.Loader[int, *Event] EventEntriesLoader *loaders.Loader[int, []*int] FAQCategoryLoader *loaders.Loader[uuid.UUID, *FAQCategory] QuestionLoader *loaders.Loader[uuid.UUID, *Question] MessageGroupLoader *loaders.Loader[int, *MessageGroup] SurveyLoader *loaders.Loader[uuid.UUID, *Survey] SurveyQuestionLoader *loaders.Loader[uuid.UUID, *SurveyQuestion] GameLoader *loaders.Loader[uuid.UUID, *Game] ShortLoader *loaders.Loader[uuid.UUID, *Short] ShortsMediaIDLoader *loaders.Loader[uuid.UUID, *uuid.UUID] MemberLoader *loaders.Loader[int, *members.Member] OrganizationLoader *loaders.Loader[uuid.UUID, *members.Organization] EpisodeProgressLoader *loaders.Loader[uuid.UUID, []*int] EpisodeIDFromUuidLoader *loaders.Loader[uuid.UUID, *int] ShowIDFromUuidLoader *loaders.Loader[uuid.UUID, *int] // Permissions ShowPermissionLoader *loaders.Loader[int, *Permissions[int]] SeasonPermissionLoader *loaders.Loader[int, *Permissions[int]] EpisodePermissionLoader *loaders.Loader[int, *Permissions[int]] PagePermissionLoader *loaders.Loader[int, *Permissions[int]] SectionPermissionLoader *loaders.Loader[int, *Permissions[int]] CompletedTopicsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] CompletedLessonsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] CompletedTasksLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] CompletedAndLockedTasksLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] // Achievements AchievementLoader *loaders.Loader[uuid.UUID, *Achievement] AchievementGroupLoader *loaders.Loader[uuid.UUID, *AchievementGroup] AchievementsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] UnconfirmedAchievementsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] AchievementGroupAchievementsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] ComputedDataLoader *loaders.Loader[uuid.UUID, []*ComputedData] UserLoader *loaders.Loader[string, *User] // UserCollections UserCollectionLoader *loaders.Loader[uuid.UUID, *UserCollection] UserCollectionEntryLoader *loaders.Loader[uuid.UUID, *UserCollectionEntry] UserCollectionEntryIDsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] ProfileUserCollectionIDsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] ProfileMyListCollectionID *loaders.Loader[uuid.UUID, *uuid.UUID] PromptLoader *loaders.Loader[uuid.UUID, *Prompt] MediaItemPrimaryEpisodeIDLoader *loaders.Loader[uuid.UUID, *int] TimedMetadataLoader *loaders.Loader[uuid.UUID, *TimedMetadata] ChaptersLoader *loaders.Loader[int, []*TimedMetadata] PersonLoader *loaders.Loader[uuid.UUID, *Person] SongLoader *loaders.Loader[uuid.UUID, *Song] PhraseLoader *loaders.Loader[string, *Phrase] ContributionsLoader *loaders.Loader[int32, *Contribution] }
BatchLoaders contains loaders for the different items
type CalendarEntry ¶
type CalendarEntry struct { ID int EventID null.Int Title LocaleString Description LocaleString Start time.Time End time.Time Type null.String IsReplay bool ItemID null.Int }
CalendarEntry contains details about a specific TvGuide entry
func (CalendarEntry) GetKey ¶
func (i CalendarEntry) GetKey() int
GetKey returns the key for this item
type Collection ¶
type Collection struct { ID int `json:"id"` Slugs LocaleString `json:"slugs"` Title LocaleString `json:"title"` Type string `json:"type"` AdvancedType null.String `json:"advancedType"` Filter *Filter `json:"filter"` NumberInTitles bool `json:"numberInTitles"` }
Collection is the definition of the Collection object
type CollectionItem ¶
type CollectionItem struct { ID int `json:"id"` Sort int `json:"sort"` CollectionID int `json:"collectionId"` Type ItemCollection `json:"type"` ItemID string `json:"itemId"` }
CollectionItem is the definition of the CollectionItem object
func (CollectionItem) GetKey ¶
func (s CollectionItem) GetKey() int
GetKey returns the key for this item
type ComputedCondition ¶
ComputedCondition is to assert if the computed should be applied
type ComputedData ¶
type ComputedData struct { GroupID uuid.UUID ID uuid.UUID Result string Conditions []ComputedCondition }
ComputedData contains computed things
type ContentType ¶
type Contribution ¶
type ContributionType ¶
type Device ¶
type Device struct { Token string ProfileID uuid.UUID UpdatedAt time.Time Name string Languages []string }
Device is a profile-linked device with a token for notifications
type Episode ¶
type Episode struct { ID int `json:"id"` UUID uuid.UUID `json:"uuid"` Status Status `json:"unlisted"` Type string `json:"type"` PreventPublicIndexing bool `json:"preventPublicIndexing"` LegacyID null.Int `json:"legacyId"` LegacyProgramID null.Int `json:"legacyProgramId"` SeasonID null.Int `json:"seasonId"` ProductionDateInTitle bool `json:"publishDateInTitle"` PublishDate time.Time `json:"publishDate"` ProductionDate time.Time `json:"productionDate"` AvailableFrom time.Time `json:"availableFrom"` AvailableTo time.Time `json:"availableTo"` Number null.Int `json:"number"` Duration int `json:"duration"` AgeRating string `json:"ageRating"` AssetID null.Int `json:"assetId"` Assets LocaleMap[int] `json:"assets"` AssetVersion string `json:"assetVersion"` Images Images `json:"images"` TagIDs []int `json:"tagIds"` PublicTitle null.String `json:"publicTitle"` Title LocaleString `json:"title"` Description LocaleString `json:"description"` ExtraDescription LocaleString `json:"extraDescription"` NumberInTitle bool `json:"numberInTitle"` ContentType null.String `json:"contentType"` Audience null.String `json:"audience"` }
Episode is the definition of the Episode object
type EpisodeContext ¶
type EpisodeContext struct { CollectionID null.Int Cursor null.String Shuffle null.Bool }
EpisodeContext contains context for episode
type FAQCategory ¶
type FAQCategory struct { ID uuid.UUID Title LocaleString }
FAQCategory contains the name of the FAQ category
func (FAQCategory) GetKey ¶
func (i FAQCategory) GetKey() uuid.UUID
GetKey returns the key for this item
type File ¶
type File struct { ID int `json:"id"` Type string `json:"type"` EpisodeID int `json:"episodeId"` AssetID int `json:"assetId"` AudioLanguage null.String `json:"audioLanguage"` SubtitleLanguage null.String `json:"subtitleLanguage"` Path string `json:"path"` Storage string `json:"storage"` MimeType string `json:"mimeType"` Resolution string `json:"resolution"` Size int `json:"size"` }
File item type
type Filter ¶
type Filter struct { Filter json.RawMessage SortBy string SortByDirection string Limit *int }
Filter struct contains filter data
type FilteredLoaders ¶
type FilteredLoaders struct { Key string EpisodeFilterLoader *loaders.Loader[int, *int] EpisodeUUIDFilterLoader *loaders.Loader[uuid.UUID, *uuid.UUID] EpisodesLoader *loaders.Loader[int, []*int] TagEpisodesLoader *loaders.Loader[int, []*int] SeasonFilterLoader *loaders.Loader[int, *int] SeasonsLoader *loaders.Loader[int, []*int] ShowFilterLoader *loaders.Loader[int, *int] ShowUUIDFilterLoader *loaders.Loader[uuid.UUID, *uuid.UUID] SectionsLoader *loaders.Loader[int, []*int] CollectionItemsLoader *loaders.Loader[int, []*CollectionItem] CollectionItemIDsLoader *loaders.Loader[int, []Identifier] CalendarEntryLoader *loaders.Loader[int, *CalendarEntry] StudyTopicFilterLoader *loaders.Loader[uuid.UUID, *uuid.UUID] StudyLessonsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] StudyLessonFilterLoader *loaders.Loader[uuid.UUID, *uuid.UUID] StudyTasksLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] StudyTaskFilterLoader *loaders.Loader[uuid.UUID, *uuid.UUID] SurveyQuestionsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] ContributionsForPersonLoader *loaders.Loader[uuid.UUID, []*Contribution] FAQQuestionsLoader *loaders.Loader[uuid.UUID, []*uuid.UUID] //Relations StudyLessonEpisodesLoader *loaders.Loader[uuid.UUID, []*int] EpisodeStudyLessonsLoader *loaders.Loader[int, []*uuid.UUID] StudyLessonLinksLoader *loaders.Loader[uuid.UUID, []*int] LinkStudyLessonsLoader *loaders.Loader[int, []*uuid.UUID] // Lists PromptIDsLoader func(ctx context.Context) ([]uuid.UUID, error) FAQCategoryIDsLoader func(ctx context.Context) ([]uuid.UUID, error) ShortIDsLoader func(ctx context.Context) ([][]uuid.UUID, error) ShortWithScoresLoader func(ctx context.Context) ([]ShortIDWithMeta, error) }
FilteredLoaders contains loaders that will be filtered by permissions.
type Game ¶
type Game struct { ID uuid.UUID `json:"id"` Title LocaleString Description LocaleString Images Images Url string RequiresAuth bool }
Game contains details for a game
type GlobalConfig ¶
GlobalConfig contains configuration of all clients
type Identifier ¶
Identifier contains basic data for identifying an item in a list
type Images ¶
Images is a map of styles with related images
func (Images) GetDefault ¶
func (i Images) GetDefault(languages []string, style ImageStyle) *string
GetDefault returns the default image for language and style
func (Images) GetForLanguages ¶
func (i Images) GetForLanguages(languages []string) map[ImageStyle]*string
GetForLanguages retrieves Image for
type ItemCollection ¶
ItemCollection is what type of item current struct is
type Lesson ¶
type Lesson struct { ID uuid.UUID TopicID uuid.UUID Title LocaleString Description LocaleString Images Images }
Lesson is a lesson within a topic
type Link ¶
type Link struct { ID int `json:"id"` Title LocaleString `json:"title"` Description LocaleString `json:"description"` URL string `json:"url"` Images Images `json:"images"` Type LinkType `json:"type"` ComputedDataGroupID uuid.NullUUID `json:"computedDataGroupId"` }
Link contains link data
type LocaleMap ¶
LocaleMap is a map of strings to nullable strings
func (LocaleMap[T]) GetValueOrNil ¶
GetValueOrNil returns either the value for selected languages or nil
type LocaleString ¶
type LocaleString LocaleMap[null.String]
LocaleString is a map of strings to nullable strings
func (LocaleString) Any ¶
func (localeString LocaleString) Any() bool
Any returns true if there's any valid value in the map
func (LocaleString) AsJSON ¶
func (localeString LocaleString) AsJSON() []byte
AsJSON returns the values as a JSON string
For example: ```
{ "de": "Wilkommen", "en": "Welcome", }
func (LocaleString) Get ¶
func (localeString LocaleString) Get(languages []string) string
Get from a translation map based on the fallbacks
func (LocaleString) GetValueOrNil ¶
func (localeString LocaleString) GetValueOrNil(languages []string) *string
GetValueOrNil returns either the value for selected languages or nil
func (LocaleString) Has ¶
func (localeString LocaleString) Has(key string) bool
Has returns a bool if the LocaleString contains a value for the specified key
func (LocaleString) Placeholder ¶
func (localeString LocaleString) Placeholder(placeholder string, replacementMap LocaleString) LocaleString
Placeholder replaces the specified placeholder with values from the replacementMap
func (LocaleString) Prefix ¶
func (localeString LocaleString) Prefix(prefix string) LocaleString
Prefix all entries with prefix, returns new map after
type MediaProgress ¶
type MediaProgress struct { ProfileID uuid.UUID `json:"profileId"` MediaID uuid.UUID `json:"itemId"` Progress float64 `json:"progress"` Duration float64 `json:"duration"` Watched int `json:"watched"` WatchedAt null.Time `json:"watchedAt"` UpdatedAt time.Time `json:"updatedAt"` FromStart bool `json:"fromStart"` }
MediaProgress is the profile progress for a specific media item
type Message ¶
type Message struct { ID int `json:"id"` Style string `json:"style"` Title LocaleString `json:"message"` Content LocaleString `json:"details"` }
Message is a message
type MessageGroup ¶
type MessageGroup struct { ID int `json:"id"` Enabled bool `json:"enabled"` Messages []Message `json:"messages"` }
MessageGroup is a group of messages
type Notification ¶
type Notification struct { ID uuid.UUID Status Status Title LocaleString `json:"title"` Description LocaleString `json:"description"` Images LocaleMap[null.String] `json:"images"` ScheduleAt null.Time `json:"scheduleAt"` SendStarted null.Time `json:"sendStarted"` SendCompleted null.Time `json:"sendCompleted"` DeepLink null.String `json:"deepLink"` Action null.String `json:"action"` HighPriority bool `json:"highPriority"` TargetIDs []uuid.UUID `json:"targetIds"` ApplicationGroupID uuid.UUID // inherited from the application group FirebaseProjectID null.String `json:"firebaseProjectId"` }
Notification contains notification data
type Page ¶
type Page struct { ID int `json:"id"` Code string `json:"code"` Title LocaleString `json:"title"` Description LocaleString `json:"description"` Images Images `json:"images"` }
Page is the definition of the Page object
type Permissions ¶
type Permissions[k comparable] struct { ItemID k Availability Availability Roles Roles }
Permissions contains permissions that restrict access to items
type Phrase ¶
type Phrase struct { Key string Value LocaleString }
Phrase is a key value pair for translations
type Playlist ¶
type Playlist struct { ID uuid.UUID CollectionID null.Int Title LocaleString Description LocaleString Images Images }
Playlist is a collection of items
type ProfileLoaders ¶
type ProfileLoaders struct { ProgressLoader *loaders.Loader[int, *Progress] TaskCompletedLoader *loaders.Loader[uuid.UUID, *uuid.UUID] AchievementAchievedAtLoader *loaders.Loader[uuid.UUID, *Achieved] GetSelectedAlternativesLoader *loaders.Loader[uuid.UUID, *SelectedAlternatives] SeasonDefaultEpisodeLoader *loaders.Loader[int, *int] ShowDefaultEpisodeLoader *loaders.Loader[int, *int] MediaProgressLoader *loaders.Loader[uuid.UUID, *MediaProgress] TopicDefaultLessonLoader *loaders.Loader[uuid.UUID, *uuid.UUID] }
ProfileLoaders contains loaders per profile
type Progress ¶
type Progress struct { EpisodeID int ShowID null.Int Progress int Duration int Watched int WatchedAt null.Time UpdatedAt time.Time Context EpisodeContext }
Progress contains basic data for progress
type Prompt ¶
type Prompt struct { ID uuid.UUID `json:"id"` Type string Title LocaleString SecondaryTitle LocaleString SurveyID uuid.NullUUID From time.Time To time.Time }
Prompt is a prompt that shows up in app
type Question ¶
type Question struct { ID uuid.UUID CategoryID uuid.UUID Question LocaleString Answer LocaleString }
Question contains question data
type QuestionAlternative ¶
QuestionAlternative is an alternative for a question
func (QuestionAlternative) GetKey ¶
func (i QuestionAlternative) GetKey() uuid.UUID
GetKey returns the key for this item
type Redirect ¶
type Redirect struct { ID uuid.UUID Code string TargetURL string IncludeToken bool RequiresAuthentication bool }
Redirect contains data for an authenticated redirect
type SearchQuery ¶
type SearchQuery struct { Query string `json:"query"` Limit *int `json:"limit"` Offset *int `json:"offset"` Type *string `json:"type"` MinScore *int `json:"minScore"` }
SearchQuery used as body in the POST request to the API
type SearchResult ¶
type SearchResult struct { ResultCount int `json:"resultCount"` Result []SearchResultItem `json:"result"` HitCount int `json:"hitCount"` Page int `json:"page"` PageCount int `json:"pageCount"` TopScore int `json:"topScore"` }
SearchResult for exposing a list of search results
type SearchResultItem ¶
type SearchResultItem struct { ID int `json:"id"` LegacyID *int `json:"legacyID"` Duration *int `json:"duration"` AgeRating *string `json:"ageRating"` Collection string `json:"collection"` Title string `json:"title"` Header *string `json:"header"` Description *string `json:"description"` ShowID *int `json:"showId,omitempty"` Show *string `json:"show,omitempty"` SeasonID *int `json:"seasonId,omitempty"` Season *string `json:"season,omitempty"` Highlight *string `json:"highlight"` Image *string `json:"thumbnail"` Url string `json:"url"` }
SearchResultItem for exposing search results through the API
type Season ¶
type Season struct { ID int `json:"id"` Status Status `json:"status"` LegacyID null.Int `json:"legacyId"` TagIDs []int `json:"tagIds"` Number int `json:"number"` AgeRating string `json:"ageRating"` PublicTitle null.String `json:"publicTitle"` Title LocaleString `json:"title"` Description LocaleString `json:"description"` ShowID int `json:"showId"` Image null.String `json:"image"` Images Images `json:"images"` }
Season is the definition of the Season object
type Section ¶
type Section struct { ID int `json:"id"` Sort int `json:"sort"` PageID int `json:"pageId"` Type string `json:"type"` ShowTitle bool `json:"showTitle"` Title LocaleString `json:"title"` Description LocaleString `json:"description"` Style string `json:"style"` Size string `json:"size"` CollectionID null.Int `json:"collectionId"` MessageID null.Int `json:"messageId"` EmbedUrl null.String `json:"embedUrl"` EmbedAspectRatio null.Float `json:"embedAspectRatio"` EmbedHeight null.Int `json:"embedHeight"` NeedsAuthentication null.Bool `json:"needsAuthentication"` Options SectionOptions `json:"options"` AchievementsSource null.String `json:"achievementsSource"` }
Section is the definition of the Section object
type SectionOptions ¶
type SectionOptions struct { SecondaryTitles bool MyList bool ContinueWatching bool UseContext bool PrependLiveElement bool Limit int }
SectionOptions contains options for this section
type SelectedAlternatives ¶
SelectedAlternatives is a struct for getting selected alternatives of a question
func (SelectedAlternatives) GetKey ¶
func (sa SelectedAlternatives) GetKey() uuid.UUID
GetKey returns the key for this item
type Short ¶
type Short struct { ID uuid.UUID MediaID uuid.UUID AssetID null.Int Title LocaleString Description LocaleString Images Images Score float64 EpisodeID null.Int StartsAt null.Float EndsAt null.Float Label string Status Status DateUpdated time.Time TagIDs []int }
Short item type
type ShortIDWithMeta ¶
type ShortIDWithMeta struct { ID uuid.UUID AgeInDays int ParentEpisodeID null.Int FinalScore float64 }
ShortIDWithMeta
Age - Age of the short in days ParentEpisodeID - ID of the full episode where the short was extracted from FinalScore - Final score of the short, with all adjustments
type Show ¶
type Show struct { ID int `json:"id"` Status Status `json:"status"` Type string `json:"type"` TagIDs []int `json:"tagIds"` LegacyID null.Int `json:"legacyId"` PublicTitle null.String `json:"publicTitle"` Title LocaleString `json:"title"` Description LocaleString `json:"description"` Image null.String `json:"image"` Images Images `json:"images"` DefaultEpisodeBehaviour null.String `json:"defaultEpisode"` RelatedCollectionID null.Int `json:"relatedCollectionId"` }
Show is the definition of the Show object
type Song ¶
type Song struct { ID uuid.UUID Title LocaleString }
Song contains some metadata for songs
type Status ¶
type Status string
Status is a global enum for directus status
func MostRestrictiveStatus ¶
MostRestrictiveStatus returns the most restrictive status
type Stream ¶
type Stream struct { ID int `json:"id"` Type string `json:"type"` EpisodeID int `json:"episodeId"` AssetID int `json:"assetId"` AudioLanguages []string `json:"audioLanguages"` SubtitleLanguages []string `json:"subtitleLanguages"` Path string `json:"path"` Service string `json:"service"` Url string `json:"url"` EncryptionKeyID null.String `json:"encryptionKeyId"` ConfigurationId null.String `json:"configurationId"` }
Stream item type
type StudyTopic ¶
type StudyTopic struct { ID uuid.UUID Title LocaleString Description LocaleString Images Images }
StudyTopic is a topic for studying something specific
func (StudyTopic) GetKey ¶
func (i StudyTopic) GetKey() uuid.UUID
GetKey returns the key for this item
type Survey ¶
type Survey struct { ID uuid.UUID `json:"id"` Title LocaleString Description LocaleString }
Survey is a survey
type SurveyQuestion ¶
type SurveyQuestion struct { ID uuid.UUID `json:"id"` Title LocaleString Description LocaleString Type string CancelButtonText LocaleString ActionButtonText LocaleString URL null.String }
SurveyQuestion is a question in a survey
type Tag ¶
type Tag struct { ID int `json:"id"` Code string `json:"code"` Name LocaleString `json:"name"` }
Tag struct
type Task ¶
type Task struct { ID uuid.UUID LessonID uuid.UUID Title LocaleString Type StudyTaskType QuestionType QuestionTaskType ImageType ImageTaskType LinkID null.Int EpisodeID null.Int Images LocaleMap[string] MultiSelect null.Bool CompetitionMode bool Alternatives []QuestionAlternative SecondaryTitle LocaleString Description LocaleString }
Task is the struct for Tasks
type TimedMetadata ¶
type TimedMetadata struct { ID uuid.UUID Type string Timestamp float64 Duration float64 Title LocaleString `json:"title"` Description LocaleString `json:"description"` ContentType ContentType PersonIDs []uuid.UUID SongID uuid.NullUUID MediaItemID uuid.NullUUID Images Images ParentEpisodeID int }
TimedMetadata item type
type TranslationData ¶
type TranslationData struct { Language string Value json.RawMessage ID string }
type User ¶
type User struct { FirstName string DisplayName string Roles []string Email string EmailVerified bool PersonID string Anonymous bool ActiveBCC bool AgeGroup string Gender string ChurchIDs []int Age int CompletedRegistration bool }
User represents an actual user in the system
type UserCollection ¶
type UserCollection struct { ID uuid.UUID ApplicationGroupID uuid.UUID ProfileID uuid.UUID Title string Metadata UserCollectionMetadata UpdatedAt time.Time CreatedAt time.Time }
UserCollection is a collection created by a user
type UserCollectionEntry ¶
type UserCollectionEntry struct { ID uuid.UUID CollectionID uuid.UUID Type string ItemID uuid.UUID Sort int UpdatedAt time.Time CreatedAt time.Time }
UserCollectionEntry is an entry in a user collection
type UserCollectionMetadata ¶
type UserCollectionMetadata struct {
MyList bool `json:"myList"`
}
UserCollectionMetadata contains options that can specify extra options for a user
type Visibility ¶
func (*Visibility) Merge ¶
func (v *Visibility) Merge(vm Visibility) (r Visibility)