Documentation
¶
Index ¶
- Constants
- type Channel
- type Client
- type Playlist
- type PlaylistItem
- type Sub
- type Youtube
- func (s *Youtube) GetChannelInfo(id string) (*Channel, error)
- func (s *Youtube) GetCost() uint32
- func (s *Youtube) PlaylistDelete(playlistId string) error
- func (s *Youtube) PlaylistInsert(title string) (*Playlist, error)
- func (s *Youtube) PlaylistItemsInsert(playlistId, videoId string) (*PlaylistItem, error)
- func (s *Youtube) PlaylistItemsList(playlistId string, filter func(*PlaylistItem) (bool, error), ...) error
- func (s *Youtube) PlaylistsList(out chan<- *Playlist) error
- func (s *Youtube) SubscriptionDelete(channelId string) error
- func (s *Youtube) SubscriptionInsert(channelId string) (*Sub, error)
- func (s *Youtube) SubscriptionsList(out chan<- *Sub) error
Constants ¶
const ISO8601_LAYOUT string = "2006-01-02T15:04:05Z0700"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ClientID string ClientSecret string TokenFile string // contains filtered or unexported fields }
func (*Client) EnableLogTransport ¶
func (a *Client) EnableLogTransport()
func (*Client) NewYoutubeService ¶
func (*Client) SetSecretFromFile ¶
type PlaylistItem ¶
type PlaylistItem struct {
*youtube.PlaylistItem
}
type Youtube ¶
type Youtube struct {
// contains filtered or unexported fields
}
func (*Youtube) GetChannelInfo ¶
GetChannelInfo returns channel info from ID. Returned value will contain only the "contentDetails" resource property (https://developers.google.com/youtube/v3/docs/channels#contentDetails). The GCloud quota impact is 1 unit
func (*Youtube) PlaylistDelete ¶
PlaylistDelete deletes a playlist from the authenticated user. The GCloud quota impact is 50 units.
func (*Youtube) PlaylistInsert ¶
PlaylistInsert creates a new private playlist for the authenticated user. The GCloud quota impact is 50 units.
func (*Youtube) PlaylistItemsInsert ¶
func (s *Youtube) PlaylistItemsInsert(playlistId, videoId string) (*PlaylistItem, error)
PlaylistItemsInsert adds a video to a playlist. The GCloud quota impact is 50 units.
func (*Youtube) PlaylistItemsList ¶
func (s *Youtube) PlaylistItemsList(playlistId string, filter func(*PlaylistItem) (bool, error), out chan<- *PlaylistItem) error
PlaylistItemsList sends to out the items of a playlist until the filter function returns false. Playlist id can be a user own playlist or a public playlist. Items will contain only the "snippet" resource property (https://developers.google.com/youtube/v3/docs/playlistItems#snippet). The GCloud quota impact is 1 unit every 50 items fetched.
func (*Youtube) PlaylistsList ¶
PlaylistsList returns all user playlists. Items will contain the "snippet" (https://developers.google.com/youtube/v3/docs/playlists#snippet) and the "contentDetails" (https://developers.google.com/youtube/v3/docs/playlists#contentDetails) resource properties The GCloud quota impact is 1 unit every 50 items fetched.
func (*Youtube) SubscriptionDelete ¶
SubscriptionDelete delete a channel from subscriptions for the authenticated user's channel. This command will results in two api requests (subscriptionId from the channelId and the delete op). The GCloud quota impact is 51 units.
func (*Youtube) SubscriptionInsert ¶
SubscriptionInsert adds a subscription for the authenticated user's channel. The GCloud quota impact is 50 units.
func (*Youtube) SubscriptionsList ¶
SubscriptionsList sends to out all the user subscriptions. Items will contain only the "snippet" resource property (https://developers.google.com/youtube/v3/docs/subscriptions#snippet). The GCloud quota impact is 1 unit every 50 items fetched.