Documentation ¶
Index ¶
- Constants
- type CacheService
- type Feed
- type FeedItem
- type FeedService
- func (f FeedService) Create(ctx context.Context, channelID string) (Feed, error)
- func (f FeedService) CreateItems(ctx context.Context, items []YouTubeFeedEntry) ([]FeedItem, error)
- func (f *FeedService) Enrich(ctx context.Context, item FeedItem) (FeedItem, error)
- func (f *FeedService) GetFeedInformation(ctx context.Context, channelID string) (podcast.Podcast, error)
- type YTDLDependencies
- type YTDLService
- type YTDLVideo
- type YouTubeChannel
- type YouTubeDependency
- type YouTubeFeedEntry
- type YouTubeService
- func (y YouTubeService) GetChannel(ctx context.Context, channelId string) (YouTubeChannel, error)
- func (y YouTubeService) GetChannelCache(ctx context.Context, channelId string) (YouTubeChannel, error)
- func (y YouTubeService) ListChannel(ctx context.Context, query string) ([]YouTubeChannel, error)
- func (y YouTubeService) ListChannelCache(ctx context.Context, query string) ([]YouTubeChannel, error)
- func (y YouTubeService) ListEntry(ctx context.Context, 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(ctx context.Context, key string, to interface{}) error
Get looks for object via key in cache
func (*CacheService) MarshalAndSet ¶
func (c *CacheService) MarshalAndSet(ctx context.Context, key string, value interface{}) error
MarshalAndSetKey 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(ctx context.Context, items []YouTubeFeedEntry) ([]FeedItem, error)
func (*FeedService) GetFeedInformation ¶ added in v1.2.1
type YTDLDependencies ¶
type YTDLService ¶
type YTDLService struct {
// contains filtered or unexported fields
}
func NewYTDLService ¶
func NewYTDLService(ytdl ytdlRepository) YTDLService
func (YTDLService) GetFileInformation ¶
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(context.Context, string) ([]YouTubeFeedEntry, error) GetChannelCache(context.Context, 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(ctx context.Context, channelId string) (YouTubeChannel, error)
func (YouTubeService) GetChannelCache ¶
func (y YouTubeService) GetChannelCache(ctx context.Context, channelId string) (YouTubeChannel, error)
func (YouTubeService) ListChannel ¶
func (y YouTubeService) ListChannel(ctx context.Context, query string) ([]YouTubeChannel, error)
func (YouTubeService) ListChannelCache ¶
func (y YouTubeService) ListChannelCache(ctx context.Context, query string) ([]YouTubeChannel, error)
func (YouTubeService) ListEntry ¶
func (y YouTubeService) ListEntry(ctx context.Context, channelId string) ([]YouTubeFeedEntry, error)
Click to show internal directories.
Click to hide internal directories.