search

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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.

Jump to

Keyboard shortcuts

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