Documentation
¶
Index ¶
Constants ¶
const ( // DefaultPortalEndpoint points to the portal DefaultPortalEndpoint = "https://podops.dev" // DefaultAPIEndpoint points to the API DefaultAPIEndpoint = "https://api.podops.dev" // DefaultCDNEndpoint point to the CDN DefaultCDNEndpoint = "https://cdn.podops.dev" LabelLanguage = "language" LabelExplicit = "explicit" LabelType = "type" LabelBlock = "block" LabelComplete = "complete" LabelGUID = "guid" LabelParentGUID = "parent_guid" LabelDate = "date" LabelSeason = "season" LabelEpisode = "episode" ShowTypeEpisodic = "Episodic" ShowTypeSerial = "Serial" EpisodeTypeFull = "Full" EpisodeTypeTrailer = "Trailer" EpisodeTypeBonus = "Bonus" )
const ( AssertionWarning = 0 AssertionError = 1 )
Variables ¶
This section is empty.
Functions ¶
func DefaultEpisodeMetadata ¶
DefaultEpisodeMetadata creates a default set of labels etc for a Episode resource
guid: <unique id> 'item.guid' date: <publish date> REQUIRED 'item.pubDate' season: <season number> OPTIONAL 'item.itunes.season' episode: <episode number> REQUIRED 'item.itunes.episode' explicit: True | False REQUIRED 'channel.itunes.explicit' type: Full | Trailer | Bonus REQUIRED 'item.itunes.episodeType' block: Yes OPTIONAL 'item.itunes.block' Anything else than 'Yes' has no effect
func DefaultShowMetadata ¶
DefaultShowMetadata creates a default set of labels etc for a Show resource
language: <ISO639 two-letter-code> REQUIRED 'channel.language' explicit: True | False REQUIRED 'channel.itunes.explicit' type: Episodic | Serial REQUIRED 'channel. itunes.type' block: Yes OPTIONAL 'channel.itunes.block' Anything else than 'Yes' has no effect complete: Yes OPTIONAL 'channel.itunes.complete' Anything else than 'Yes' has no effect
Types ¶
type Category ¶
type Category struct {
Name string `json:"name" yaml:"name" binding:"required"` // REQUIRED
SubCategory []string `json:"subcategory" yaml:"subcategory,omitempty"` // OPTIONAL
}
Category is the show/episodes category and it's subcategories
type Episode ¶
type Episode struct {
APIVersion string `json:"apiVersion" yaml:"apiVersion" binding:"required"` // REQUIRED default: v1.0
Kind string `json:"kind" yaml:"kind" binding:"required"` // REQUIRED default: episode
Metadata Metadata `json:"metadata" yaml:"metadata" binding:"required"` // REQUIRED
Description EpisodeDescription `json:"description" yaml:"description" binding:"required"` // REQUIRED
Image Resource `json:"image" yaml:"image" binding:"required"` // REQUIRED 'item.itunes.image'
Enclosure Resource `json:"enclosure" yaml:"enclosure" binding:"required"` // REQUIRED
}
Episode holds all metadata related to a podcast episode
func DefaultEpisode ¶
DefaultEpisode creates a default episode struc
func (*Episode) PublishDate ¶
PublishDate is a convenience method to access the pub date
func (*Episode) PublishDateTimestamp ¶
PublishDateTimestamp converts a RFC1123Z formatted timestamp into UNIX timestamp
type EpisodeDescription ¶
type EpisodeDescription struct {
Title string `json:"title" yaml:"title" binding:"required"` // REQUIRED 'item.title' 'item.itunes.title'
Summary string `json:"summary" yaml:"summary" binding:"required"` // REQUIRED 'item.description'
EpisodeText string `json:"episodeText,omitempty" yaml:"episodeText,omitempty" binding:"required"` // REQUIRED 'item.itunes.summary'
Link Resource `json:"link" yaml:"link"` // RECOMMENDED 'item.link'
Duration int `json:"duration" yaml:"duration" binding:"required"` // REQUIRED 'item.itunes.duration'
}
EpisodeDescription holds essential episode metadata
type Metadata ¶
type Metadata struct {
Name string `json:"name" yaml:"name" binding:"required"` // REQUIRED <unique name>
Labels map[string]string `json:"labels" yaml:"labels,omitempty"` // REQUIRED
}
Metadata contains information describing a resource
type Owner ¶
type Owner struct {
Name string `json:"name" yaml:"name" binding:"required"` // REQUIRED
Email string `json:"email" yaml:"email" binding:"required"` // REQUIRED
}
Owner describes the owner of the show/podcast
type Resource ¶
type Resource struct {
URI string `json:"uri" yaml:"uri" binding:"required"` // REQUIRED
Title string `json:"title,omitempty" yaml:"title,omitempty"` // OPTIONAL
Anchor string `json:"anchor,omitempty" yaml:"anchor,omitempty"` // OPTIONAL
Rel string `json:"rel,omitempty" yaml:"rel,omitempty"` // OPTIONAL
Type string `json:"type,omitempty" yaml:"type,omitempty"` // OPTIONAL
Size int `json:"size,omitempty" yaml:"size,omitempty"` // OPTIONAL
}
Resource provides a link to a media resource
type ResourceMetadata ¶
type ResourceMetadata struct {
APIVersion string `json:"apiVersion" yaml:"apiVersion" binding:"required"` // REQUIRED default: v1.0
Kind string `json:"kind" yaml:"kind" binding:"required"` // REQUIRED default: show
Metadata Metadata `json:"metadata" yaml:"metadata" binding:"required"` // REQUIRED
}
ResourceMetadata holds only the kind and metadata a resource
func (*ResourceMetadata) GUID ¶
func (r *ResourceMetadata) GUID() string
GUID is a convenience method to access the resources guid
type Show ¶
type Show struct {
APIVersion string `json:"apiVersion" yaml:"apiVersion" binding:"required"` // REQUIRED default: v1.0
Kind string `json:"kind" yaml:"kind" binding:"required"` // REQUIRED default: show
Metadata Metadata `json:"metadata" yaml:"metadata" binding:"required"` // REQUIRED
Description ShowDescription `json:"description" yaml:"description" binding:"required"` // REQUIRED
Image Resource `json:"image" yaml:"image" binding:"required"` // REQUIRED 'channel.itunes.image'
}
Show holds all metadata related to a podcast/show
func DefaultShow ¶
DefaultShow creates a default show struc
type ShowDescription ¶
type ShowDescription struct {
Title string `json:"title" yaml:"title" binding:"required"` // REQUIRED 'channel.title' 'channel.itunes.title'
Summary string `json:"summary" yaml:"summary" binding:"required"` // REQUIRED 'channel.description'
Link Resource `json:"link" yaml:"link"` // RECOMMENDED 'channel.link'
Category Category `json:"category" yaml:"category" binding:"required"` // REQUIRED channel.category
Owner Owner `json:"owner" yaml:"owner"` // RECOMMENDED 'channel.itunes.owner'
Author string `json:"author" yaml:"author"` // RECOMMENDED 'channel.itunes.author'
Copyright string `json:"copyright,omitempty" yaml:"copyright,omitempty"` // OPTIONAL 'channel.copyright'
NewFeed *Resource `json:"newFeed,omitempty" yaml:"newFeed,omitempty"` // OPTIONAL channel.itunes.new-feed-url -> move to label
}
ShowDescription holds essential show metadata