Documentation ¶
Index ¶
- Variables
- func RangeActorFactory(f func(string, ActorFactory) bool)
- func RangeMovieFactory(f func(string, MovieFactory) bool)
- func Register[T Provider](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) bool)
func RangeMovieFactory ¶
func RangeMovieFactory(f func(string, MovieFactory) bool)
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 Provider ¶
type Provider interface { // Name returns the name of the provider. Name() string // Priority returns the matching priority of the provider. Priority() float64 // SetPriority sets the provider priority to the given value. SetPriority(v float64) // URL returns the base url of the provider. URL() *url.URL }
type RequestTimeoutSetter ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Deprecated: X/sList is deprecated due to its outdated data and WAF.
|
Deprecated: X/sList is deprecated due to its outdated data and WAF. |
Click to show internal directories.
Click to hide internal directories.