tvdb

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 4 Imported by: 2

README

dashotv/tvdb

TVDB API in Go

Build Status GoDoc Go Report Card License

Usage

Install the package with:

go get github.com/dashotv/tvdb

Import the package with:

import "github.com/dashotv/tvdb"

Create a new client with:

client := tvdb.New(apikey)

If you don't already have a token, you can obtain one with:

// Authenticate with your API key. This will return the token and
// will also configure the client with Bearer authentication.
token, err := client.Login()
if err != nil {
    // handle error
}

You should store the token somewhere, by default the token is viable for 30 days. TVDB doesn't appear to care if you auth every call, but it adds a lot of overhead.

If you already have the token, you can set it with:

client.SetToken(token)

This will configure the client with the token and configure Bearer authentication.

Development

Crate a local .env file with the following content:

# .env
TVDB_API_URL=https://api4.thetvdb.com/v4
TVDB_API_KEY=your_api_key
TVDB_API_TOKEN=your_api_token

Run the following to get the make targets:

make help


Usage:
  make <target>

Targets:
    clean               Remove build related file
  Test:
    test                Run the tests of the project
    coverage            Run the tests of the project and export the coverage
  Lint:
    lint                Run all available linters
    lint-go             Use golintci-lint on your project
  Help:
    help                Show this help.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Key   string
	Token string
	// contains filtered or unexported fields
}

func Login added in v0.1.1

func Login(apikey string) (*Client, error)

Login creates a new client by logging in with an apikey

func New

func New(apikey, token string) *Client

New creates a client with an existing token

func (*Client) GetAllArtworkStatuses

func (c *Client) GetAllArtworkStatuses(ctx context.Context) (*GetAllArtworkStatuses, error)

GetAllArtworkStatuses wraps the generated openapi.SDK client call

func (*Client) GetAllArtworkTypes

func (c *Client) GetAllArtworkTypes(ctx context.Context) (*GetAllArtworkTypes, error)

GetAllArtworkTypes wraps the generated openapi.SDK client call

func (*Client) GetAllAwards

func (c *Client) GetAllAwards(ctx context.Context) (*GetAllAwards, error)

GetAllAwards wraps the generated openapi.SDK client call

func (*Client) GetAllCompanies

func (c *Client) GetAllCompanies(page *float64) (*GetAllCompanies, error)

GetAllCompanies wraps the generated openapi.SDK client call

func (*Client) GetAllContentRatings

func (c *Client) GetAllContentRatings(ctx context.Context) (*GetAllContentRatings, error)

GetAllContentRatings wraps the generated openapi.SDK client call

func (*Client) GetAllCountries

func (c *Client) GetAllCountries(ctx context.Context) (*GetAllCountries, error)

GetAllCountries wraps the generated openapi.SDK client call

func (*Client) GetAllEpisodes

func (c *Client) GetAllEpisodes(page *float64) (*GetAllEpisodes, error)

GetAllEpisodes wraps the generated openapi.SDK client call

func (*Client) GetAllGenders

func (c *Client) GetAllGenders(ctx context.Context) (*GetAllGenders, error)

GetAllGenders wraps the generated openapi.SDK client call

func (*Client) GetAllGenres

func (c *Client) GetAllGenres(ctx context.Context) (*GetAllGenres, error)

GetAllGenres wraps the generated openapi.SDK client call

func (*Client) GetAllInspirationTypes

func (c *Client) GetAllInspirationTypes(ctx context.Context) (*GetAllInspirationTypes, error)

GetAllInspirationTypes wraps the generated openapi.SDK client call

func (*Client) GetAllLanguages

func (c *Client) GetAllLanguages(ctx context.Context) (*GetAllLanguages, error)

GetAllLanguages wraps the generated openapi.SDK client call

func (*Client) GetAllLists

func (c *Client) GetAllLists(page *float64) (*GetAllLists, error)

GetAllLists wraps the generated openapi.SDK client call

func (*Client) GetAllMovie

func (c *Client) GetAllMovie(page *float64) (*GetAllMovie, error)

GetAllMovie wraps the generated openapi.SDK client call

func (*Client) GetAllMovieStatuses

func (c *Client) GetAllMovieStatuses(ctx context.Context) (*GetAllMovieStatuses, error)

GetAllMovieStatuses wraps the generated openapi.SDK client call

func (*Client) GetAllPeople

func (c *Client) GetAllPeople(page *float64) (*GetAllPeople, error)

GetAllPeople wraps the generated openapi.SDK client call

func (*Client) GetAllPeopleTypes

func (c *Client) GetAllPeopleTypes(ctx context.Context) (*GetAllPeopleTypes, error)

GetAllPeopleTypes wraps the generated openapi.SDK client call

func (*Client) GetAllSeasons

func (c *Client) GetAllSeasons(page *float64) (*GetAllSeasons, error)

GetAllSeasons wraps the generated openapi.SDK client call

func (*Client) GetAllSeries

func (c *Client) GetAllSeries(page *float64) (*GetAllSeries, error)

GetAllSeries wraps the generated openapi.SDK client call

func (*Client) GetAllSeriesStatuses

func (c *Client) GetAllSeriesStatuses(ctx context.Context) (*GetAllSeriesStatuses, error)

GetAllSeriesStatuses wraps the generated openapi.SDK client call

func (*Client) GetAllSourceTypes

func (c *Client) GetAllSourceTypes(ctx context.Context) (*GetAllSourceTypes, error)

GetAllSourceTypes wraps the generated openapi.SDK client call

func (*Client) GetArtworkBase

func (c *Client) GetArtworkBase(id float64) (*GetArtworkBase, error)

GetArtworkBase wraps the generated openapi.SDK client call

func (*Client) GetArtworkExtended

func (c *Client) GetArtworkExtended(id float64) (*GetArtworkExtended, error)

GetArtworkExtended wraps the generated openapi.SDK client call

func (*Client) GetAward

func (c *Client) GetAward(id float64) (*GetAward, error)

GetAward wraps the generated openapi.SDK client call

func (*Client) GetAwardCategory

func (c *Client) GetAwardCategory(id float64) (*GetAwardCategory, error)

GetAwardCategory wraps the generated openapi.SDK client call

func (*Client) GetAwardCategoryExtended

func (c *Client) GetAwardCategoryExtended(id float64) (*GetAwardCategoryExtended, error)

GetAwardCategoryExtended wraps the generated openapi.SDK client call

func (*Client) GetAwardExtended

func (c *Client) GetAwardExtended(id float64) (*GetAwardExtended, error)

GetAwardExtended wraps the generated openapi.SDK client call

func (*Client) GetCharacterBase

func (c *Client) GetCharacterBase(id float64) (*GetCharacterBase, error)

GetCharacterBase wraps the generated openapi.SDK client call

func (*Client) GetCompany

func (c *Client) GetCompany(id float64) (*GetCompany, error)

GetCompany wraps the generated openapi.SDK client call

func (*Client) GetCompanyTypes

func (c *Client) GetCompanyTypes(ctx context.Context) (*GetCompanyTypes, error)

GetCompanyTypes wraps the generated openapi.SDK client call

func (*Client) GetEntityTypes

func (c *Client) GetEntityTypes(ctx context.Context) (*GetEntityTypes, error)

GetEntityTypes wraps the generated openapi.SDK client call

func (*Client) GetEpisodeBase

func (c *Client) GetEpisodeBase(id float64) (*GetEpisodeBase, error)

GetEpisodeBase wraps the generated openapi.SDK client call

func (*Client) GetEpisodeExtended

func (c *Client) GetEpisodeExtended(id float64, meta *operations.GetEpisodeExtendedMeta) (*GetEpisodeExtended, error)

GetEpisodeExtended wraps the generated openapi.SDK client call

func (*Client) GetEpisodeTranslation

func (c *Client) GetEpisodeTranslation(id float64, language string) (*GetEpisodeTranslation, error)

GetEpisodeTranslation wraps the generated openapi.SDK client call

func (*Client) GetGenreBase

func (c *Client) GetGenreBase(id float64) (*GetGenreBase, error)

GetGenreBase wraps the generated openapi.SDK client call

func (*Client) GetList

func (c *Client) GetList(id float64) (*GetList, error)

GetList wraps the generated openapi.SDK client call

func (*Client) GetListBySlug

func (c *Client) GetListBySlug(slug string) (*GetListBySlug, error)

GetListBySlug wraps the generated openapi.SDK client call

func (*Client) GetListExtended

func (c *Client) GetListExtended(id float64) (*GetListExtended, error)

GetListExtended wraps the generated openapi.SDK client call

func (*Client) GetListTranslation

func (c *Client) GetListTranslation(id float64, language string) (*GetListTranslation, error)

GetListTranslation wraps the generated openapi.SDK client call

func (*Client) GetMovieBase

func (c *Client) GetMovieBase(id float64) (*GetMovieBase, error)

GetMovieBase wraps the generated openapi.SDK client call

func (*Client) GetMovieBaseBySlug

func (c *Client) GetMovieBaseBySlug(slug string) (*GetMovieBaseBySlug, error)

GetMovieBaseBySlug wraps the generated openapi.SDK client call

func (*Client) GetMovieExtended

func (c *Client) GetMovieExtended(id float64, meta *operations.GetMovieExtendedMeta, short *bool) (*GetMovieExtended, error)

GetMovieExtended wraps the generated openapi.SDK client call

func (*Client) GetMovieTranslation

func (c *Client) GetMovieTranslation(id float64, language string) (*GetMovieTranslation, error)

GetMovieTranslation wraps the generated openapi.SDK client call

func (*Client) GetMoviesFilter

func (c *Client) GetMoviesFilter(request operations.GetMoviesFilterRequest) (*GetMoviesFilter, error)

GetMoviesFilter wraps the generated openapi.SDK client call

func (*Client) GetPeopleBase

func (c *Client) GetPeopleBase(id float64) (*GetPeopleBase, error)

GetPeopleBase wraps the generated openapi.SDK client call

func (*Client) GetPeopleExtended

func (c *Client) GetPeopleExtended(id float64, meta *operations.GetPeopleExtendedMeta) (*GetPeopleExtended, error)

GetPeopleExtended wraps the generated openapi.SDK client call

func (*Client) GetPeopleTranslation

func (c *Client) GetPeopleTranslation(id float64, language string) (*GetPeopleTranslation, error)

GetPeopleTranslation wraps the generated openapi.SDK client call

func (*Client) GetSearchResults

func (c *Client) GetSearchResults(request operations.GetSearchResultsRequest) (*GetSearchResults, error)

GetSearchResults wraps the generated openapi.SDK client call

func (*Client) GetSearchResultsByRemoteID added in v0.1.1

func (c *Client) GetSearchResultsByRemoteID(remoteID string) (*GetSearchResultsByRemoteID, error)

GetSearchResultsByRemoteID wraps the generated openapi.SDK client call

func (*Client) GetSeasonBase

func (c *Client) GetSeasonBase(id float64) (*GetSeasonBase, error)

GetSeasonBase wraps the generated openapi.SDK client call

func (*Client) GetSeasonExtended

func (c *Client) GetSeasonExtended(id float64) (*GetSeasonExtended, error)

GetSeasonExtended wraps the generated openapi.SDK client call

func (*Client) GetSeasonTranslation

func (c *Client) GetSeasonTranslation(id float64, language string) (*GetSeasonTranslation, error)

GetSeasonTranslation wraps the generated openapi.SDK client call

func (*Client) GetSeasonTypes

func (c *Client) GetSeasonTypes(ctx context.Context) (*GetSeasonTypes, error)

GetSeasonTypes wraps the generated openapi.SDK client call

func (*Client) GetSeriesArtworks

func (c *Client) GetSeriesArtworks(id float64, lang *string, type_ *int64) (*GetSeriesArtworks, error)

GetSeriesArtworks wraps the generated openapi.SDK client call

func (*Client) GetSeriesBase

func (c *Client) GetSeriesBase(id float64) (*GetSeriesBase, error)

GetSeriesBase wraps the generated openapi.SDK client call

func (*Client) GetSeriesBaseBySlug

func (c *Client) GetSeriesBaseBySlug(slug string) (*GetSeriesBaseBySlug, error)

GetSeriesBaseBySlug wraps the generated openapi.SDK client call

func (*Client) GetSeriesEpisodes

func (c *Client) GetSeriesEpisodes(request operations.GetSeriesEpisodesRequest) (*GetSeriesEpisodes, error)

GetSeriesEpisodes wraps the generated openapi.SDK client call

func (*Client) GetSeriesExtended

func (c *Client) GetSeriesExtended(id float64, meta *operations.GetSeriesExtendedMeta, short *bool) (*GetSeriesExtended, error)

GetSeriesExtended wraps the generated openapi.SDK client call

func (*Client) GetSeriesFilter

func (c *Client) GetSeriesFilter(request operations.GetSeriesFilterRequest) (*GetSeriesFilter, error)

GetSeriesFilter wraps the generated openapi.SDK client call

func (*Client) GetSeriesNextAired

func (c *Client) GetSeriesNextAired(id float64) (*GetSeriesNextAired, error)

GetSeriesNextAired wraps the generated openapi.SDK client call

func (*Client) GetSeriesSeasonEpisodesTranslated

func (c *Client) GetSeriesSeasonEpisodesTranslated(id float64, lang string, page int64, seasonType string) (*GetSeriesSeasonEpisodesTranslated, error)

GetSeriesSeasonEpisodesTranslated wraps the generated openapi.SDK client call

func (*Client) GetSeriesTranslation

func (c *Client) GetSeriesTranslation(id float64, language string) (*GetSeriesTranslation, error)

GetSeriesTranslation wraps the generated openapi.SDK client call

func (*Client) GetUserFavorites

func (c *Client) GetUserFavorites(ctx context.Context) (*GetUserFavorites, error)

CreateUserFavorites wraps the generated openapi.SDK client call

func (c *Client) CreateUserFavorites(request *shared.FavoriteRecord) (*CreateUserFavorites, error) {
	r, err := c.sdk.Favorites.CreateUserFavorites(c.ctx, request)
	if err != nil {
		return nil, err
	}
	if r.StatusCode != 200 {
		return nil, errors.Errorf("non-200 response: %d", r.StatusCode)
	}
	return r.CreateUserFavorites200ApplicationJSONObject, nil
}

GetUserFavorites wraps the generated openapi.SDK client call

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(ctx context.Context) (*GetUserInfo, error)

GetUserInfo wraps the generated openapi.SDK client call

func (*Client) GetUserInfoByID added in v0.1.1

func (c *Client) GetUserInfoByID(id float64) (*GetUserInfoByID, error)

GetUserInfoByID wraps the generated openapi.SDK client call

func (*Client) PostLogin

func (c *Client) PostLogin(request operations.PostLoginRequestBody) (*PostLogin, error)

PostLogin wraps the generated openapi.SDK client call

func (*Client) Updates

func (c *Client) Updates(since float64, action *operations.UpdatesAction, page *float64, type_ *operations.UpdatesType) (*Updates, error)

Updates wraps the generated openapi.SDK client call

type GetAllArtworkStatuses added in v0.1.1

type GetAllArtworkTypes added in v0.1.1

type GetAllAwards added in v0.1.1

type GetAllCompanies added in v0.1.1

type GetAllContentRatings added in v0.1.1

type GetAllCountries added in v0.1.1

type GetAllEpisodes added in v0.1.1

type GetAllGenders added in v0.1.1

type GetAllGenres added in v0.1.1

type GetAllInspirationTypes added in v0.1.1

type GetAllLanguages added in v0.1.1

type GetAllLists added in v0.1.1

type GetAllMovie added in v0.1.1

type GetAllMovieStatuses added in v0.1.1

type GetAllPeople added in v0.1.1

type GetAllPeopleTypes added in v0.1.1

type GetAllSeasons added in v0.1.1

type GetAllSeries added in v0.1.1

type GetAllSeriesStatuses added in v0.1.1

type GetAllSourceTypes added in v0.1.1

type GetArtworkBase added in v0.1.1

type GetArtworkExtended added in v0.1.1

type GetAward added in v0.1.1

type GetAwardCategory added in v0.1.1

type GetAwardCategoryExtended added in v0.1.1

type GetAwardCategoryExtended = operations.GetAwardCategoryExtended200ApplicationJSON

type GetAwardExtended added in v0.1.1

type GetCharacterBase added in v0.1.1

type GetCompany added in v0.1.1

type GetCompanyTypes added in v0.1.1

type GetEntityTypes added in v0.1.1

type GetEpisodeBase added in v0.1.1

type GetEpisodeExtended added in v0.1.1

type GetEpisodeTranslation added in v0.1.1

type GetGenreBase added in v0.1.1

type GetList added in v0.1.1

type GetListBySlug added in v0.1.1

type GetListExtended added in v0.1.1

type GetListTranslation added in v0.1.1

type GetMovieBase added in v0.1.1

type GetMovieBaseBySlug added in v0.1.1

type GetMovieExtended added in v0.1.1

type GetMovieTranslation added in v0.1.1

type GetMoviesFilter added in v0.1.1

type GetPeopleBase added in v0.1.1

type GetPeopleExtended added in v0.1.1

type GetPeopleTranslation added in v0.1.1

type GetSearchResults added in v0.1.1

type GetSearchResultsByRemoteID added in v0.1.1

type GetSearchResultsByRemoteID = operations.GetSearchResultsByRemoteID200ApplicationJSON

type GetSeasonBase added in v0.1.1

type GetSeasonExtended added in v0.1.1

type GetSeasonTranslation added in v0.1.1

type GetSeasonTypes added in v0.1.1

type GetSeriesArtworks added in v0.1.1

type GetSeriesBase added in v0.1.1

type GetSeriesBaseBySlug added in v0.1.1

type GetSeriesEpisodes added in v0.1.1

type GetSeriesExtended added in v0.1.1

type GetSeriesFilter added in v0.1.1

type GetSeriesNextAired added in v0.1.1

type GetSeriesSeasonEpisodesTranslated added in v0.1.1

type GetSeriesSeasonEpisodesTranslated = operations.GetSeriesSeasonEpisodesTranslated200ApplicationJSON

type GetSeriesTranslation added in v0.1.1

type GetUserFavorites added in v0.1.1

type GetUserInfo added in v0.1.1

type GetUserInfoByID added in v0.1.1

type PostLogin added in v0.1.1

type Updates added in v0.1.1

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL