engines

package
v0.0.0-...-3b7c52a Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCode

func FetchCode(query string, page int) ([]entities.Stack, error)

func FetchDictionary

func FetchDictionary(query string) (entities.Dict, error)

func FetchImage

func FetchImage(query string, page int) ([]entities.Image, error)

func FetchImageFallback

func FetchImageFallback(query string, page int) ([]entities.Image, error)

func FetchMusic

func FetchMusic(query string) ([]entities.Video, error)

func FetchNews

func FetchNews(query string) ([]entities.News, error)

func FetchText

func FetchText(query string, page int) ([]entities.Result, error)

func FetchTextFallback

func FetchTextFallback(query string, page int) ([]entities.Result, error)

func FetchVideo

func FetchVideo(query string) ([]entities.Video, error)

func FetchWeather

func FetchWeather(query string) (string, error)

func FetchWiki

func FetchWiki(query string) (entities.Wiki, error)

func GetSuggestions

func GetSuggestions(query string) []string

Types

type DictResponse

type DictResponse []struct {
	Word      string `json:"word"`
	Phonetics []struct {
		Audio     string `json:"audio"`
		SourceURL string `json:"sourceUrl,omitempty"`
		License   struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"license,omitempty"`
		Text string `json:"text,omitempty"`
	} `json:"phonetics"`
	Meanings []struct {
		PartOfSpeech string `json:"partOfSpeech"`
		Definitions  []struct {
			Definition string `json:"definition"`
			Synonyms   []any  `json:"synonyms"`
			Antonyms   []any  `json:"antonyms"`
			Example    string `json:"example"`
		} `json:"definitions"`
		Synonyms []string `json:"synonyms"`
		Antonyms []any    `json:"antonyms"`
	} `json:"meanings"`
	License struct {
		Name string `json:"name"`
		URL  string `json:"url"`
	} `json:"license"`
	SourceUrls []string `json:"sourceUrls"`
}

type QwantImageResponse

type QwantImageResponse struct {
	Status string `json:"status"`
	Data   struct {
		Query struct {
			Locale       string `json:"locale"`
			Query        string `json:"query"`
			Offset       int    `json:"offset"`
			QueryContext struct {
				OriginalQuery string `json:"originalQuery"`
			} `json:"queryContext"`
		} `json:"query"`
		Result struct {
			Total int `json:"total"`
			Items []struct {
				Title         string `json:"title"`
				Media         string `json:"media"`
				Thumbnail     string `json:"thumbnail"`
				ThumbWidth    int    `json:"thumb_width"`
				ThumbHeight   int    `json:"thumb_height"`
				Width         int    `json:"width"`
				Height        int    `json:"height"`
				URL           string `json:"url"`
				ID            string `json:"_id"`
				MediaFullsize string `json:"media_fullsize"`
				MediaPreview  string `json:"media_preview"`
				Size          string `json:"size"`
				ThumbType     string `json:"thumb_type"`
			} `json:"items"`
			Instrumentation struct {
				PingURLBase     string `json:"pingUrlBase"`
				PageLoadPingURL string `json:"pageLoadPingUrl"`
			} `json:"instrumentation"`
			Filters struct {
				Size struct {
					Label    string `json:"label"`
					Name     string `json:"name"`
					Type     string `json:"type"`
					Selected string `json:"selected"`
					Values   []struct {
						Value     string `json:"value"`
						Label     string `json:"label"`
						Translate bool   `json:"translate"`
					} `json:"values"`
				} `json:"size"`
				License struct {
					Label    string `json:"label"`
					Name     string `json:"name"`
					Type     string `json:"type"`
					Selected string `json:"selected"`
					Values   []struct {
						Value     string `json:"value"`
						Label     string `json:"label"`
						Translate bool   `json:"translate"`
					} `json:"values"`
				} `json:"license"`
				Freshness struct {
					Label    string `json:"label"`
					Name     string `json:"name"`
					Type     string `json:"type"`
					Selected string `json:"selected"`
					Values   []struct {
						Value     string `json:"value"`
						Label     string `json:"label"`
						Translate bool   `json:"translate"`
					} `json:"values"`
				} `json:"freshness"`
				Color struct {
					Label    string `json:"label"`
					Name     string `json:"name"`
					Type     string `json:"type"`
					Selected string `json:"selected"`
					Values   []struct {
						Value     string `json:"value"`
						Label     string `json:"label"`
						Translate bool   `json:"translate"`
					} `json:"values"`
				} `json:"color"`
				Imagetype struct {
					Label    string `json:"label"`
					Name     string `json:"name"`
					Type     string `json:"type"`
					Selected string `json:"selected"`
					Values   []struct {
						Value     string `json:"value"`
						Label     string `json:"label"`
						Translate bool   `json:"translate"`
					} `json:"values"`
				} `json:"imagetype"`
			} `json:"filters"`
			LastPage bool `json:"lastPage"`
		} `json:"result"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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