Documentation ¶
Index ¶
- Constants
- type CacheService
- type Details
- 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 FileService
- type YTDLDependencies
- 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-" CacheListChannelPrefix = "youtube-channels-q-" )
View Source
const (
CacheTTL = time.Hour * 24
)
View Source
const (
Generator = "YouTubeGoesPodcast/v2"
)
View Source
const (
YoutubeVideoBaseURL = "https://www.youtube.com/watch?v="
)
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{})
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, fileService 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 FileService ¶ added in v1.8.1
type FileService struct{}
func NewFileService ¶ added in v1.8.1
func NewFileService() FileService
func (FileService) GetDetails ¶ added in v1.8.1
type YTDLDependencies ¶
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.