Documentation
¶
Overview ¶
Package trakt provides a minimal HTTP client for the Trakt API v2. Only the endpoints needed for import lists are implemented.
Index ¶
- type Client
- func (c *Client) GetAnticipated(ctx context.Context) ([]Movie, error)
- func (c *Client) GetBoxOffice(ctx context.Context) ([]Movie, error)
- func (c *Client) GetCustomList(ctx context.Context, username, listSlug string) ([]Movie, error)
- func (c *Client) GetPopular(ctx context.Context) ([]Movie, error)
- func (c *Client) GetTrending(ctx context.Context) ([]Movie, error)
- func (c *Client) GetWatchlist(ctx context.Context, username string) ([]Movie, error)
- func (c *Client) WithBaseURL(u string) *Client
- func (c *Client) WithHTTPClient(hc *http.Client) *Client
- type Movie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Trakt API v2 HTTP client.
func New ¶
New creates a new Trakt client. clientID is the Trakt API key (obtained from trakt.tv/oauth/applications). logger may be nil.
func (*Client) GetAnticipated ¶
GetAnticipated fetches Trakt's most anticipated movies.
func (*Client) GetBoxOffice ¶
GetBoxOffice fetches Trakt's current box office movies.
func (*Client) GetCustomList ¶
GetCustomList fetches a user's custom list items (movies only).
func (*Client) GetPopular ¶
GetPopular fetches Trakt's popular movies list.
func (*Client) GetTrending ¶
GetTrending fetches Trakt's trending movies (most watched right now).
func (*Client) GetWatchlist ¶
GetWatchlist fetches a user's movie watchlist.
func (*Client) WithBaseURL ¶
WithBaseURL overrides the API base URL. Intended for tests only.