search

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ContentGenreFacetKey = "content_genre"
View Source
const LanguageFacetKey = "language"
View Source
const ReleaseYearFacetKey = "release_year"
View Source
const TorrentContentTypeFacetKey = "content_type"
View Source
const TorrentFileTypeFacetKey = "file_type"
View Source
const TorrentSourceFacetKey = "torrent_source"
View Source
const TorrentTagFacetKey = "torrent_tag"
View Source
const Video3dFacetKey = "video_3d"
View Source
const VideoCodecFacetKey = "video_codec"
View Source
const VideoModifierFacetKey = "video_modifier"
View Source
const VideoResolutionFacetKey = "video_resolution"
View Source
const VideoSourceFacetKey = "video_source"

Variables

View Source
var ErrInvalidOrderDirection = fmt.Errorf("not a valid OrderDirection, try [%s]", strings.Join(_OrderDirectionNames, ", "))
View Source
var ErrInvalidTorrentContentOrderBy = fmt.Errorf("not a valid TorrentContentOrderBy, try [%s]", strings.Join(_TorrentContentOrderByNames, ", "))
View Source
var Video3dCriteria = torrentContentAttributeCriteria[model.Video3d](video3dField)
View Source
var VideoResolutionCriteria = torrentContentAttributeCriteria[model.VideoResolution](videoResolutionField)

Functions

func ContentAlternativeIdentifierCriteria added in v0.5.0

func ContentAlternativeIdentifierCriteria(refs ...model.ContentRef) query.Criteria

func ContentCanonicalIdentifierCriteria

func ContentCanonicalIdentifierCriteria(refs ...model.ContentRef) query.Criteria

func ContentCollectionCriteria

func ContentCollectionCriteria(refs ...model.ContentCollectionRef) query.Criteria

func ContentCoreJoins

func ContentCoreJoins() query.Option

func ContentDefaultHydrate

func ContentDefaultHydrate() query.Option

func ContentDefaultOption

func ContentDefaultOption() query.Option

func ContentDefaultPreload added in v0.5.0

func ContentDefaultPreload() query.Option

func ContentIdentifierCriteria

func ContentIdentifierCriteria(refs ...model.ContentRef) query.Criteria

func ContentReleaseDateCriteria

func ContentReleaseDateCriteria(dateRange model.DateRange) query.Criteria

func ContentReleaseDateCriteriaString

func ContentReleaseDateCriteriaString(dateRange string) query.Criteria

func ContentTypeCriteria

func ContentTypeCriteria(types ...model.ContentType) query.Criteria

func HydrateContentCollections

func HydrateContentCollections() query.Option

func HydrateTorrentContentContent

func HydrateTorrentContentContent() query.Option

func HydrateTorrentContentTorrent

func HydrateTorrentContentTorrent() query.Option

func OrderDirectionNames added in v0.9.0

func OrderDirectionNames() []string

OrderDirectionNames returns a list of possible string values of OrderDirection.

func ReleaseYearFacet

func ReleaseYearFacet(options ...query.FacetOption) query.Facet

func TorrentContentCoreJoins

func TorrentContentCoreJoins() query.Option

func TorrentContentDefaultHydrate

func TorrentContentDefaultHydrate() query.Option

func TorrentContentDefaultOption

func TorrentContentDefaultOption() query.Option

func TorrentContentEpisodesCriteria added in v0.6.2

func TorrentContentEpisodesCriteria(episodes model.Episodes) query.Criteria

func TorrentContentGenreFacet

func TorrentContentGenreFacet(options ...query.FacetOption) query.Facet

func TorrentContentInfoHashCriteria added in v0.8.0

func TorrentContentInfoHashCriteria(infoHashes ...protocol.ID) query.Criteria

func TorrentContentLanguageFacet

func TorrentContentLanguageFacet(options ...query.FacetOption) query.Facet

func TorrentContentOrderByNames added in v0.9.0

func TorrentContentOrderByNames() []string

TorrentContentOrderByNames returns a list of possible string values of TorrentContentOrderBy.

func TorrentContentTypeCriteria

func TorrentContentTypeCriteria(types ...model.ContentType) query.Criteria

func TorrentContentTypeFacet

func TorrentContentTypeFacet(options ...query.FacetOption) query.Facet

func TorrentDefaultPreload

func TorrentDefaultPreload() query.Option

func TorrentFileExtensionCriteria

func TorrentFileExtensionCriteria(extensions ...string) query.Criteria

func TorrentFileTypeCriteria

func TorrentFileTypeCriteria(fileTypes ...model.FileType) query.Criteria

func TorrentFileTypeFacet

func TorrentFileTypeFacet(options ...query.FacetOption) query.Facet

func TorrentInfoHashCriteria

func TorrentInfoHashCriteria(infoHashes ...protocol.ID) query.Criteria

func TorrentSourceCriteria

func TorrentSourceCriteria(keys ...string) query.Criteria

func TorrentSourceFacet

func TorrentSourceFacet(options ...query.FacetOption) query.Facet

func TorrentTagCriteria added in v0.3.0

func TorrentTagCriteria(tagNames ...string) query.Criteria

func TorrentTagsFacet added in v0.3.0

func TorrentTagsFacet(options ...query.FacetOption) query.Facet

func Video3dFacet

func Video3dFacet(options ...query.FacetOption) query.Facet

func VideoCodecFacet

func VideoCodecFacet(options ...query.FacetOption) query.Facet

func VideoModifierFacet

func VideoModifierFacet(options ...query.FacetOption) query.Facet

func VideoResolutionFacet

func VideoResolutionFacet(options ...query.FacetOption) query.Facet

func VideoSourceFacet

func VideoSourceFacet(options ...query.FacetOption) query.Facet

Types

type ContentResultItem

type ContentResultItem struct {
	query.ResultItem
	model.Content
}

type ContentSearch

type ContentSearch interface {
	Content(ctx context.Context, options ...query.Option) (result ContentResult, err error)
}

type NullOrderDirection added in v0.9.0

type NullOrderDirection struct {
	OrderDirection OrderDirection
	Valid          bool
	Set            bool
}

func NewNullOrderDirection added in v0.9.0

func NewNullOrderDirection(val interface{}) (x NullOrderDirection)

func (NullOrderDirection) MarshalJSON added in v0.9.0

func (n NullOrderDirection) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullOrderDirection to JSON.

func (*NullOrderDirection) Scan added in v0.9.0

func (x *NullOrderDirection) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullOrderDirection) UnmarshalJSON added in v0.9.0

func (n *NullOrderDirection) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullOrderDirection from JSON.

func (NullOrderDirection) Value added in v0.9.0

func (x NullOrderDirection) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTorrentContentOrderBy added in v0.9.0

type NullTorrentContentOrderBy struct {
	TorrentContentOrderBy TorrentContentOrderBy
	Valid                 bool
	Set                   bool
}

func NewNullTorrentContentOrderBy added in v0.9.0

func NewNullTorrentContentOrderBy(val interface{}) (x NullTorrentContentOrderBy)

func (NullTorrentContentOrderBy) MarshalJSON added in v0.9.0

func (n NullTorrentContentOrderBy) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullTorrentContentOrderBy to JSON.

func (*NullTorrentContentOrderBy) Scan added in v0.9.0

func (x *NullTorrentContentOrderBy) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullTorrentContentOrderBy) UnmarshalJSON added in v0.9.0

func (n *NullTorrentContentOrderBy) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullTorrentContentOrderBy from JSON.

func (NullTorrentContentOrderBy) Value added in v0.9.0

Value implements the driver Valuer interface.

type OrderDirection added in v0.9.0

type OrderDirection string

OrderDirection represents sort order directions ENUM(Ascending, Descending)

const (
	OrderDirectionAscending  OrderDirection = "Ascending"
	OrderDirectionDescending OrderDirection = "Descending"
)

func OrderDirectionValues added in v0.9.0

func OrderDirectionValues() []OrderDirection

OrderDirectionValues returns a list of the values for OrderDirection

func ParseOrderDirection added in v0.9.0

func ParseOrderDirection(name string) (OrderDirection, error)

ParseOrderDirection attempts to convert a string to a OrderDirection.

func (OrderDirection) IsValid added in v0.9.0

func (x OrderDirection) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (OrderDirection) MarshalText added in v0.9.0

func (x OrderDirection) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*OrderDirection) Scan added in v0.9.0

func (x *OrderDirection) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (OrderDirection) String added in v0.9.0

func (x OrderDirection) String() string

String implements the Stringer interface.

func (*OrderDirection) UnmarshalText added in v0.9.0

func (x *OrderDirection) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (OrderDirection) Value added in v0.9.0

func (x OrderDirection) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Params

type Params struct {
	fx.In
	Query lazy.Lazy[*dao.Query]
}

type Result

type Result struct {
	fx.Out
	Search lazy.Lazy[Search]
}

func New

func New(params Params) Result

type SuggestTagsQuery added in v0.3.0

type SuggestTagsQuery struct {
	Prefix     string
	Exclusions []string
}

type SuggestedTag added in v0.3.0

type SuggestedTag struct {
	Name  string
	Count int
}

type TorrentContentFullOrderBy added in v0.9.0

type TorrentContentFullOrderBy maps.InsertMap[TorrentContentOrderBy, OrderDirection]

func (TorrentContentFullOrderBy) Clauses added in v0.9.0

func (TorrentContentFullOrderBy) Option added in v0.9.0

func (fob TorrentContentFullOrderBy) Option() query.Option

type TorrentContentOrderBy added in v0.9.0

type TorrentContentOrderBy string

TorrentContentOrderBy represents sort orders for torrent content search results ENUM(Relevance, PublishedAt, UpdatedAt, Size, Files, Seeders, Leechers, Name, InfoHash)

const (
	TorrentContentOrderByRelevance   TorrentContentOrderBy = "Relevance"
	TorrentContentOrderByPublishedAt TorrentContentOrderBy = "PublishedAt"
	TorrentContentOrderByUpdatedAt   TorrentContentOrderBy = "UpdatedAt"
	TorrentContentOrderBySize        TorrentContentOrderBy = "Size"
	TorrentContentOrderByFiles       TorrentContentOrderBy = "Files"
	TorrentContentOrderBySeeders     TorrentContentOrderBy = "Seeders"
	TorrentContentOrderByLeechers    TorrentContentOrderBy = "Leechers"
	TorrentContentOrderByName        TorrentContentOrderBy = "Name"
	TorrentContentOrderByInfoHash    TorrentContentOrderBy = "InfoHash"
)

func ParseTorrentContentOrderBy added in v0.9.0

func ParseTorrentContentOrderBy(name string) (TorrentContentOrderBy, error)

ParseTorrentContentOrderBy attempts to convert a string to a TorrentContentOrderBy.

func TorrentContentOrderByValues added in v0.9.0

func TorrentContentOrderByValues() []TorrentContentOrderBy

TorrentContentOrderByValues returns a list of the values for TorrentContentOrderBy

func (TorrentContentOrderBy) Clauses added in v0.9.0

func (ob TorrentContentOrderBy) Clauses(direction OrderDirection) []query.OrderByColumn

func (TorrentContentOrderBy) IsValid added in v0.9.0

func (x TorrentContentOrderBy) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (TorrentContentOrderBy) MarshalText added in v0.9.0

func (x TorrentContentOrderBy) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*TorrentContentOrderBy) Scan added in v0.9.0

func (x *TorrentContentOrderBy) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (TorrentContentOrderBy) String added in v0.9.0

func (x TorrentContentOrderBy) String() string

String implements the Stringer interface.

func (*TorrentContentOrderBy) UnmarshalText added in v0.9.0

func (x *TorrentContentOrderBy) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (TorrentContentOrderBy) Value added in v0.9.0

func (x TorrentContentOrderBy) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type TorrentContentResultItem

type TorrentContentResultItem struct {
	query.ResultItem
	model.TorrentContent
}

type TorrentContentSearch

type TorrentContentSearch interface {
	TorrentContent(ctx context.Context, options ...query.Option) (TorrentContentResult, error)
}

type TorrentSearch

type TorrentSearch interface {
	Torrents(ctx context.Context, options ...query.Option) (TorrentsResult, error)
	TorrentsWithMissingInfoHashes(ctx context.Context, infoHashes []protocol.ID, options ...query.Option) (TorrentsWithMissingInfoHashesResult, error)
	TorrentSuggestTags(ctx context.Context, query SuggestTagsQuery, options ...query.Option) (TorrentSuggestTagsResult, error)
}

type TorrentSuggestTagsResult added in v0.3.0

type TorrentSuggestTagsResult struct {
	Suggestions []SuggestedTag
}

type TorrentsResult

type TorrentsResult = query.GenericResult[model.Torrent]

type TorrentsWithMissingInfoHashesResult added in v0.3.0

type TorrentsWithMissingInfoHashesResult struct {
	Torrents          []model.Torrent
	MissingInfoHashes []protocol.ID
}

Jump to

Keyboard shortcuts

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