Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func New ¶
New returns a client with an API Key derived from the environment, set as YOUTUBE_API_KEY.
func NewWithKey ¶
NewWithKey creates a client with the provided API Key.
func (*Client) MostPopular ¶
func (c *Client) MostPopular(ctx context.Context, param *SearchParam) (chan *ResultsPage, error)
MostPopular returns the currently most popular videos. Specifying MaxPage, MaxResultsPerPage help control how many items should be retrieved.
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, param *SearchParam) (chan *SearchPage, error)
type ResultsPage ¶
type SearchPage ¶
type SearchParam ¶
type SearchParam struct { PageToken string `json:"page_token"` // Query is the content to search for. Query string `json:"query"` // MaxPage is the maximum number of // pages of items that you want returned MaxPage uint64 `json:"max_page"` // MaxResultsPerPage is the maximum number of // items to be returned per pagination/page fetch. MaxResultsPerPage uint64 `json:"max_results_per_page"` // MaxRequestedItems is the threshold for the number // of items that you'd like to stop the search after. MaxRequestedItems uint64 `json:"max_requested_items"` // RelatedToVideoId is the id for whose // related videos you'd like returned RelatedToVideoId string `json:"related_to_video_id"` }
Click to show internal directories.
Click to hide internal directories.