Documentation ¶
Index ¶
- Constants
- type CacheService
- type Feed
- type FeedItem
- type FeedService
- type YTDLDependencies
- type YTDLService
- type YTDLVideo
- type YouTubeChannel
- type YouTubeDependency
- type YouTubeFeedEntry
- type YouTubeService
- func (y YouTubeService) GetChannel(channelId string) (YouTubeChannel, error)
- func (y YouTubeService) GetChannelCache(channelId string) (YouTubeChannel, error)
- func (y YouTubeService) ListChannel(query string) ([]YouTubeChannel, error)
- func (y YouTubeService) ListChannelCache(query string) ([]YouTubeChannel, error)
- func (y YouTubeService) ListEntry(channelId string) ([]YouTubeFeedEntry, error)
- type YouTubeThumbnail
Constants ¶
View Source
const ( CacheGetChannelPrefix = "youtube-channel-" CacheGetChannelTtl = time.Hour * 24 * 31 CacheListChannelPrefix = "youtube-channels-q-" CacheListChannelTtl = time.Hour * 24 )
View Source
const ( FormatsNotFound = "no formats available that match criteria" YoutubeVideoBaseURL = "https://www.youtube.com/watch?v=" )
View Source
const (
CacheTTL = time.Hour * 24
)
View Source
const (
Generator = "YouTubeGoesPodcast/v2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheService ¶
type CacheService struct {
// contains filtered or unexported fields
}
func NewCacheService ¶
func NewCacheService(cache cacheRepository) CacheService
func (*CacheService) Get ¶
func (c *CacheService) Get(key string, to interface{}) error
Get looks for object via key in cache
func (*CacheService) MarshalAndSet ¶
func (c *CacheService) MarshalAndSet(key string, value interface{}) error
MarshalAndSetKey is the same as SetKey but before that it marshals value. Simple helper
func (*CacheService) Set ¶
func (c *CacheService) Set(key string, value interface{}) error
Set is the same as SetKey but before that it marshals value. Simple helper
type FeedItem ¶
type FeedService ¶
type FeedService struct {
// contains filtered or unexported fields
}
func NewFeedService ¶
func NewFeedService( youtubeService YouTubeDependency, ytdlService YTDLDependencies, ) FeedService
func (FeedService) CreateItems ¶
func (f FeedService) CreateItems(items []YouTubeFeedEntry) ([]FeedItem, error)
func (*FeedService) GetFeedInformation ¶ added in v1.2.1
func (f *FeedService) GetFeedInformation(channelID string) (podcast.Podcast, error)
type YTDLDependencies ¶
type YTDLService ¶
type YTDLService struct {
// contains filtered or unexported fields
}
func NewYTDLService ¶
func NewYTDLService(ytdl ytdlRepository) YTDLService
func (YTDLService) GetFileInformation ¶
func (y YTDLService) GetFileInformation(videoId string) (YTDLVideo, error)
func (YTDLService) GetFileURL ¶
type YouTubeChannel ¶
type YouTubeChannel struct { Author string AuthorEmail string ChannelId string Country string Description string PublishedAt time.Time Thumbnail YouTubeThumbnail Title string Url string Category string }
YouTubeChannel holds metadata about channel
type YouTubeDependency ¶
type YouTubeDependency interface { ListEntry(string) ([]YouTubeFeedEntry, error) GetChannelCache(string) (YouTubeChannel, error) }
type YouTubeFeedEntry ¶
type YouTubeService ¶
type YouTubeService struct {
// contains filtered or unexported fields
}
func NewYouTubeService ¶
func NewYouTubeService(ytRepo youTubeRepository, ytApiRepo youTubeApiRepository, cache CacheService) YouTubeService
func (YouTubeService) GetChannel ¶
func (y YouTubeService) GetChannel(channelId string) (YouTubeChannel, error)
func (YouTubeService) GetChannelCache ¶
func (y YouTubeService) GetChannelCache(channelId string) (YouTubeChannel, error)
func (YouTubeService) ListChannel ¶
func (y YouTubeService) ListChannel(query string) ([]YouTubeChannel, error)
func (YouTubeService) ListChannelCache ¶
func (y YouTubeService) ListChannelCache(query string) ([]YouTubeChannel, error)
func (YouTubeService) ListEntry ¶
func (y YouTubeService) ListEntry(channelId string) ([]YouTubeFeedEntry, error)
Click to show internal directories.
Click to hide internal directories.