Documentation ¶
Index ¶
Constants ¶
View Source
const ( BaseUrl = "https://www.youtube.com/" FeedUrlBase = BaseUrl + "feeds/videos.xml" )
View Source
const ( YouTubeChannelsMaxResults = 3 YouTubeChannelBaseURL = "https://www.youtube.com/channel/" )
Variables ¶
View Source
var FeedUrl *url.URL
Functions ¶
func NewYTDLRepository ¶
func NewYouTube ¶
func NewYouTube() (*youtube.Service, error)
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache keeps firestore client and collection
func NewCacheRepository ¶
NewCacheRepository establishes connection to Firebase and update singleton variable
type CacheEntity ¶
type CacheEntity struct { Key string `firestore:"key"` Value string `firestore:"value"` Ttl time.Duration `firestore:"ttl"` }
CacheEntity is a model for Firestore that handles cache with ttl
type FeedEntry ¶
type FeedEntry struct { ID string `xml:"id"` VideoId string `xml:"videoId"` Title string `xml:"title"` Link struct { Text string `xml:",chardata"` Rel string `xml:"rel,attr"` Href string `xml:"href,attr"` } `xml:"link"` Published string `xml:"published"` Group struct { Thumbnail struct { URL string `xml:"url,attr"` Width string `xml:"width,attr"` Height string `xml:"height,attr"` } `xml:"thumbnail"` Description string `xml:"description"` } `xml:"group"` }
type YouTubeAPIRepository ¶
type YouTubeAPIRepository struct {
// contains filtered or unexported fields
}
func NewYouTubeAPIRepository ¶
func NewYouTubeAPIRepository(yt *youtube.Service) YouTubeAPIRepository
func (YouTubeAPIRepository) GetChannel ¶
func (yt YouTubeAPIRepository) GetChannel(id string) (app.YouTubeChannel, error)
func (YouTubeAPIRepository) ListChannel ¶
func (yt YouTubeAPIRepository) ListChannel(query string) ([]app.YouTubeChannel, error)
type YouTubeRepository ¶
func NewYouTubeRepository ¶
func NewYouTubeRepository() (YouTubeRepository, error)
func (YouTubeRepository) ListEntry ¶
func (y YouTubeRepository) ListEntry(channelId string) ([]app.YouTubeFeedEntry, error)
Click to show internal directories.
Click to hide internal directories.