Documentation ¶
Index ¶
- Variables
- func RangeActorFactory(f func(string, ActorFactory))
- func RangeMovieFactory(f func(string, MovieFactory))
- func RegisterActorFactory[T ActorProvider](name string, factory func() T)
- func RegisterMovieFactory[T MovieProvider](name string, factory func() T)
- type ActorFactory
- type ActorProvider
- type ActorSearcher
- type Fetcher
- type MovieFactory
- type MovieProvider
- type MovieReviewer
- type MovieSearcher
- type Provider
- type RequestTimeoutSetter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidID = errors.New(http.StatusBadRequest, "invalid id") ErrInvalidURL = errors.New(http.StatusBadRequest, "invalid url") ErrInvalidKeyword = errors.New(http.StatusBadRequest, "invalid keyword") ErrInfoNotFound = errors.New(http.StatusNotFound, "info not found") ErrImageNotFound = errors.New(http.StatusNotFound, "image not found") ErrProviderNotFound = errors.New(http.StatusNotFound, "provider not found") ErrIncompleteMetadata = errors.New(http.StatusInternalServerError, "incomplete metadata") )
Functions ¶
func RangeActorFactory ¶
func RangeActorFactory(f func(string, ActorFactory))
func RangeMovieFactory ¶
func RangeMovieFactory(f func(string, MovieFactory))
func RegisterActorFactory ¶
func RegisterActorFactory[T ActorProvider](name string, factory func() T)
func RegisterMovieFactory ¶
func RegisterMovieFactory[T MovieProvider](name string, factory func() T)
Types ¶
type ActorFactory ¶
type ActorFactory = func() ActorProvider
type ActorProvider ¶
type ActorProvider interface { // Provider should be implemented. Provider // NormalizeActorID normalizes actor ID to conform to standard. NormalizeActorID(id string) string // ParseActorIDFromURL parses actor ID from given URL. ParseActorIDFromURL(rawURL string) (string, error) // GetActorInfoByID gets actor's info by id. GetActorInfoByID(id string) (*model.ActorInfo, error) // GetActorInfoByURL gets actor's info by url. GetActorInfoByURL(url string) (*model.ActorInfo, error) }
type ActorSearcher ¶
type ActorSearcher interface { // SearchActor searches matched actor/s. SearchActor(keyword string) ([]*model.ActorSearchResult, error) }
type MovieFactory ¶
type MovieFactory = func() MovieProvider
type MovieProvider ¶
type MovieProvider interface { // Provider should be implemented. Provider // NormalizeMovieID normalizes movie ID to conform to standard. NormalizeMovieID(id string) string // ParseMovieIDFromURL parses movie ID from given URL. ParseMovieIDFromURL(rawURL string) (string, error) // GetMovieInfoByID gets movie's info by id. GetMovieInfoByID(id string) (*model.MovieInfo, error) // GetMovieInfoByURL gets movie's info by url. GetMovieInfoByURL(url string) (*model.MovieInfo, error) }
type MovieReviewer ¶ added in v1.2.0
type MovieReviewer interface { // GetMovieReviewsByID gets the user reviews of given movie id. GetMovieReviewsByID(id string) ([]*model.MovieReviewDetail, error) // GetMovieReviewsByURL gets the user reviews of given movie URL. GetMovieReviewsByURL(rawURL string) ([]*model.MovieReviewDetail, error) }
type MovieSearcher ¶
type RequestTimeoutSetter ¶
Click to show internal directories.
Click to hide internal directories.