Documentation
¶
Overview ¶
Package tvmaze is the library behind the tvmaze command line: the HTTP client, request shaping, and the typed data models for the TVMaze show search and schedule endpoints.
The TVMaze public API at api.tvmaze.com requires no authentication. The Client sets a real User-Agent, paces requests at 200 ms intervals, and retries transient 429/5xx failures with exponential backoff.
Index ¶
Constants ¶
const Host = "tvmaze.com"
Host is the site this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to TVMaze over HTTP.
type Config ¶
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds all tunable parameters for the Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Domain ¶
type Domain struct{}
Domain is the tvmaze driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.
type Show ¶
type Show struct {
Rank int `json:"rank"`
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // "Scripted", "Animation", etc.
Genres []string `json:"genres"`
Status string `json:"status"` // "Running", "Ended", "In Development"
Premiered string `json:"premiered"` // YYYY-MM-DD
Rating float64 `json:"rating"`
Network string `json:"network"`
Summary string `json:"summary"` // HTML stripped
URL string `json:"url"` // tvmaze.com URL
}
Show is the public output record for a TV show.