result

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentMap

type ConcurrentMap struct {
	Mutex sync.RWMutex
	Map   map[string]Result
}

func Map

func Map() ConcurrentMap

func (*ConcurrentMap) ExtractResultsAndResponders

func (r *ConcurrentMap) ExtractResultsAndResponders(enabledEnginesLen, titleLen, descLen int) ([]Result, []engines.Name)

type General

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

func (*General) AppendEngineRanks

func (r *General) AppendEngineRanks(rank Rank)

func (General) ConvertToOutput

func (r General) ConvertToOutput(salt string) ResultOutput

func (General) Description

func (r General) Description() string

func (General) EngineRanks

func (r General) EngineRanks() []Rank

func (General) Rank

func (r General) Rank() int

func (General) Score

func (r General) Score() float64

func (*General) SetDescription

func (r *General) SetDescription(desc string)

func (*General) SetRank

func (r *General) SetRank(rank int)

func (*General) SetScore

func (r *General) SetScore(score float64)

func (General) Shorten

func (r General) 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 (*General) ShrinkEngineRanks

func (r *General) ShrinkEngineRanks()

func (General) Title

func (r General) Title() string

func (General) URL

func (r General) URL() string

type GeneralScraped

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

func ConstructResult

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

func (GeneralScraped) Convert

func (r GeneralScraped) Convert(erCap int) Result

func (GeneralScraped) Description

func (r GeneralScraped) Description() 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 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(salt 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 {
	GeneralScraped
	// 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 {
	// 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) Rank

func (r Rank) Rank() int

func (Rank) SearchEngine

func (r Rank) SearchEngine() engines.Name

func (*Rank) SetOnPageRank

func (r *Rank) SetOnPageRank(onPageRank int)

func (*Rank) SetPage

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

func (*Rank) SetRank

func (r *Rank) SetRank(rank int)

type RankScraped

type RankScraped struct {
	// 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

func (RankScraped) Rank

func (r RankScraped) Rank() int

func (RankScraped) SearchEngine

func (r RankScraped) SearchEngine() engines.Name

type Result

type Result interface {
	URL() string
	Title() string
	Description() string
	SetDescription(string)
	Rank() int
	SetRank(int)
	Score() float64
	SetScore(float64)
	EngineRanks() []Rank
	ShrinkEngineRanks()
	AppendEngineRanks(Rank)
	ConvertToOutput(string) ResultOutput
	Shorten(int, int) Result
}

type ResultOutput

type ResultOutput interface{}

func ConvertToOutput

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

type ResultScraped

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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