Documentation
¶
Index ¶
- func GetResultFingerprint(t *ExternalResultItem) string
- type AggregatedSearch
- type ExternalResultItem
- func (i *ExternalResultItem) Equals(item *ExternalResultItem) bool
- func (i *ExternalResultItem) GetField(key string) interface{}
- func (i *ExternalResultItem) IsNew() bool
- func (i *ExternalResultItem) IsUpdate() bool
- func (i *ExternalResultItem) SetField(key string, val interface{})
- func (i *ExternalResultItem) SetState(isNew bool, update bool)
- type Instance
- type PaginationSearch
- type ResultIndexer
- type ResultItem
- type RunOptions
- type Search
- type SearchMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResultFingerprint ¶
func GetResultFingerprint(t *ExternalResultItem) string
Types ¶
type AggregatedSearch ¶
type AggregatedSearch struct { SearchContexts map[interface{}]Instance // contains filtered or unexported fields }
func NewAggregatedSearch ¶
func NewAggregatedSearch() *AggregatedSearch
func (*AggregatedSearch) GetResults ¶
func (a *AggregatedSearch) GetResults() []ExternalResultItem
func (*AggregatedSearch) GetStartingIndex ¶
func (a *AggregatedSearch) GetStartingIndex() int
func (*AggregatedSearch) SetId ¶
func (s *AggregatedSearch) SetId(val string)
func (*AggregatedSearch) SetResults ¶
func (a *AggregatedSearch) SetResults(results []ExternalResultItem)
func (*AggregatedSearch) SetStartIndex ¶
func (a *AggregatedSearch) SetStartIndex(key interface{}, i int)
type ExternalResultItem ¶
type ExternalResultItem struct { gorm.Model ResultItem LocalCategoryID string LocalCategoryName string LocalId string Announce string Publisher string PublishedWith string // contains filtered or unexported fields }
func (*ExternalResultItem) Equals ¶
func (i *ExternalResultItem) Equals(item *ExternalResultItem) bool
Equals checks if this item matches the other one exactly(excluding the ID) TODO: refactor this to reduce #complexity
func (*ExternalResultItem) GetField ¶
func (i *ExternalResultItem) GetField(key string) interface{}
GetField by a key, use this for extra fields.
func (*ExternalResultItem) IsNew ¶
func (i *ExternalResultItem) IsNew() bool
IsNew whether the result is new to us.
func (*ExternalResultItem) IsUpdate ¶
func (i *ExternalResultItem) IsUpdate() bool
IsUpdate whether the result is an update to an existing one.
func (*ExternalResultItem) SetField ¶
func (i *ExternalResultItem) SetField(key string, val interface{})
SetField sets the value of an extra fields
func (*ExternalResultItem) SetState ¶
func (i *ExternalResultItem) SetState(isNew bool, update bool)
SetState sets the staleness state of this result.
type Instance ¶
type Instance interface { GetStartingIndex() int GetResults() []ExternalResultItem SetStartIndex(key interface{}, i int) SetResults(extracted []ExternalResultItem) SetId(val string) }
An instance of a search
type PaginationSearch ¶
type ResultIndexer ¶
type ResultItem ¶
type ResultItem struct { Site string Title string OriginalTitle string ShortTitle string Description string GUID string Comments string Link string Fingerprint string Banner string IsMagnet bool SourceLink string MagnetLink string Category int Size uint64 Files int Grabs int PublishDate int64 Seeders int Peers int MinimumRatio float64 MinimumSeedTime time.Duration DownloadVolumeFactor float64 UploadVolumeFactor float64 Author string AuthorId string Indexer *ResultIndexer ExtraFields map[string]interface{} `gorm:"-"` // Ignored in gorm }
func (*ResultItem) AddedOnStr ¶
func (ri *ResultItem) AddedOnStr() string
AddedOnStr gets the publish date of this result as a string
func (ResultItem) MarshalXML ¶
func (ri ResultItem) MarshalXML(e *xml.Encoder, _ xml.StartElement) error
type RunOptions ¶
type Search ¶
type Search struct { DOM *goquery.Selection Id string StartIndex int Results []ExternalResultItem // contains filtered or unexported fields }
func (*Search) GetDocument ¶
func (*Search) GetResults ¶
func (s *Search) GetResults() []ExternalResultItem
func (*Search) GetStartingIndex ¶
func (*Search) SetResults ¶
func (s *Search) SetResults(results []ExternalResultItem)
func (*Search) SetStartIndex ¶
type SearchMode ¶
Click to show internal directories.
Click to hide internal directories.