Documentation
¶
Overview ¶
Package imdb is a simple imdb client.
Index ¶
- Constants
- Variables
- type Client
- func (cl *Client) Find(ctx context.Context, q string, params ...string) ([]Result, error)
- func (cl *Client) FindCompany(ctx context.Context, company string, params ...string) ([]Result, error)
- func (cl *Client) FindEpisode(ctx context.Context, episode string, params ...string) ([]Result, error)
- func (cl *Client) FindGame(ctx context.Context, game string, params ...string) ([]Result, error)
- func (cl *Client) FindKeyword(ctx context.Context, keyword string, params ...string) ([]Result, error)
- func (cl *Client) FindMovie(ctx context.Context, movie string, params ...string) ([]Result, error)
- func (cl *Client) FindName(ctx context.Context, name string, params ...string) ([]Result, error)
- func (cl *Client) FindSeries(ctx context.Context, series string, params ...string) ([]Result, error)
- func (cl *Client) FindTitle(ctx context.Context, title string, params ...string) ([]Result, error)
- type Option
- type Result
- func FindCompany(company string, opts ...Option) ([]Result, error)
- func FindEpisode(episode string, opts ...Option) ([]Result, error)
- func FindGame(game string, opts ...Option) ([]Result, error)
- func FindKeyword(keyword string, opts ...Option) ([]Result, error)
- func FindMovie(movie string, opts ...Option) ([]Result, error)
- func FindName(name string, opts ...Option) ([]Result, error)
- func FindSeries(series string, opts ...Option) ([]Result, error)
- func FindTitle(title string, opts ...Option) ([]Result, error)
Constants ¶
const ( TypeAll = "al" TypeCompany = "co" TypeKeyword = "kw" TypeName = "nm" TypeTitle = "tt" )
Type values.
const ( SubtypeGame = "vg" SubtypeMovie = "ft" SubtypeSeries = "tv" SubtypeEpisode = "ep" )
Subtype values.
Variables ¶
var DefaultTransport = http.DefaultTransport
DefaultTransport is the default http transport.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Transport http.RoundTripper
UserAgent string
AppCacheDir string
// contains filtered or unexported fields
}
Client is a imdb client.
func (*Client) FindCompany ¶
func (cl *Client) FindCompany(ctx context.Context, company string, params ...string) ([]Result, error)
FindCompany searches for a company.
func (*Client) FindEpisode ¶
func (cl *Client) FindEpisode(ctx context.Context, episode string, params ...string) ([]Result, error)
FindEpisode searches for a episode.
func (*Client) FindKeyword ¶
func (cl *Client) FindKeyword(ctx context.Context, keyword string, params ...string) ([]Result, error)
FindKeyword searches for a keyword.
type Option ¶
type Option func(*Client)
Option is a imdb client option.
func WithAppCacheDir ¶
WithAppCacheDir is a imdb client option to set the app cache dir.
func WithLogf ¶
WithLogf is a imdb client option to set a log handler for http requests and responses.
func WithTransport ¶
func WithTransport(transport http.RoundTripper) Option
WithTransport is a imdb client option to set the http transport.
type Result ¶
type Result struct {
URL string
ID string
Title string
Type string
Subtype string
S *goquery.Selection
}
Result is the result of a search.
func FindCompany ¶
FindCompany searches for a company.
func FindEpisode ¶
FindEpisode searches for a episode.
func FindKeyword ¶
FindKeyword searches for a keyword.
func FindSeries ¶
FindSeries searches for a series.