engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bing

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

Bing search by big

func (*Bing) Search

func (s *Bing) Search(ctx context.Context, query string) ([]*Result, error)

Search 使用serper搜索

type Image

type Image struct {
	Link     string `json:"link"`
	Title    string `json:"title"`
	ImageURL string `json:"imageUrl"`
}

Image 搜索结果

type Organic

type Organic struct {
	Time    string `json:"time"`
	Link    string `json:"link"`
	Title   string `json:"title"`
	Snippet string `json:"snippet"`
	Content string `json:"content"`
}

Organic 搜索结果

type RelatedQuery

type RelatedQuery struct {
	Query string `json:"query"`
}

type Result

type Result struct {
	Time    string `json:"time"`
	Link    string `json:"link"`
	Image   string `json:"image"`
	Video   string `json:"id"` // video id
	Title   string `json:"title"`
	Snippet string `json:"snippet"`
	Content string `json:"content"`
}

Result 搜索结果

type SearchResult

type SearchResult struct {
	SearchParameters struct {
		Query  string `json:"q"`
		Type   string `json:"type"`
		Engine string `json:"engine"`
		Num    int    `json:"num"`
	} `json:"searchParameters"`
	Organic []Organic      `json:"organic"`
	Images  []Image        `json:"images"`
	Videos  []Video        `json:"videos"`
	Related []RelatedQuery `json:"relatedSearches"`
}

SearchResult 搜索结果

type Searcher

type Searcher interface {
	Search(ctx context.Context, query string) ([]*Result, error)
}

Searcher 搜索器

func NewBing

func NewBing(apiKey string) Searcher

NewBing bing search

func NewSearxng

func NewSearxng(url string) Searcher

NewSearxng creates a new Searxng client

func NewSerper

func NewSerper(apiKey string, kind string) Searcher

NewSerper 创建serper

type Searxng

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

func (*Searxng) Search

func (s *Searxng) Search(ctx context.Context, query string) ([]*Result, error)

type Serper

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

Serper 使用serper搜索

func (*Serper) Search

func (s *Serper) Search(ctx context.Context, query string) ([]*Result, error)

Search 使用serper搜索

type Video

type Video struct {
	Link     string `json:"link"`
	Title    string `json:"title"`
	VideoURL string `json:"videoUrl"`
	ImageURL string `json:"imageUrl"`
}

Video 搜索结果

Jump to

Keyboard shortcuts

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