result

package
v0.19.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstNchars added in v0.12.1

func FirstNchars(str string, n int) string

func Shorten

func Shorten(results []Result, n int)

modifies the passed slice of results, changes the description of the results to be at most N characters long

Types

type GeneralResultOutput added in v0.14.0

type GeneralResultOutput struct {
	URL         string          `json:"url"`
	URLHash     string          `json:"url_hash,omitempty"`
	Rank        uint            `json:"rank"`
	Score       float64         `json:"score"`
	Title       string          `json:"title"`
	Description string          `json:"description"`
	EngineRanks []RetrievedRank `json:"engine_ranks"`
}

func ConvertToGeneralOutput added in v0.14.0

func ConvertToGeneralOutput(results []Result) []GeneralResultOutput

type ImageFormat added in v0.11.0

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

type ImageResult added in v0.11.0

type ImageResult struct {
	Original         ImageFormat `json:"original"`
	Thumbnail        ImageFormat `json:"thumbnail"`
	ThumbnailURL     string      `json:"thumbnail_url"`
	ThumbnailURLHash string      `json:"thumbnail_url_hash,omitempty"`
	Source           string      `json:"source"`
	SourceURL        string      `json:"source_url"`
}

type ImageResultOutput added in v0.14.0

type ImageResultOutput struct {
	URL         string          `json:"url"`
	URLHash     string          `json:"url_hash,omitempty"`
	Rank        uint            `json:"rank"`
	Score       float64         `json:"score"`
	Title       string          `json:"title"`
	Description string          `json:"description"`
	EngineRanks []RetrievedRank `json:"engine_ranks"`
	ImageResult ImageResult     `json:"image_result"`
}

func ConvertToImageOutput added in v0.14.0

func ConvertToImageOutput(results []Result) []ImageResultOutput

type Result

type Result struct {
	URL         string          `json:"url"`
	URLHash     string          `json:"url_hash,omitempty"`
	Rank        uint            `json:"rank"`
	Score       float64         `json:"score"`
	Title       string          `json:"title"`
	Description string          `json:"description"`
	EngineRanks []RetrievedRank `json:"engine_ranks"`
	ImageResult ImageResult     `json:"image_result"`
	Response    *colly.Response `json:"-"`
}

Everything about some Result, calculated and compiled from multiple search engines The URL is the primary key

type RetrievedRank

type RetrievedRank struct {
	SearchEngine engines.Name `json:"search_engine"`
	Rank         uint         `json:"rank"`
	Page         uint         `json:"page"`
	OnPageRank   uint         `json:"on_page_rank"`
}

variables are 1-indexed Information about what Rank a result was on some Search Engine

type RetrievedResult

type RetrievedResult struct {
	URL         string        `json:"url"`
	URLHash     string        `json:"url_hash,omitempty"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	ImageResult ImageResult   `json:"image_result"`
	Rank        RetrievedRank `json:"rank"`
}

The info a Search Engine returned about some Result

Jump to

Keyboard shortcuts

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