result

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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 ImageFormat

type ImageFormat struct {
	Height int `json:"height"`
	Width  int `json:"width"`
}

type Images

type Images struct {
	// contains filtered or unexported fields
}

func (Images) ConvertToOutput

func (r Images) ConvertToOutput(secret string) ResultOutput

func (Images) OriginalSize

func (r Images) OriginalSize() ImageFormat

func (Images) Shorten

func (r Images) Shorten(maxTitleLength int, maxDescriptionLength int) Result

func (Images) SourceName

func (r Images) SourceName() string

func (Images) SourceURL

func (r Images) SourceURL() string

func (Images) ThumbnailSize

func (r Images) ThumbnailSize() ImageFormat

func (Images) ThumbnailURL

func (r Images) ThumbnailURL() string

type ImagesOutput

type ImagesOutput struct {
	// contains filtered or unexported fields
}

type ImagesScraped

type ImagesScraped struct {
	WebScraped
	// contains filtered or unexported fields
}

func ConstructImagesResult

func ConstructImagesResult(
	seName engines.Name, urll string, title string, description string, page int, onPageRank int,
	originalHeight int, originalWidth int, thumbnailHeight int, thumbnailWidth int,
	thumbnailUrl string, sourceName string, sourceUrl string,
) (ImagesScraped, error)

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 NewRank

func NewRank(searchEngine engines.Name, rank, page, onPageRank int) Rank

func (Rank) OnPageRank

func (r Rank) OnPageRank() int

func (Rank) Page

func (r Rank) Page() int

func (*Rank) SetOnPageRank

func (r *Rank) SetOnPageRank(onPageRank int)

func (*Rank) SetPage

func (r *Rank) SetPage(page, onPageRank int)

func (*Rank) UpgradeIfBetter added in v0.22.0

func (r *Rank) UpgradeIfBetter(newR Rank)

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
	FQDN() 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 {
	// 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)

Passed as pointer because of the mutex.

func (*ResultConcMap) ExtractWithResponders added in v0.22.0

func (m *ResultConcMap) ExtractWithResponders() ([]Result, []engines.Name)

Passed as pointer because of the mutex.

type ResultOutput

type ResultOutput any

func ConvertToOutput

func ConvertToOutput(results []Result, secret string) []ResultOutput

type ResultScraped

type ResultScraped interface {
	Key() string
	URL() string
	Title() string
	Description() string
	Rank() RankScraped
	Convert(int) Result
}

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 {
	// 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 (SuggestionScraped) Value added in v0.22.0

func (s SuggestionScraped) Value() string

type Web added in v0.32.0

type Web struct {
	// contains filtered or unexported fields
}

func (*Web) AppendEngineRanks added in v0.32.0

func (r *Web) AppendEngineRanks(rank Rank)

func (Web) ConvertToOutput added in v0.32.0

func (r Web) ConvertToOutput(secret string) ResultOutput

func (Web) Description added in v0.32.0

func (r Web) Description() string

func (Web) EngineRanks added in v0.32.0

func (r Web) EngineRanks() []Rank

func (Web) FQDN added in v0.32.0

func (r Web) FQDN() string

func (*Web) InitEngineRanks added in v0.32.0

func (r *Web) InitEngineRanks()

func (Web) Key added in v0.32.0

func (r Web) Key() string

func (Web) Rank added in v0.32.0

func (r Web) Rank() int

func (Web) Score added in v0.32.0

func (r Web) Score() float64

func (*Web) SetDescription added in v0.32.0

func (r *Web) SetDescription(desc string)

func (*Web) SetRank added in v0.32.0

func (r *Web) SetRank(rank int)

func (*Web) SetScore added in v0.32.0

func (r *Web) SetScore(score float64)

func (Web) Shorten added in v0.32.0

func (r Web) Shorten(maxTitleLength int, maxDescriptionLength int) Result

Changes the title and description of the result to be at most N and M characters long respectively.

func (*Web) ShrinkEngineRanks added in v0.32.0

func (r *Web) ShrinkEngineRanks()

func (Web) Title added in v0.32.0

func (r Web) Title() string

func (Web) URL added in v0.32.0

func (r Web) URL() string

type WebOutput added in v0.32.0

type WebOutput struct {
	// contains filtered or unexported fields
}

type WebScraped added in v0.32.0

type WebScraped struct {
	// contains filtered or unexported fields
}

func ConstructResult

func ConstructResult(seName engines.Name, urll string, title string, description string, page int, onPageRank int) (WebScraped, error)

func (WebScraped) Convert added in v0.32.0

func (r WebScraped) Convert(erCap int) Result

func (WebScraped) Description added in v0.32.0

func (r WebScraped) Description() string

func (WebScraped) Key added in v0.32.0

func (r WebScraped) Key() string

func (WebScraped) Rank added in v0.32.0

func (r WebScraped) Rank() RankScraped

func (WebScraped) Title added in v0.32.0

func (r WebScraped) Title() string

func (WebScraped) URL added in v0.32.0

func (r WebScraped) URL() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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