Documentation ¶
Index ¶
- func GetBestThumbnail(thumbnails SnippetThumbnails) string
- func GetChannelID(url string) (string, error)
- func IsYoutubeChannel(url string) bool
- type ChannelBrandingSettings
- type ChannelBrandingSettingsImage
- type ChannelItem
- type ChannelItemSnippet
- type FetchResponse
- type PageInfo
- type SnippetThumbnail
- type SnippetThumbnails
- type VideoItem
- type VideoItemID
- type VideoSnippet
- type YoutubeClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBestThumbnail ¶
func GetBestThumbnail(thumbnails SnippetThumbnails) string
func IsYoutubeChannel ¶
Types ¶
type ChannelBrandingSettings ¶
type ChannelBrandingSettings struct {
Image ChannelBrandingSettingsImage `json:"image"`
}
type ChannelBrandingSettingsImage ¶
type ChannelBrandingSettingsImage struct {
BannerExternalURL string `json:"bannerExternalUrl"`
}
type ChannelItem ¶
type ChannelItem struct { Kind string `json:"kind"` Etag string `json:"etag"` ID string `json:"id"` Snippet ChannelItemSnippet `json:"snippet"` BrandingSettings ChannelBrandingSettings `json:"brandingSettings"` }
type ChannelItemSnippet ¶
type FetchResponse ¶
type SnippetThumbnail ¶
type SnippetThumbnails ¶
type SnippetThumbnails struct { Default SnippetThumbnail `json:"default"` Medium *SnippetThumbnail `json:"medium"` High *SnippetThumbnail `json:"high"` Standard *SnippetThumbnail `json:"standard"` }
type VideoItem ¶
type VideoItem struct { Kind string `json:"kind"` Etag string `json:"etag"` ID VideoItemID `json:"id"` Snippet VideoSnippet `json:"snippet"` }
type VideoItemID ¶
type VideoSnippet ¶
type VideoSnippet struct { PublishedAt time.Time `json:"publishedAt"` ChannelID string `json:"channelId"` Title string `json:"title"` Description string `json:"description"` ChannelTitle string `json:"channelTitle"` LiveBroadcastContent string `json:"liveBroadcastContent"` Thumbnails SnippetThumbnails `json:"thumbnails"` }
type YoutubeClient ¶
type YoutubeClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(apiKey string) *YoutubeClient
func (*YoutubeClient) FetchChannel ¶
func (y *YoutubeClient) FetchChannel(channelID string) (FetchResponse[ChannelItem], error)
func (*YoutubeClient) FetchVideos ¶
func (y *YoutubeClient) FetchVideos(channelID string) (FetchResponse[VideoItem], error)
Click to show internal directories.
Click to hide internal directories.