Documentation
¶
Overview ¶
Package internal used for client and services
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services ¶
Package internal used for client and services
Index ¶
- Constants
- type AbuseRateLimitError
- type CalendarsService
- func (c *CalendarsService) GetDVDReleases(ctx context.Context, actionType *string, startDate *string, days *int, ...) ([]*str.CalendarList, *str.Response, error)
- func (c *CalendarsService) GetFinales(ctx context.Context, actionType *string, startDate *string, days *int, ...) ([]*str.CalendarList, *str.Response, error)
- func (c *CalendarsService) GetMovies(ctx context.Context, actionType *string, startDate *string, days *int, ...) ([]*str.CalendarList, *str.Response, error)
- func (c *CalendarsService) GetNewShows(ctx context.Context, actionType *string, startDate *string, days *int, ...) ([]*str.CalendarList, *str.Response, error)
- func (c *CalendarsService) GetSeasonPremieres(ctx context.Context, actionType *string, startDate *string, days *int, ...) ([]*str.CalendarList, *str.Response, error)
- func (c *CalendarsService) GetShows(ctx context.Context, actionType *string, startDate *string, days *int, ...) ([]*str.CalendarList, *str.Response, error)
- type CertificationsService
- type CheckinService
- type Client
- func (c *Client) BareDo(ctx context.Context, req *http.Request) (*str.Response, error)
- func (c *Client) CheckResponse(r *http.Response) error
- func (c *Client) CheckRetryAfter(req *http.Request) *AbuseRateLimitError
- func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*str.Response, error)
- func (*Client) HavePages(page int, resp *str.Response, limit int) bool
- func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error)
- func (c *Client) NewResponse(r *http.Response) *str.Response
- func (*Client) ParseRate(r *http.Response) str.Rate
- func (*Client) ParseRateLimit(r *http.Response) *time.Duration
- func (*Client) ParseUpgradeUser(r *http.Response) *url.URL
- func (c *Client) UpdateHeaders(headers map[string]any)
- func (*Client) WithContext(ctx context.Context, req *http.Request) *http.Request
- type CommentsService
- func (c *CommentsService) DeleteComment(ctx context.Context, id *int) (*str.Response, error)
- func (c *CommentsService) GetComment(ctx context.Context, id *int) (*str.Comment, *str.Response, error)
- func (c *CommentsService) GetCommentItem(ctx context.Context, id *int, opts *uri.ListOptions) (*str.CommentMediaItem, *str.Response, error)
- func (c *CommentsService) GetCommentUserLikes(ctx context.Context, id *int, opts *uri.ListOptions) ([]*str.CommentUserLike, *str.Response, error)
- func (c *CommentsService) GetRecentComments(ctx context.Context, contentType *string, strType *string, ...) ([]*str.CommentItem, *str.Response, error)
- func (c *CommentsService) GetRepliesForComment(ctx context.Context, opts *uri.ListOptions, id *int) ([]*str.Comment, *str.Response, error)
- func (c *CommentsService) GetTrendingComments(ctx context.Context, contentType *string, strType *string, ...) ([]*str.CommentItem, *str.Response, error)
- func (c *CommentsService) GetUpdatedComments(ctx context.Context, contentType *string, strType *string, ...) ([]*str.CommentItem, *str.Response, error)
- func (c *CommentsService) LikeComment(ctx context.Context, id *int) (*str.Response, error)
- func (c *CommentsService) PostAComment(ctx context.Context, comment *str.Comment) (*str.Comment, *str.Response, error)
- func (c *CommentsService) RemoveLikeComment(ctx context.Context, id *int) (*str.Response, error)
- func (c *CommentsService) ReplyAComment(ctx context.Context, id *int, reply *str.Comment) (*str.Comment, *str.Response, error)
- func (c *CommentsService) UpdateComment(ctx context.Context, id *int, comment *str.Comment) (*str.Comment, *str.Response, error)
- type ConflictError
- type CountriesService
- type EpisodesService
- type GenresService
- type LanguagesService
- type ListsService
- func (l *ListsService) GetAllUsersWhoLikedList(ctx context.Context, opts *uri.ListOptions, id *int) ([]*str.UserLike, *str.Response, error)
- func (l *ListsService) GetList(ctx context.Context, id *int) (*str.PersonalList, *str.Response, error)
- func (l *ListsService) GetListComments(ctx context.Context, id *int, sort *string, opts *uri.ListOptions) ([]*str.ListComment, *str.Response, error)
- func (l *ListsService) GetListItems(ctx context.Context, id *int, t *string, opts *uri.ListOptions) ([]*str.UserListItem, *str.Response, error)
- func (l *ListsService) GetPopularLists(ctx context.Context, opts *uri.ListOptions) ([]*str.List, *str.Response, error)
- func (l *ListsService) GetTrendingLists(ctx context.Context, opts *uri.ListOptions) ([]*str.List, *str.Response, error)
- func (l *ListsService) LikeList(ctx context.Context, id *int) (*str.Response, error)
- func (l *ListsService) RemoveLikeList(ctx context.Context, id *int) (*str.Response, error)
- type MoviesService
- type NotFoundError
- type OauthService
- func (o *OauthService) ExchangeRefreshTokenForAccessToken(ctx context.Context, deviceToken *str.CurrentDeviceToken) (*str.DeviceToken, *str.Response, error)
- func (o *OauthService) GenerateNewDeviceCodes(ctx context.Context, code *str.NewDeviceCode) (*str.DeviceCode, *str.Response, error)
- func (o *OauthService) PoolForTheAccessToken(ctx context.Context, deviceToken *str.NewDeviceToken) (*str.DeviceToken, *str.Response, error)
- type PeopleService
- func (p *PeopleService) GetListsContainingThisPerson(ctx context.Context, id *string, typeString *string, sort *string, ...) ([]*str.PersonalList, *str.Response, error)
- func (p *PeopleService) GetMovieCredits(ctx context.Context, id *string, opts *uri.ListOptions) (*str.PersonMovies, *str.Response, error)
- func (p *PeopleService) GetRecentlyUpdatedPeople(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*str.PersonItem, *str.Response, error)
- func (p *PeopleService) GetRecentlyUpdatedPeopleTraktIDs(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*int, *str.Response, error)
- func (p *PeopleService) GetShowCredits(ctx context.Context, id *string, opts *uri.ListOptions) (*str.PersonShows, *str.Response, error)
- func (p *PeopleService) GetSinglePerson(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Person, *str.Response, error)
- func (p *PeopleService) RefreshPersonMetadata(ctx context.Context, id *string) (*str.Response, error)
- type RequestOption
- type SearchService
- func (s *SearchService) GetIDLookupResults(ctx context.Context, formatType *string, id *string, opts *uri.ListOptions) ([]*str.SearchListItem, *str.Response, error)
- func (s *SearchService) GetTextQueryResults(ctx context.Context, searchType *string, opts *uri.ListOptions) ([]*str.SearchListItem, *str.Response, error)
- type SeasonsService
- type Service
- type ShowsService
- type SyncService
- func (s *SyncService) GetCollection(ctx context.Context, types *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)
- func (s *SyncService) GetWatchedHistory(ctx context.Context, types *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)
- func (s *SyncService) GetWatchlist(ctx context.Context, types *string, sort *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)
- type UpgradeRequiredError
- type UsersService
- func (u *UsersService) GetItemstOnAPersonalList(ctx context.Context, id *string, listID *string, t *string) ([]*str.UserListItem, *str.Response, error)
- func (u *UsersService) GetSavedFilters(ctx context.Context, section *string) ([]*str.SavedFilter, *str.Response, error)
- func (u *UsersService) GetStats(ctx context.Context, id *string) (*str.UserStats, *str.Response, error)
- func (u *UsersService) GetUserProfile(ctx context.Context, id *string) (*str.UserProfile, *str.Response, error)
- func (u *UsersService) GetUsersPersonalLists(ctx context.Context, id *string) ([]*str.PersonalList, *str.Response, error)
- func (u *UsersService) GetWatched(ctx context.Context, id *string, watchType *string, opts *uri.ListOptions) ([]*str.UserWatched, *str.Response, error)
- func (u *UsersService) RetrieveSettings(ctx context.Context) (*str.UserSettings, *str.Response, error)
- type ValidationError
Constants ¶
const ( Version = "2" HeaderRateLimit = "X-RateLimit" HeaderRetryAfter = "Retry-After" HeaderPaginationPage = "X-Pagination-Page" HeaderPaginationPageCount = "X-Pagination-Page-Count" HeaderUpgradeURL = "X-Upgrade-URL" )
basic consts for client
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbuseRateLimitError ¶
type AbuseRateLimitError struct {
Response *http.Response
RetryAfter *time.Duration
Message string `json:"message"`
}
AbuseRateLimitError occurs when trakt.tv returns 429 too many requests header
func (*AbuseRateLimitError) Error ¶
func (r *AbuseRateLimitError) Error() string
type CalendarsService ¶
type CalendarsService Service
CalendarsService handles communication with the calendars related methods of the Trakt API.
func (*CalendarsService) GetDVDReleases ¶
func (c *CalendarsService) GetDVDReleases(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)
GetDVDReleases Returns all movies with a DVD release date during the time period specified.
API docs: https://trakt.docs.apiary.io/#reference/calendars/my-dvd/get-dvd-releases API docs: https://trakt.docs.apiary.io/#reference/calendars/all-dvd/get-dvd-releases
func (*CalendarsService) GetFinales ¶
func (c *CalendarsService) GetFinales(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)
GetFinales Returns all show finales (mid_season_finale, season_finale, series_finale) airing during the time period specified.
API docs: https://trakt.docs.apiary.io/#reference/calendars/my-finales/get-finales API docs: https://trakt.docs.apiary.io/#reference/calendars/all-finales/get-finales
func (*CalendarsService) GetMovies ¶
func (c *CalendarsService) GetMovies(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)
GetMovies Returns all movies with a release date during the time period specified.
API docs: https://trakt.docs.apiary.io/#reference/calendars/my-movies/get-movies API docs: https://trakt.docs.apiary.io/#reference/calendars/all-movies/get-movies
func (*CalendarsService) GetNewShows ¶
func (c *CalendarsService) GetNewShows(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)
GetNewShows Returns all new show premieres airing during the time period specified.
API docs: https://trakt.docs.apiary.io/#reference/calendars/my-new-shows/get-new-shows API docs: https://trakt.docs.apiary.io/#reference/calendars/all-new-shows/get-new-shows
func (*CalendarsService) GetSeasonPremieres ¶
func (c *CalendarsService) GetSeasonPremieres(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)
GetSeasonPremieres Returns all show premieres (mid_season_premiere, season_premiere, series_premiere) airing during the time period specified.
API docs: https://trakt.docs.apiary.io/#reference/calendars/my-season-premieres/get-season-premieres API docs: https://trakt.docs.apiary.io/#reference/calendars/all-season-premieres/get-season-premieres
func (*CalendarsService) GetShows ¶
func (c *CalendarsService) GetShows(ctx context.Context, actionType *string, startDate *string, days *int, opts *uri.ListOptions) ([]*str.CalendarList, *str.Response, error)
GetShows Returns all shows airing during the time period specified.
API docs: https://trakt.docs.apiary.io/#reference/calendars/my-shows/get-shows API docs: https://trakt.docs.apiary.io/#reference/calendars/all-shows/get-shows
type CertificationsService ¶ added in v1.6.0
type CertificationsService Service
CertificationsService handles communication with the certifications related methods of the Trakt API.
func (*CertificationsService) GetCertifications ¶ added in v1.6.0
func (c *CertificationsService) GetCertifications(ctx context.Context, strType *string) (*str.Certifications, *str.Response, error)
GetCertifications Get a list of all certifications, including names, slugs, and descriptions.
API docs: https://trakt.docs.apiary.io/#reference/certifications/list/get-certifications
type CheckinService ¶ added in v1.5.0
type CheckinService Service
CheckinService handles communication with the checkin related methods of the Trakt API.
func (*CheckinService) CheckintoAnItem ¶ added in v1.5.0
func (c *CheckinService) CheckintoAnItem(ctx context.Context, checkin *str.CheckIn) (*str.CheckIn, *str.Response, error)
CheckintoAnItem Check into a movie or episode.
API docs: https://trakt.docs.apiary.io/#reference/checkin/checkin/check-into-an-item
func (*CheckinService) DeleteAnyActiveCheckins ¶ added in v1.5.0
DeleteAnyActiveCheckins Removes any active checkins, no need to provide a specific item.
API docs: https://trakt.docs.apiary.io/#reference/checkin/checkin/delete-any-active-checkins
type Client ¶
type Client struct {
RateLimitReset time.Time
BaseURL *url.URL
UpgradeURL *url.URL
Oauth *OauthService
Users *UsersService
Sync *SyncService
People *PeopleService
Calendars *CalendarsService
Certifications *CertificationsService
Countries *CountriesService
Checkin *CheckinService
Comments *CommentsService
Genres *GenresService
Search *SearchService
Languages *LanguagesService
Lists *ListsService
Movies *MoviesService
Episodes *EpisodesService
Shows *ShowsService
Seasons *SeasonsService
// contains filtered or unexported fields
}
A Client manages communication with the trakt.tv API.
func NewClient ¶
NewClient returns a new API client. If a nil httpClient is provided, a new http.Client will be used.
func (*Client) CheckResponse ¶
CheckResponse checks if api response have errors.
func (*Client) CheckRetryAfter ¶
func (c *Client) CheckRetryAfter(req *http.Request) *AbuseRateLimitError
CheckRetryAfter check Retry After header.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error)
NewRequest creates an API request.
func (*Client) NewResponse ¶
NewResponse creates a new Response for the provided http.Response. r must not be nil.
func (*Client) ParseRateLimit ¶
ParseRateLimit parses related headers, and returns the time to retry after.
func (*Client) ParseUpgradeUser ¶ added in v1.1.0
ParseUpgradeUser parses related headers, and returns upgradeUrl.
func (*Client) UpdateHeaders ¶
UpdateHeaders is for update client headers map
type CommentsService ¶ added in v1.6.0
type CommentsService Service
CommentsService handles communication with the comments related methods of the Trakt API.
func (*CommentsService) DeleteComment ¶ added in v1.6.0
DeleteComment to delete a single comment. API docs: https://trakt.docs.apiary.io/#reference/comments/comment/delete-a-comment-or-reply
func (*CommentsService) GetComment ¶ added in v1.6.0
func (c *CommentsService) GetComment(ctx context.Context, id *int) (*str.Comment, *str.Response, error)
GetComment Returns comment object.
func (*CommentsService) GetCommentItem ¶ added in v1.6.0
func (c *CommentsService) GetCommentItem(ctx context.Context, id *int, opts *uri.ListOptions) (*str.CommentMediaItem, *str.Response, error)
GetCommentItem Returns comment media item object. API docs: https://trakt.docs.apiary.io/#reference/comments/item/get-the-attached-media-item
func (*CommentsService) GetCommentUserLikes ¶ added in v1.6.0
func (c *CommentsService) GetCommentUserLikes(ctx context.Context, id *int, opts *uri.ListOptions) ([]*str.CommentUserLike, *str.Response, error)
GetCommentUserLikes Returns all users who liked a comment. API docs: https://trakt.docs.apiary.io/#reference/comments/item/get-all-users-who-liked-a-comment
func (*CommentsService) GetRecentComments ¶ added in v1.6.0
func (c *CommentsService) GetRecentComments(ctx context.Context, contentType *string, strType *string, opts *uri.ListOptions) ([]*str.CommentItem, *str.Response, error)
GetRecentComments Returns the most recently written comments across all of Trakt. API docs: https://trakt.docs.apiary.io/#reference/comments/recent/get-recently-created-comments
func (*CommentsService) GetRepliesForComment ¶ added in v1.6.0
func (c *CommentsService) GetRepliesForComment(ctx context.Context, opts *uri.ListOptions, id *int) ([]*str.Comment, *str.Response, error)
GetRepliesForComment Returns all replies for a comment. API docs: https://trakt.docs.apiary.io/#reference/comments/replies/get-replies-for-a-comment
func (*CommentsService) GetTrendingComments ¶ added in v1.6.0
func (c *CommentsService) GetTrendingComments(ctx context.Context, contentType *string, strType *string, opts *uri.ListOptions) ([]*str.CommentItem, *str.Response, error)
GetTrendingComments Returns all comments with the most likes and replies over the last 7 days. API docs: https://trakt.docs.apiary.io/#reference/comments/trending/get-trending-comments
func (*CommentsService) GetUpdatedComments ¶ added in v1.6.0
func (c *CommentsService) GetUpdatedComments(ctx context.Context, contentType *string, strType *string, opts *uri.ListOptions) ([]*str.CommentItem, *str.Response, error)
GetUpdatedComments Returns the most recently updated comments across all of Trakt. API docs: https://trakt.docs.apiary.io/#reference/comments/updates/get-recently-updated-comments
func (*CommentsService) LikeComment ¶ added in v1.6.0
LikeComment Votes help determine popular comments. Only one like is allowed per comment per user.
API docs: https://trakt.docs.apiary.io/#reference/comments/like/like-a-comment
func (*CommentsService) PostAComment ¶ added in v1.6.0
func (c *CommentsService) PostAComment(ctx context.Context, comment *str.Comment) (*str.Comment, *str.Response, error)
PostAComment Add a new comment to a movie, show, season, episode, or list.
API docs:https://trakt.docs.apiary.io/#reference/comments/comments/post-a-comment
func (*CommentsService) RemoveLikeComment ¶ added in v1.6.0
RemoveLikeComment Remove a like on a comment.
API docs: https://trakt.docs.apiary.io/#reference/comments/like/remove-like-on-a-comment
func (*CommentsService) ReplyAComment ¶ added in v1.6.0
func (c *CommentsService) ReplyAComment(ctx context.Context, id *int, reply *str.Comment) (*str.Comment, *str.Response, error)
ReplyAComment Add a new reply to an existing comment. API docs:https://trakt.docs.apiary.io/#reference/comments/replies/post-a-reply-for-a-comment
func (*CommentsService) UpdateComment ¶ added in v1.6.0
func (c *CommentsService) UpdateComment(ctx context.Context, id *int, comment *str.Comment) (*str.Comment, *str.Response, error)
UpdateComment to update a single comment. API docs: https://trakt.docs.apiary.io/#reference/comments/comment/update-a-comment-or-reply
type ConflictError ¶ added in v1.5.0
ConflictError occurs when trakt.tv returns 409 error
func (*ConflictError) Error ¶ added in v1.5.0
func (r *ConflictError) Error() string
type CountriesService ¶ added in v1.7.0
type CountriesService Service
CountriesService handles communication with the countries related methods of the Trakt API.
func (*CountriesService) GetCountries ¶ added in v1.7.0
func (c *CountriesService) GetCountries(ctx context.Context, strType *string) ([]*str.Country, *str.Response, error)
GetCountries Get a list of all countries, including names and codes.
API docs: https://trakt.docs.apiary.io/#reference/countries/list/get-countries
type EpisodesService ¶ added in v1.5.0
type EpisodesService Service
EpisodesService handles communication with the episodes related methods of the Trakt API.
func (*EpisodesService) GetEpisode ¶ added in v1.5.0
func (m *EpisodesService) GetEpisode(ctx context.Context, id *int) (*str.Episode, *str.Response, error)
GetEpisode Returns episode object.
func (*EpisodesService) GetSingleEpisodeForShow ¶ added in v1.5.0
func (m *EpisodesService) GetSingleEpisodeForShow(ctx context.Context, id *int, season *int, episode *int) (*str.Episode, *str.Response, error)
GetSingleEpisodeForShow Returns a single episode's details.
API docs: https://trakt.docs.apiary.io/#reference/episodes/summary/get-a-single-episode-for-a-show
type GenresService ¶ added in v1.7.0
type GenresService Service
GenresService handles communication with the genres related methods of the Trakt API.
type LanguagesService ¶ added in v1.7.0
type LanguagesService Service
LanguagesService handles communication with the languages related methods of the Trakt API.
func (*LanguagesService) GetLanguages ¶ added in v1.7.0
func (g *LanguagesService) GetLanguages(ctx context.Context, strType *string) ([]*str.Language, *str.Response, error)
GetLanguages Get a list of all languages, including names and codes.
API docs: https://trakt.docs.apiary.io/#reference/languages/list/get-languages
type ListsService ¶ added in v1.4.0
type ListsService Service
ListsService handles communication with the lists related methods of the Trakt API.
func (*ListsService) GetAllUsersWhoLikedList ¶ added in v1.4.0
func (l *ListsService) GetAllUsersWhoLikedList(ctx context.Context, opts *uri.ListOptions, id *int) ([]*str.UserLike, *str.Response, error)
GetAllUsersWhoLikedList Returns all users who liked a list.
API docs: https://trakt.docs.apiary.io/#reference/lists/list-likes/get-all-users-who-liked-a-list
func (*ListsService) GetList ¶ added in v1.4.0
func (l *ListsService) GetList(ctx context.Context, id *int) (*str.PersonalList, *str.Response, error)
GetList Returns a single list. Use the /lists/:id/items method to get the actual items this list contains.
API docs: https://trakt.docs.apiary.io/#reference/lists/list/get-list
func (*ListsService) GetListComments ¶ added in v1.4.0
func (l *ListsService) GetListComments(ctx context.Context, id *int, sort *string, opts *uri.ListOptions) ([]*str.ListComment, *str.Response, error)
GetListComments Returns comments from single list.
API docs: https://trakt.docs.apiary.io/#reference/lists/list-comments/get-all-list-comments
func (*ListsService) GetListItems ¶ added in v1.4.0
func (l *ListsService) GetListItems(ctx context.Context, id *int, t *string, opts *uri.ListOptions) ([]*str.UserListItem, *str.Response, error)
GetListItems Returns items from single list.
API docs: https://trakt.docs.apiary.io/#reference/lists/list-items/get-items-on-a-list
func (*ListsService) GetPopularLists ¶ added in v1.4.0
func (l *ListsService) GetPopularLists(ctx context.Context, opts *uri.ListOptions) ([]*str.List, *str.Response, error)
GetPopularLists Returns the most popular lists. Popularity is calculated using total number of likes and comments..
API docs: https://trakt.docs.apiary.io/#reference/lists/popular/get-popular-lists
func (*ListsService) GetTrendingLists ¶ added in v1.4.0
func (l *ListsService) GetTrendingLists(ctx context.Context, opts *uri.ListOptions) ([]*str.List, *str.Response, error)
GetTrendingLists Returns all lists with the most likes and comments over the last 7 days.
API docs: https://trakt.docs.apiary.io/#reference/lists/trending/get-trending-lists
func (*ListsService) LikeList ¶ added in v1.4.0
LikeList Votes help determine popular lists. Only one like is allowed per list per user.
API docs: https://trakt.docs.apiary.io/#reference/lists/list-like/like-a-list
func (*ListsService) RemoveLikeList ¶ added in v1.4.0
RemoveLikeList Remove a like on a list.
API docs: https://trakt.docs.apiary.io/#reference/lists/list-like/remove-like-on-a-list
type MoviesService ¶ added in v1.5.0
type MoviesService Service
MoviesService handles communication with the movies related methods of the Trakt API.
type NotFoundError ¶ added in v1.4.0
NotFoundError occurs when trakt.tv returns 404 error
func (*NotFoundError) Error ¶ added in v1.4.0
func (r *NotFoundError) Error() string
type OauthService ¶
type OauthService Service
OauthService handles communication with the oauth related methods of the Trakt API.
API docs: https://trakt.docs.apiary.io/#reference/authentication-oauth
func (*OauthService) ExchangeRefreshTokenForAccessToken ¶
func (o *OauthService) ExchangeRefreshTokenForAccessToken(ctx context.Context, deviceToken *str.CurrentDeviceToken) (*str.DeviceToken, *str.Response, error)
ExchangeRefreshTokenForAccessToken Use the refresh_token to get a new access_token without asking the user to re-authenticate. The access_token is valid for 3 months before it needs to be refreshed again.
func (*OauthService) GenerateNewDeviceCodes ¶
func (o *OauthService) GenerateNewDeviceCodes(ctx context.Context, code *str.NewDeviceCode) (*str.DeviceCode, *str.Response, error)
GenerateNewDeviceCodes Generate new codes to start the device authentication process.
API docs: https://trakt.docs.apiary.io/#reference/authentication-devices/device-code/generate-new-device-codes
func (*OauthService) PoolForTheAccessToken ¶
func (o *OauthService) PoolForTheAccessToken(ctx context.Context, deviceToken *str.NewDeviceToken) (*str.DeviceToken, *str.Response, error)
PoolForTheAccessToken Use the device_code and poll at the interval (in seconds) to check if the user has authorized you app.
API docs: https://trakt.docs.apiary.io/#reference/authentication-devices/get-token/poll-for-the-access_token
type PeopleService ¶
type PeopleService Service
PeopleService handles communication with the people related methods of the Trakt API.
func (*PeopleService) GetListsContainingThisPerson ¶
func (p *PeopleService) GetListsContainingThisPerson(ctx context.Context, id *string, typeString *string, sort *string, opts *uri.ListOptions) ([]*str.PersonalList, *str.Response, error)
GetListsContainingThisPerson Returns all lists that contain this person.
API docs: https://trakt.docs.apiary.io/#reference/people/lists/get-lists-containing-this-person
func (*PeopleService) GetMovieCredits ¶
func (p *PeopleService) GetMovieCredits(ctx context.Context, id *string, opts *uri.ListOptions) (*str.PersonMovies, *str.Response, error)
GetMovieCredits Returns all movies where this person is in the cast or crew.
API docs: https://trakt.docs.apiary.io/#reference/people/movies/get-movie-credits
func (*PeopleService) GetRecentlyUpdatedPeople ¶
func (p *PeopleService) GetRecentlyUpdatedPeople(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*str.PersonItem, *str.Response, error)
GetRecentlyUpdatedPeople Returns all people updated since the specified UTC date and time.
API docs: https://trakt.docs.apiary.io/#reference/people/updates/get-recently-updated-people
func (*PeopleService) GetRecentlyUpdatedPeopleTraktIDs ¶
func (p *PeopleService) GetRecentlyUpdatedPeopleTraktIDs(ctx context.Context, startDate *string, opts *uri.ListOptions) ([]*int, *str.Response, error)
GetRecentlyUpdatedPeopleTraktIDs Returns all people Trakt IDs updated since the specified UTC date and time.
API docs: https://trakt.docs.apiary.io/#reference/people/updated-ids
func (*PeopleService) GetShowCredits ¶
func (p *PeopleService) GetShowCredits(ctx context.Context, id *string, opts *uri.ListOptions) (*str.PersonShows, *str.Response, error)
GetShowCredits Returns all shows where this person is in the cast or crew, including the episode_count for which they appear.
API docs: https://trakt.docs.apiary.io/#reference/people/shows/get-show-credits
func (*PeopleService) GetSinglePerson ¶
func (p *PeopleService) GetSinglePerson(ctx context.Context, id *string, opts *uri.ListOptions) (*str.Person, *str.Response, error)
GetSinglePerson Returns a single person's details.
API docs: https://trakt.docs.apiary.io/#reference/people/summary/get-a-single-person
func (*PeopleService) RefreshPersonMetadata ¶ added in v1.5.0
func (p *PeopleService) RefreshPersonMetadata(ctx context.Context, id *string) (*str.Response, error)
RefreshPersonMetadata Queue this person for a full metadata and image refresh. It might take up to 8 hours for the updated metadata to be availabe through the API.
API docs: https://trakt.docs.apiary.io/#reference/people/refresh/refresh-person-metadata
type RequestOption ¶
RequestOption represents an option that can modify an http.Request.
type SearchService ¶
type SearchService Service
SearchService handles communication with the search related methods of the Trakt API.
func (*SearchService) GetIDLookupResults ¶
func (s *SearchService) GetIDLookupResults(ctx context.Context, formatType *string, id *string, opts *uri.ListOptions) ([]*str.SearchListItem, *str.Response, error)
GetIDLookupResults Lookup items by their Trakt, IMDB, TMDB, or TVDB ID. If you use the search url without a type it might return multiple items if the id_type is not globally unique. Specify the type of results by sending a single value or a comma delimited string for multiple types.
API docs: https://trakt.docs.apiary.io/#reference/search/id-lookup/get-id-lookup-results
func (*SearchService) GetTextQueryResults ¶
func (s *SearchService) GetTextQueryResults(ctx context.Context, searchType *string, opts *uri.ListOptions) ([]*str.SearchListItem, *str.Response, error)
GetTextQueryResults Search all text fields that a media object contains (i.e. title, overview, etc). Results are ordered by the most relevant score. Specify the type of results by sending a single value or a comma delimited string for multiple types.
API docs: https://trakt.docs.apiary.io/#reference/search/text-query/get-text-query-results
type SeasonsService ¶ added in v1.6.0
type SeasonsService Service
SeasonsService handles communication with the seasons related methods of the Trakt API.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service structure for other services
type ShowsService ¶ added in v1.5.0
type ShowsService Service
ShowsService handles communication with the shows related methods of the Trakt API.
type SyncService ¶
type SyncService Service
SyncService handles communication with the sync related methods of the Trakt API.
func (*SyncService) GetCollection ¶
func (s *SyncService) GetCollection(ctx context.Context, types *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)
GetCollection Get all collected items in a user's collection.
API docs: https://trakt.docs.apiary.io/#reference/sync/get-collection/get-collection
func (*SyncService) GetWatchedHistory ¶
func (s *SyncService) GetWatchedHistory(ctx context.Context, types *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)
GetWatchedHistory Returns movies and episodes that a user has watched, sorted by most recent.
API docs: https://trakt.docs.apiary.io/#reference/sync/get-watched/get-watched-history
func (*SyncService) GetWatchlist ¶
func (s *SyncService) GetWatchlist(ctx context.Context, types *string, sort *string, opts *uri.ListOptions) ([]*str.ExportlistItem, *str.Response, error)
GetWatchlist Returns all items in a user's watchlist filtered by type.
API docs: https://trakt.docs.apiary.io/#reference/sync/get-watchlist/get-watchlist
type UpgradeRequiredError ¶ added in v1.1.0
type UpgradeRequiredError struct {
Response *http.Response
UpgradeURL *url.URL
Message string `json:"message"`
}
UpgradeRequiredError occurs when trakt.tv returns 426 user must upgrade to vip header
func (*UpgradeRequiredError) Error ¶ added in v1.1.0
func (r *UpgradeRequiredError) Error() string
type UsersService ¶
type UsersService Service
UsersService handles communication with the users related methods of the Trakt API.
func (*UsersService) GetItemstOnAPersonalList ¶
func (u *UsersService) GetItemstOnAPersonalList(ctx context.Context, id *string, listID *string, t *string) ([]*str.UserListItem, *str.Response, error)
GetItemstOnAPersonalList Get all items on a personal list.
API docs: https://trakt.docs.apiary.io/#reference/users/list-items/get-items-on-a-personal-list
func (*UsersService) GetSavedFilters ¶ added in v1.1.0
func (u *UsersService) GetSavedFilters(ctx context.Context, section *string) ([]*str.SavedFilter, *str.Response, error)
GetSavedFilters Get all saved filters a users has created.
API docs: https://trakt.docs.apiary.io/#reference/users/saved-filters/get-saved-filters
func (*UsersService) GetStats ¶ added in v1.2.0
func (u *UsersService) GetStats(ctx context.Context, id *string) (*str.UserStats, *str.Response, error)
GetStats Returns stats about the movies, shows, and episodes a user has watched, collected, and rated.
API docs:https://trakt.docs.apiary.io/#reference/users/stats/get-stats
func (*UsersService) GetUserProfile ¶
func (u *UsersService) GetUserProfile(ctx context.Context, id *string) (*str.UserProfile, *str.Response, error)
GetUserProfile Get a user's profile information.
API docs:https://trakt.docs.apiary.io/#reference/users/profile/get-user-profile
func (*UsersService) GetUsersPersonalLists ¶
func (u *UsersService) GetUsersPersonalLists(ctx context.Context, id *string) ([]*str.PersonalList, *str.Response, error)
GetUsersPersonalLists Returns all personal lists for a user.
API docs: https://trakt.docs.apiary.io/#reference/users/lists/get-a-user's-personal-lists
func (*UsersService) GetWatched ¶ added in v1.3.0
func (u *UsersService) GetWatched(ctx context.Context, id *string, watchType *string, opts *uri.ListOptions) ([]*str.UserWatched, *str.Response, error)
GetWatched Returns all movies or shows a user has watched sorted by most plays.
API docs:https://trakt.docs.apiary.io/#reference/users/watched/get-watched
func (*UsersService) RetrieveSettings ¶ added in v1.5.0
func (u *UsersService) RetrieveSettings(ctx context.Context) (*str.UserSettings, *str.Response, error)
RetrieveSettings Get the user's settings so you can align your app's experience with what they're used to on the trakt website.
API docs: https://trakt.docs.apiary.io/#reference/users/settings/retrieve-settings
type ValidationError ¶ added in v1.6.0
type ValidationError struct {
Response *http.Response
Message string `json:"message"`
Errors *str.Errors `json:"errors,omitempty"`
}
ValidationError occurs when trakt.tv returns 422 error
func (*ValidationError) Error ¶ added in v1.6.0
func (r *ValidationError) Error() string
Source Files
¶
- calendars_service.go
- certifications_service.go
- checkin_service.go
- client.go
- comments_service.go
- countries_service.go
- episodes_service.go
- genres_service.go
- languages_service.go
- lists_service.go
- movies_service.go
- oauth_service.go
- people_service.go
- search_service.go
- seasons_service.go
- service.go
- shows_service.go
- sync_service.go
- users_service.go