Golang Wrapper for TheMovieDB API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
coverage
.gitignore
LICENSE
README.md
account.go
account_test.go
authentication.go
authentication_test.go
certifications.go
certifications_test.go
changes.go
changes_test.go
collections.go
collections_test.go
companies.go
companies_test.go
configuration.go
configuration_test.go
coverage.sh
credits.go
credits_test.go
discover.go
discover_test.go
find.go
find_test.go
genres.go
genres_test.go
guestsessions.go
guestsessions_test.go
jobs.go
jobs_test.go
keywords.go
keywords_test.go
lists.go
lists_test.go
local.yml.example
main.go
main_test.go
movies.go
movies_test.go
networks.go
networks_test.go
people.go
people_test.go
reviews.go
reviews_test.go
roundrobin.go
search.go
search_test.go
timezones.go
timezones_test.go
tv.go
tv_test.go
tvepisodes.go
tvepisodes_test.go
tvseasons.go
tvseasons_test.go

README.md

go-tmdb

GoDoc -- Code Coverage Report

A Go Wrapper for the API of The Movie DB. Complete documentation and test suite are included.

An api_key is needed to use the API. Register for one at themoviedb.org.

Note: This product uses the TMDb API but is not endorsed or certified by TMDb.

The Movie DB

How to install

go get github.com/ryanbradynd05/go-tmdb

How to use

Import the library

import "github.com/ryanbradynd05/go-tmdb"

Create a container struct for global properties

type TMDb struct {
  apiKey string
}

Initialize the library using your api_key

func Init(apiKey string) *TMDb {
  return &TMDb{apiKey: apiKey}
}

Use the api methods as you want, for example:

fightClubInfo, err := TMDb.GetMovieInfo(550, nil)

To use optional parameters, pass in a map[string]string of options and values:

var options = make(map[string]string)
options["language"] = "es"
spanishFightClub, err := TMDb.GetMovieInfo(550, options)

All functions return Go structs. To return JSON, use the ToJSON function:

fightClubJson, err := TMDb.ToJSON(fightClubInfo)

How to test

Create a local.yml file in the root directory that mirrors the local.yml.example file. Then, either run go test to simply run the tests or run the coverage.sh file to run the tests with coverage info.

Available methods

All themoviedb.org API v3 GET methods are included. The POST and DELETE APIs are not included yet. For examples on how to call each function, refer to that function's tests. For documentation of the TheMovieDB's API, see their documentation.

License

The MIT License (MIT)

Copyright (c) 2015 Ryan Brady

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.