Documentation ¶
Index ¶
- Constants
- Variables
- type Channel
- type Feed
- type Video
- type YT
- func (yt YT) ChannelGet(id string) (Channel, error)
- func (yt YT) ChannelsGetFromCache(id string) (Channel, error)
- func (yt YT) ChannelsList(query string) ([]Channel, error)
- func (yt YT) ChannelsListFromCache(query string) ([]Channel, error)
- func (yt YT) TrendingList() ([]Channel, error)
- func (yt YT) TrendingListFromCache() ([]Channel, error)
- func (yt YT) VideosList(channelId string) ([]Video, error)
Constants ¶
View Source
const ( CacheChannelPrefix = "youtube-channel-" CacheChannelTtl = time.Hour * 24 * 31 CacheChannelsPrefix = "youtube-channels-q-" CacheChannelsTtl = time.Hour * 24 CacheTrendingPrefix = "youtube-trending" CacheTrendingTtl = time.Hour * 24 )
View Source
const ( ChannelsMaxResults = 3 YouTubeChannelBaseURL = "https://www.youtube.com/channel/" )
View Source
const ( BASE_URL = "https://www.youtube.com/" FEED_URL_BASE = BASE_URL + "feeds/videos.xml" )
Variables ¶
View Source
var FEED_URL *url.URL
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct { Author string `json:"author"` AuthorEmail string `json:"authorEmail"` ChannelId string `json:"channelId"` Country string `json:"country"` Description string `json:"description"` PublishedAt time.Time `json:"publishedAt"` Thumbnail string `json:"thumbnail"` Title string `json:"title"` Url string `json:"url"` }
Channel holds metadata about channel
type Feed ¶
type Feed struct { XMLName xml.Name `xml:"feed"` Text string `xml:",chardata"` Yt string `xml:"yt,attr"` Media string `xml:"media,attr"` Xmlns string `xml:"xmlns,attr"` Link []struct { Text string `xml:",chardata"` Rel string `xml:"rel,attr"` Href string `xml:"href,attr"` } `xml:"link"` ID string `xml:"id"` ChannelId string `xml:"channelId"` Title string `xml:"title"` Author struct { Text string `xml:",chardata"` Name string `xml:"name"` URI string `xml:"uri"` } `xml:"author"` Published string `xml:"published"` Entry []struct { Text string `xml:",chardata"` ID string `xml:"id"` VideoId string `xml:"videoId"` ChannelId string `xml:"channelId"` Title string `xml:"title"` Link struct { Text string `xml:",chardata"` Rel string `xml:"rel,attr"` Href string `xml:"href,attr"` } `xml:"link"` Author struct { Text string `xml:",chardata"` Name string `xml:"name"` URI string `xml:"uri"` } `xml:"author"` Published string `xml:"published"` Updated string `xml:"updated"` Group struct { Text string `xml:",chardata"` Title string `xml:"title"` Content struct { Text string `xml:",chardata"` URL string `xml:"url,attr"` Type string `xml:"type,attr"` Width string `xml:"width,attr"` Height string `xml:"height,attr"` } `xml:"content"` Thumbnail struct { Text string `xml:",chardata"` URL string `xml:"url,attr"` Width string `xml:"width,attr"` Height string `xml:"height,attr"` } `xml:"thumbnail"` Description string `xml:"description"` Community struct { Text string `xml:",chardata"` StarRating struct { Text string `xml:",chardata"` Count string `xml:"count,attr"` Average string `xml:"average,attr"` Min string `xml:"min,attr"` Max string `xml:"max,attr"` } `xml:"starRating"` Statistics struct { Text string `xml:",chardata"` Views string `xml:"views,attr"` } `xml:"statistics"` } `xml:"community"` } `xml:"group"` } `xml:"entry"` }
type Video ¶
type Video struct { ID string `json:"id"` Title string `json:"title"` Description string `json:"description"` PublishedAt time.Time `json:"publishedAt"` Thumbnail youtube.Thumbnail `json:"thumbnail"` Url string `json:"url"` }
Video holds metadata about video
type YT ¶
type YT struct {
// contains filtered or unexported fields
}
var Yt YT
func (YT) ChannelsListFromCache ¶
func (YT) TrendingList ¶
func (YT) TrendingListFromCache ¶
Click to show internal directories.
Click to hide internal directories.