search

package
v2026.609.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownEngine = errors.New("unknown search engine")

Functions

func Register

func Register(name string, e Engine)

Types

type Engine

type Engine interface {
	Search(ctx context.Context, req Request) (Response, error)
}

func Lookup

func Lookup(name string) (Engine, error)

type Hit

type Hit struct {
	Title   string `json:"title"`
	URL     string `json:"url"`
	Snippet string `json:"snippet,omitempty"`
}

type Request

type Request struct {
	Query      string
	MaxResults int
	Extras     map[string]any
}

type Response

type Response struct {
	Engine       string `json:"engine"`
	Hits         []Hit  `json:"hits"`
	HasMore      bool   `json:"hasMore,omitempty"`
	SearxBaseURL string `json:"searxBaseURL,omitempty"`
}

func Run

func Run(ctx context.Context, engineKey string, req Request) (Response, error)

Jump to

Keyboard shortcuts

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