Documentation ¶
Index ¶
Constants ¶
View Source
const ( BaseURL = "https://www.youtube.com/" FeedURLBase = BaseURL + "feeds/videos.xml" HTTPClientTimeout = time.Second * 5 )
View Source
const ( YouTubeChannelsMaxResults = 3 YouTubeChannelBaseURL = "https://www.youtube.com/channel/" )
Variables ¶
View Source
var FeedURL *url.URL
Functions ¶
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(ctx context.Context, id string) (app.YouTubeChannel, error)
func (YouTubeAPIRepository) ListChannel ¶
func (yt YouTubeAPIRepository) ListChannel(ctx context.Context, query string) ([]app.YouTubeChannel, error)
type YouTubeRepository ¶
func NewYouTubeRepository ¶
func NewYouTubeRepository() (YouTubeRepository, error)
func (YouTubeRepository) ListEntry ¶
func (y YouTubeRepository) ListEntry(ctx context.Context, channelID string) ([]app.YouTubeFeedEntry, error)
Click to show internal directories.
Click to hide internal directories.