search

package
v0.0.113 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BraveSearcher added in v0.0.22

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

BraveSearcher implements Searcher using the Brave Search API.

func NewBraveSearcher added in v0.0.22

func NewBraveSearcher(apiKey string, client *http.Client) *BraveSearcher

func (*BraveSearcher) Search added in v0.0.22

func (b *BraveSearcher) Search(ctx context.Context, query string, maxResults int) ([]Result, error)

type DuckDuckGoLite

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

DuckDuckGoLite implements Searcher using the DuckDuckGo lite HTML page.

func NewDuckDuckGoLite

func NewDuckDuckGoLite(client *http.Client) *DuckDuckGoLite

func (*DuckDuckGoLite) Search

func (d *DuckDuckGoLite) Search(ctx context.Context, query string, maxResults int) ([]Result, error)

type ExaSearcher added in v0.0.22

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

ExaSearcher implements Searcher using the Exa API.

func NewExaSearcher added in v0.0.22

func NewExaSearcher(apiKey string, client *http.Client) *ExaSearcher

func (*ExaSearcher) Search added in v0.0.22

func (e *ExaSearcher) Search(ctx context.Context, query string, maxResults int) ([]Result, error)

type GoogleSearcher added in v0.0.22

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

GoogleSearcher implements Searcher using Google Custom Search API.

func NewGoogleSearcher added in v0.0.22

func NewGoogleSearcher(apiKey, cx string, client *http.Client) *GoogleSearcher

func (*GoogleSearcher) Search added in v0.0.22

func (g *GoogleSearcher) Search(ctx context.Context, query string, maxResults int) ([]Result, error)

type Result

type Result struct {
	Title   string
	URL     string
	Snippet string
}

Result is a single search result.

func ParseDuckDuckGoLiteHTML

func ParseDuckDuckGoLiteHTML(htmlText string, maxResults int) ([]Result, error)

ParseDuckDuckGoLiteHTML parses results from DuckDuckGo lite HTML.

type Searcher

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

Searcher performs web searches.

func NewSearcher added in v0.0.22

func NewSearcher(cfg *config.Config) (Searcher, error)

NewSearcher creates a Searcher based on the config. Returns DuckDuckGo as the default if no provider is specified.

Jump to

Keyboard shortcuts

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