Documentation ¶
Index ¶
- Constants
- type Credits
- type Description
- type ElasticTV
- func (estv *ElasticTV) AddProvider(p SearchableProvider) error
- func (estv ElasticTV) GetRecordID(query *Query, index string) (string, error)
- func (estv ElasticTV) IndexSearchTitle(params SearchTitlesParams) error
- func (estv ElasticTV) LookupEpisode(params LookupEpisodeParams) (*Title, *Episode, float64, error)
- func (estv ElasticTV) LookupMovie(params LookupMovieParams) (*Title, float64, error)
- func (estv ElasticTV) RefreshIndices() error
- func (estv ElasticTV) UpsertEpisode(episode Episode) error
- func (estv ElasticTV) UpsertTitle(title Title) error
- type Episode
- type IDs
- type LookupCommonParams
- type LookupEpisodeParams
- type LookupMovieParams
- type Query
- func (q *Query) WithActors(names ...string) *Query
- func (q *Query) WithCountries(countries ...string) *Query
- func (q *Query) WithDirectors(names ...string) *Query
- func (q *Query) WithEpisodeNumber(episode uint16) *Query
- func (q *Query) WithGenres(genres ...string) *Query
- func (q *Query) WithIMDbID(imdbURL string) *Query
- func (q *Query) WithOthers(names ...string) *Query
- func (q *Query) WithSearchItem(searchItem SearchTitlesParams) *Query
- func (q *Query) WithSeasonNumber(season uint16) *Query
- func (q *Query) WithTMDbID(tmdbID int) *Query
- func (q *Query) WithTVShowID(tvshowID int) *Query
- func (q *Query) WithTitles(fuzzyMatch bool, titles ...string) *Query
- func (q *Query) WithType(itemType string) *Query
- func (q *Query) WithYearRange(year, diff uint16) *Query
- type Rating
- type SearchEpisodesParams
- type SearchTitlesParams
- type SearchableProvider
- type Title
Constants ¶
View Source
const ( MovieType = "movie" TVShowType = "tv" )
View Source
const ( TitleAttribute = "title" DirectorAttribute = "director" ActorAttribute = "actor" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Description ¶
type ElasticTV ¶
type ElasticTV struct { Client *elasticsearch.Client Providers []SearchableProvider Index index }
func (*ElasticTV) AddProvider ¶
func (estv *ElasticTV) AddProvider(p SearchableProvider) error
func (ElasticTV) GetRecordID ¶
func (ElasticTV) IndexSearchTitle ¶
func (estv ElasticTV) IndexSearchTitle(params SearchTitlesParams) error
func (ElasticTV) LookupEpisode ¶
func (ElasticTV) LookupMovie ¶
func (estv ElasticTV) LookupMovie(params LookupMovieParams) (*Title, float64, error)
func (ElasticTV) RefreshIndices ¶
func (ElasticTV) UpsertEpisode ¶
func (ElasticTV) UpsertTitle ¶
type Episode ¶
type Episode struct { AirDate string `json:"air_date,omitempty"` Description Description `json:"description"` IDs IDs `json:"ids"` Image string `json:"image,omitempty"` Rating *Rating `json:"rating,omitempty"` Timestamp string `json:"@timestamp"` Title string `json:"title"` TVShowID int `json:"tvshow_id,omitempty"` Episode uint16 `json:"episode"` Season uint16 `json:"season"` }
type LookupCommonParams ¶
type LookupEpisodeParams ¶
type LookupEpisodeParams struct { LookupCommonParams EpisodeTitle string Season uint16 Episode uint16 }
type LookupMovieParams ¶
type LookupMovieParams struct { LookupCommonParams Year uint16 }
type Query ¶
type Query struct {
Query struct {
Bool struct {
Should []interface{} `json:"should,omitempty"`
Must []interface{} `json:"must,omitempty"`
} `json:"bool"`
} `json:"query"`
}
func (*Query) WithActors ¶
func (*Query) WithCountries ¶
func (*Query) WithDirectors ¶
func (*Query) WithEpisodeNumber ¶
func (*Query) WithGenres ¶
func (*Query) WithIMDbID ¶
func (*Query) WithOthers ¶
func (*Query) WithSearchItem ¶
func (q *Query) WithSearchItem(searchItem SearchTitlesParams) *Query
func (*Query) WithSeasonNumber ¶
func (*Query) WithTMDbID ¶
func (*Query) WithTVShowID ¶
func (*Query) WithYearRange ¶
type SearchEpisodesParams ¶
type SearchTitlesParams ¶
type SearchableProvider ¶
type SearchableProvider interface { Name() string Init(estv *ElasticTV) (SearchableProvider, error) SearchTitles(SearchTitlesParams) error SearchEpisodes(*Title, uint16, uint16) error }
type Title ¶
type Title struct { Alias []string `json:"alias,omitempty"` Country []string `json:"country,omitempty"` Credits Credits `json:"credits"` Description Description `json:"description"` Genre []string `json:"genre,omitempty"` IDs IDs `json:"ids"` Image string `json:"image,omitempty"` Language string `json:"language,omitempty"` Rating *Rating `json:"rating,omitempty"` Timestamp string `json:"@timestamp"` Title string `json:"title"` Type string `json:"type"` Year uint16 `json:"year,omitempty"` Tagline string `json:"tagline,omitempty"` }
Click to show internal directories.
Click to hide internal directories.