Documentation ¶
Overview ¶
Package tvdb a simple interface to thetvdb.com REST API
Copyright 2016 Lorenzo Giuliani <lorenzo@frenzart.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const (
// Version of the client
Version = "0.1.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Authentication configuration Auth *Auth // Services Search *SearchService Series *SeriesService Episodes *EpisodesService Token *TokenService // contains filtered or unexported fields }
Client is the TvDB REST API client
type Episode ¶
type Episode struct { ID int32 `json:"id,omitempty"` AiredSeason int32 `json:"airedSeason,omitempty"` AiredEpisodeNumber int32 `json:"airedEpisodeNumber,omitempty"` EpisodeName string `json:"episodeName,omitempty"` FirstAired string `json:"firstAired,omitempty"` GuestStars []string `json:"guestStars,omitempty"` Director string `json:"director,omitempty"` Directors []string `json:"directors,omitempty"` Writers []string `json:"writers,omitempty"` Overview string `json:"overview,omitempty"` ProductionCode string `json:"productionCode,omitempty"` ShowURL string `json:"showUrl,omitempty"` LastUpdated int32 `json:"lastUpdated,omitempty"` DvdDiscid string `json:"dvdDiscid,omitempty"` DvdSeason int32 `json:"dvdSeason,omitempty"` DvdEpisodeNumber float32 `json:"dvdEpisodeNumber,omitempty"` DvdChapter float32 `json:"dvdChapter,omitempty"` AbsoluteNumber int32 `json:"absoluteNumber,omitempty"` Filename string `json:"filename,omitempty"` SeriesID string `json:"seriesId,omitempty"` LastUpdatedBy string `json:"lastUpdatedBy,omitempty"` AirsAfterSeason int32 `json:"airsAfterSeason,omitempty"` AirsBeforeSeason int32 `json:"airsBeforeSeason,omitempty"` AirsBeforeEpisode int32 `json:"airsBeforeEpisode,omitempty"` ThumbAuthor int32 `json:"thumbAuthor,omitempty"` ThumbAdded string `json:"thumbAdded,omitempty"` ThumbWidth string `json:"thumbWidth,omitempty"` ThumbHeight string `json:"thumbHeight,omitempty"` ImdbID string `json:"imdbId,omitempty"` SiteRating float32 `json:"siteRating,omitempty"` SiteRatingCount int32 `json:"siteRatingCount,omitempty"` }
Episode a single episode
type EpisodeRecordData ¶
type EpisodeRecordData struct { Data Episode `json:"data,omitempty"` Errors JSONError `json:"jsonError,omitempty"` }
EpisodeRecordData Searches results
type EpisodesService ¶
type EpisodesService struct {
// contains filtered or unexported fields
}
EpisodesService the episode service
type JSONError ¶
type JSONError struct {
Message string `json:"error,omitempty"`
}
JSONError is a generic type for errors
type SearchParams ¶
type SearchParams struct { Name *string `url:"name,omitempty"` ImdbID *string `url:"imdbId,omitempty"` Zap2itID *string `url:"zap2itId,omitempty"` }
SearchParams all optional search parameters
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
SearchService provides an interface to the search engine
func (*SearchService) ByImdbID ¶
func (s *SearchService) ByImdbID(id string) ([]SeriesSearchData, error)
ByImdbID Search by IMDB id
func (*SearchService) ByName ¶
func (s *SearchService) ByName(name string) ([]SeriesSearchData, error)
ByName Search series by name
func (*SearchService) ByZap2itID ¶
func (s *SearchService) ByZap2itID(id string) ([]SeriesSearchData, error)
ByZap2itID Search by Zap2it id
func (*SearchService) Search ¶
func (s *SearchService) Search(params *SearchParams) ([]SeriesSearchData, error)
Search search by SearchParams
type Series ¶
type Series struct { ID int32 `json:"id"` SeriesName string `json:"seriesName"` Aliases []string `json:"aliases,omitempty"` Banner string `json:"banner,omitempty"` SeriesID string `json:"seriesId,omitempty"` Status string `json:"status,omitempty"` FirstAired string `json:"firstAired,omitempty"` Network string `json:"network,omitempty"` NetworkID string `json:"networkId,omitempty"` Runtime string `json:"runtime,omitempty"` Genre []string `json:"genre,omitempty"` Overview string `json:"overview,omitempty"` LastUpdated int32 `json:"lastUpdated,omitempty"` AirsDayOfWeek string `json:"airsDayOfWeek,omitempty"` AirsTime string `json:"airsTime,omitempty"` Rating string `json:"rating,omitempty"` ImdbID string `json:"imdbId,omitempty"` Zap2itID string `json:"zap2itId,omitempty"` Added string `json:"added,omitempty"` SiteRating float32 `json:"siteRating,omitempty"` SiteRatingCount int32 `json:"siteRatingCount,omitempty"` }
Series type
type SeriesData ¶
type SeriesData struct { Data Series `json:"data,omitempty"` Errors []JSONError `json:"errors,omitempty"` }
SeriesData response container
type SeriesSearchData ¶
type SeriesSearchData struct { ID int32 `json:"id,omitempty"` Aliases []string `json:"aliases,omitempty"` Banner string `json:"banner,omitempty"` FirstAired string `json:"firstAired,omitempty"` Network string `json:"network,omitempty"` Overview string `json:"overview,omitempty"` SeriesName string `json:"seriesName,omitempty"` Status string `json:"status,omitempty"` }
SeriesSearchData type definition of search results
type SeriesSearchResults ¶
type SeriesSearchResults struct {
Data *[]SeriesSearchData `json:"data,omitempty"`
}
SeriesSearchResults contains search results
type SeriesService ¶
type SeriesService struct {
// contains filtered or unexported fields
}
SeriesService TV Series service
type TokenService ¶
TokenService tv series service
func (*TokenService) Login ¶
func (s *TokenService) Login() (Token, error)
Login requests and applies a new Token to the base client