-
Notifications
You must be signed in to change notification settings - Fork 57
/
configuration.go
31 lines (28 loc) · 897 Bytes
/
configuration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package tmdb
import (
"fmt"
)
// Configuration struct
type Configuration struct {
Images struct {
BaseURL string `json:"base_url"`
SecureBaseURL string `json:"secure_base_url"`
BackdropSizes []string `json:"backdrop_sizes"`
LogoSizes []string `json:"logo_sizes"`
PosterSizes []string `json:"poster_sizes"`
ProfileSizes []string `json:"profile_sizes"`
StillSizes []string `json:"still_sizes"`
}
ChangeKeys []string `json:"change_keys"`
}
// GetConfiguration gets the system wide configuration information
// https://developers.themoviedb.org/3/configuration/get-api-configuration
func (tmdb *TMDb) GetConfiguration() (*Configuration, error) {
var config Configuration
uri := fmt.Sprintf("%s/configuration?api_key=%s", baseURL, tmdb.apiKey)
result, err := getTmdb(uri, &config)
if err != nil {
return nil, err
}
return result.(*Configuration), err
}