details

package
v0.0.0-...-e986615 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDetailsNotFound = errors.New("media details not found")
)
View Source
var (
	ErrRatingProviderNotFound = errors.New("no ratings provider parser found")
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Retrievers []Retriever
	Cache      cache.Cache
}

func NewController

func NewController(cache cache.Cache, retrievers ...Retriever) *Controller

func (*Controller) Details

func (c *Controller) Details(request Request) (models.Details, error)

func (*Controller) DetailsByTitleBulk

func (c *Controller) DetailsByTitleBulk(requests ...Request) (map[string]models.Details, error)

type OmdbClient

type OmdbClient struct {
	// contains filtered or unexported fields
}

func Omdb

func Omdb(apiKey string) *OmdbClient

func (OmdbClient) Details

func (o OmdbClient) Details(request Request) (models.Details, error)

type OmdbMovie

type OmdbMovie struct {
	Title    string `json:"Title"`
	Year     string `json:"Year"`
	Rated    string `json:"Rated"`
	Released string `json:"Released"`
	Runtime  string `json:"Runtime"`
	Genre    string `json:"Genre"`
	Director string `json:"Director"`
	Writer   string `json:"Writer"`
	Actors   string `json:"Actors"`
	Plot     string `json:"Plot"`
	Language string `json:"Language"`
	Country  string `json:"Country"`
	Awards   string `json:"Awards"`
	Poster   string `json:"Poster"`
	Ratings  []struct {
		Source string `json:"Source"`
		Value  string `json:"Value"`
	} `json:"Ratings"`
	Metascore  string `json:"Metascore"`
	ImdbRating string `json:"imdbRating"`
	ImdbVotes  string `json:"imdbVotes"`
	ImdbID     string `json:"imdbID"`
	Type       string `json:"Type"`
	DVD        string `json:"DVD"`
	BoxOffice  string `json:"BoxOffice"`
	Production string `json:"Production"`
	Website    string `json:"Website"`
	Response   string `json:"Response"`
}

type Request

type Request struct {
	Title string
}

type Retriever

type Retriever interface {
	Details(Request) (models.Details, error)
}

Jump to

Keyboard shortcuts

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