Documentation
¶
Overview ¶
Package trakt provides a minimal HTTP client for the Trakt API v2. Only the TV show endpoints needed for import lists are implemented.
Index ¶
- type Client
- func (c *Client) GetCustomListShows(ctx context.Context, username, listSlug string) ([]Show, error)
- func (c *Client) GetPopularShows(ctx context.Context) ([]Show, error)
- func (c *Client) GetTrendingShows(ctx context.Context) ([]Show, error)
- func (c *Client) GetWatchlistShows(ctx context.Context, username string) ([]Show, error)
- func (c *Client) WithBaseURL(u string) *Client
- func (c *Client) WithHTTPClient(hc *http.Client) *Client
- type Show
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) GetCustomListShows ¶
GetCustomListShows fetches a user's custom list items (TV shows only).
func (*Client) GetPopularShows ¶
GetPopularShows fetches Trakt's popular TV shows list.
func (*Client) GetTrendingShows ¶
GetTrendingShows fetches Trakt's trending TV shows (most watched right now).
func (*Client) GetWatchlistShows ¶
GetWatchlistShows fetches a user's TV show watchlist.
func (*Client) WithBaseURL ¶
WithBaseURL overrides the API base URL. Intended for tests only.