Documentation ¶
Index ¶
- func ConvertSuggestionsToOutput(suggestions []Suggestion) []string
- type ConcMapper
- type General
- func (r *General) AppendEngineRanks(rank Rank)
- func (r General) ConvertToOutput(salt string) ResultOutput
- func (r General) Description() string
- func (r General) EngineRanks() []Rank
- func (r *General) InitEngineRanks()
- func (r General) Key() string
- func (r General) Rank() int
- func (r General) Score() float64
- func (r *General) SetDescription(desc string)
- func (r *General) SetRank(rank int)
- func (r *General) SetScore(score float64)
- func (r General) Shorten(maxTitleLength int, maxDescriptionLength int) Result
- func (r *General) ShrinkEngineRanks()
- func (r General) Title() string
- func (r General) URL() string
- type GeneralOutput
- type GeneralScraped
- type ImageFormat
- type Images
- func (r Images) ConvertToOutput(salt string) ResultOutput
- func (r Images) OriginalSize() ImageFormat
- func (r Images) Shorten(maxTitleLength int, maxDescriptionLength int) Result
- func (r Images) SourceName() string
- func (r Images) SourceURL() string
- func (r Images) ThumbnailSize() ImageFormat
- func (r Images) ThumbnailURL() string
- type ImagesOutput
- type ImagesScraped
- type Rank
- type RankScraped
- type RankSimple
- type RankSimpleScraped
- type Result
- type ResultConcMap
- type ResultOutput
- type ResultScraped
- type Suggestion
- func (s *Suggestion) AppendEngineRanks(rank RankSimple)
- func (s Suggestion) EngineRanks() []RankSimple
- func (s Suggestion) Rank() int
- func (s Suggestion) Score() float64
- func (s *Suggestion) SetRank(rank int)
- func (s *Suggestion) SetScore(score float64)
- func (s *Suggestion) ShrinkEngineRanks()
- func (s Suggestion) Value() string
- type SuggestionConcMap
- type SuggestionScraped
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertSuggestionsToOutput ¶ added in v0.22.0
func ConvertSuggestionsToOutput(suggestions []Suggestion) []string
Types ¶
type ConcMapper ¶ added in v0.22.0
type ConcMapper[T any] interface { AddOrUpgrade(T) }
type General ¶
type General struct {
// contains filtered or unexported fields
}
func (*General) AppendEngineRanks ¶
func (General) ConvertToOutput ¶
func (r General) ConvertToOutput(salt string) ResultOutput
func (General) Description ¶
func (General) EngineRanks ¶
func (*General) InitEngineRanks ¶ added in v0.22.0
func (r *General) InitEngineRanks()
func (*General) SetDescription ¶
func (General) Shorten ¶
Changes the title and description of the result to be at most N and M characters long respectively.
func (*General) ShrinkEngineRanks ¶
func (r *General) ShrinkEngineRanks()
type GeneralOutput ¶ added in v0.22.0
type GeneralOutput struct {
// contains filtered or unexported fields
}
type GeneralScraped ¶
type GeneralScraped struct {
// contains filtered or unexported fields
}
func ConstructResult ¶
func (GeneralScraped) Convert ¶
func (r GeneralScraped) Convert(erCap int) Result
func (GeneralScraped) Description ¶
func (r GeneralScraped) Description() string
func (GeneralScraped) Key ¶ added in v0.22.0
func (r GeneralScraped) Key() string
func (GeneralScraped) Rank ¶
func (r GeneralScraped) Rank() RankScraped
func (GeneralScraped) Title ¶
func (r GeneralScraped) Title() string
func (GeneralScraped) URL ¶
func (r GeneralScraped) URL() string
type ImageFormat ¶
type Images ¶
type Images struct {
// contains filtered or unexported fields
}
func (Images) ConvertToOutput ¶
func (r Images) ConvertToOutput(salt string) ResultOutput
func (Images) OriginalSize ¶
func (r Images) OriginalSize() ImageFormat
func (Images) SourceName ¶
func (Images) ThumbnailSize ¶
func (r Images) ThumbnailSize() ImageFormat
func (Images) ThumbnailURL ¶
type ImagesOutput ¶
type ImagesOutput struct {
// contains filtered or unexported fields
}
type ImagesScraped ¶
type ImagesScraped struct { GeneralScraped // contains filtered or unexported fields }
func ConstructImagesResult ¶
func (ImagesScraped) Convert ¶
func (r ImagesScraped) Convert(erCap int) Result
func (ImagesScraped) OriginalSize ¶
func (r ImagesScraped) OriginalSize() scrapedImageFormat
func (ImagesScraped) SourceName ¶
func (r ImagesScraped) SourceName() string
func (ImagesScraped) SourceURL ¶
func (r ImagesScraped) SourceURL() string
func (ImagesScraped) ThumbnailSize ¶
func (r ImagesScraped) ThumbnailSize() scrapedImageFormat
func (ImagesScraped) ThumbnailURL ¶
func (r ImagesScraped) ThumbnailURL() string
type Rank ¶
type Rank struct { RankSimple // contains filtered or unexported fields }
func (Rank) OnPageRank ¶
func (*Rank) SetOnPageRank ¶
func (*Rank) UpgradeIfBetter ¶ added in v0.22.0
type RankScraped ¶
type RankScraped struct { RankSimpleScraped // contains filtered or unexported fields }
func NewRankScraped ¶
func NewRankScraped(searchEngine engines.Name, rank, page, onPageRank int) RankScraped
func (RankScraped) Convert ¶
func (r RankScraped) Convert() Rank
func (RankScraped) OnPageRank ¶
func (r RankScraped) OnPageRank() int
func (RankScraped) Page ¶
func (r RankScraped) Page() int
type RankSimple ¶ added in v0.22.0
type RankSimple struct {
// contains filtered or unexported fields
}
func (RankSimple) Rank ¶ added in v0.22.0
func (r RankSimple) Rank() int
func (RankSimple) SearchEngine ¶ added in v0.22.0
func (r RankSimple) SearchEngine() engines.Name
func (*RankSimple) SetRank ¶ added in v0.22.0
func (r *RankSimple) SetRank(rank int)
func (*RankSimple) UpgradeIfBetter ¶ added in v0.22.0
func (r *RankSimple) UpgradeIfBetter(newR RankSimple)
type RankSimpleScraped ¶ added in v0.22.0
type RankSimpleScraped struct {
// contains filtered or unexported fields
}
func NewRankSimpleScraped ¶ added in v0.22.0
func NewRankSimpleScraped(searchEngine engines.Name, rank int) RankSimpleScraped
func (RankSimpleScraped) Convert ¶ added in v0.22.0
func (r RankSimpleScraped) Convert() RankSimple
func (RankSimpleScraped) Rank ¶ added in v0.22.0
func (r RankSimpleScraped) Rank() int
func (RankSimpleScraped) SearchEngine ¶ added in v0.22.0
func (r RankSimpleScraped) SearchEngine() engines.Name
type Result ¶
type Result interface { Key() string URL() string Title() string Description() string SetDescription(string) Rank() int SetRank(int) Score() float64 SetScore(float64) EngineRanks() []Rank InitEngineRanks() ShrinkEngineRanks() AppendEngineRanks(Rank) ConvertToOutput(string) ResultOutput Shorten(int, int) Result }
type ResultConcMap ¶ added in v0.22.0
type ResultConcMap struct { Mutex sync.RWMutex Map map[string]Result // contains filtered or unexported fields }
func NewResultMap ¶ added in v0.22.0
func NewResultMap(enabledEnginesLen, titleLen, descLen int) ResultConcMap
func (*ResultConcMap) AddOrUpgrade ¶ added in v0.22.0
func (m *ResultConcMap) AddOrUpgrade(val ResultScraped)
func (*ResultConcMap) ExtractWithResponders ¶ added in v0.22.0
func (m *ResultConcMap) ExtractWithResponders() ([]Result, []engines.Name)
type ResultOutput ¶
type ResultOutput any
func ConvertToOutput ¶
func ConvertToOutput(results []Result, salt string) []ResultOutput
type ResultScraped ¶
type Suggestion ¶ added in v0.22.0
type Suggestion struct {
// contains filtered or unexported fields
}
func (*Suggestion) AppendEngineRanks ¶ added in v0.22.0
func (s *Suggestion) AppendEngineRanks(rank RankSimple)
func (Suggestion) EngineRanks ¶ added in v0.22.0
func (s Suggestion) EngineRanks() []RankSimple
func (Suggestion) Rank ¶ added in v0.22.0
func (s Suggestion) Rank() int
func (Suggestion) Score ¶ added in v0.22.0
func (s Suggestion) Score() float64
func (*Suggestion) SetRank ¶ added in v0.22.0
func (s *Suggestion) SetRank(rank int)
func (*Suggestion) SetScore ¶ added in v0.22.0
func (s *Suggestion) SetScore(score float64)
func (*Suggestion) ShrinkEngineRanks ¶ added in v0.22.0
func (s *Suggestion) ShrinkEngineRanks()
func (Suggestion) Value ¶ added in v0.22.0
func (s Suggestion) Value() string
type SuggestionConcMap ¶ added in v0.22.0
type SuggestionConcMap struct { Mutex sync.RWMutex Map map[string]Suggestion // contains filtered or unexported fields }
func NewSuggestionMap ¶ added in v0.22.0
func NewSuggestionMap(enabledEnginesLen int) SuggestionConcMap
func (*SuggestionConcMap) AddOrUpgrade ¶ added in v0.22.0
func (m *SuggestionConcMap) AddOrUpgrade(val SuggestionScraped)
func (*SuggestionConcMap) ExtractWithResponders ¶ added in v0.22.0
func (m *SuggestionConcMap) ExtractWithResponders() ([]Suggestion, []engines.Name)
type SuggestionScraped ¶ added in v0.22.0
type SuggestionScraped struct {
// contains filtered or unexported fields
}
func NewSuggestionScraped ¶ added in v0.22.0
func NewSuggestionScraped(value string, seName engines.Name, rank int) SuggestionScraped
func (SuggestionScraped) Convert ¶ added in v0.22.0
func (s SuggestionScraped) Convert(erCap int) Suggestion
func (SuggestionScraped) Key ¶ added in v0.22.0
func (s SuggestionScraped) Key() string
func (SuggestionScraped) Rank ¶ added in v0.22.0
func (s SuggestionScraped) Rank() RankSimpleScraped
func (SuggestionScraped) Value ¶ added in v0.22.0
func (s SuggestionScraped) Value() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.