Documentation ¶
Index ¶
- func GetResultFingerprint(t *ExternalResultItem) string
- type AggregatedSearch
- type CanBeStale
- type Equatable
- type ExternalResultItem
- func (i *ExternalResultItem) Equals(other interface{}) bool
- func (i *ExternalResultItem) GetField(key string) interface{}
- func (i *ExternalResultItem) Id() uint32
- func (i *ExternalResultItem) IsNew() bool
- func (i *ExternalResultItem) IsUpdate() bool
- func (i *ExternalResultItem) SetField(key string, val interface{})
- func (i *ExternalResultItem) SetId(id uint32)
- func (i *ExternalResultItem) SetState(isNew bool, update bool)
- func (i *ExternalResultItem) SetUUID(u string)
- func (i *ExternalResultItem) UUID() string
- type IDed
- type Instance
- type Model
- type PaginationSearch
- type Record
- type ResultIndexer
- type ResultItem
- type RunOptions
- type Search
- type SearchMode
- type UUIDed
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 CanBeStale ¶ added in v0.3.0
type CanBeStale interface {
SetState(new, updated bool)
}
type ExternalResultItem ¶
type ExternalResultItem struct { 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(other interface{}) 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) Id ¶ added in v0.3.0
func (i *ExternalResultItem) Id() uint32
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) SetId ¶ added in v0.3.0
func (i *ExternalResultItem) SetId(id uint32)
func (*ExternalResultItem) SetState ¶
func (i *ExternalResultItem) SetState(isNew bool, update bool)
SetState sets the staleness state of this result.
func (*ExternalResultItem) SetUUID ¶ added in v0.3.0
func (i *ExternalResultItem) SetUUID(u string)
func (*ExternalResultItem) UUID ¶ added in v0.3.0
func (i *ExternalResultItem) UUID() string
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 Record ¶ added in v0.3.0
type Record interface { UUIDed IDed CanBeStale }
type ResultIndexer ¶
type ResultItem ¶
type ResultItem struct { Site string Title string OriginalTitle string ShortTitle string Description string UUIDValue string Comments string Link string Fingerprint string Banner string IsMagnet bool SourceLink string MagnetLink string Category int Size uint32 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.