search

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package search provides search engines using a common interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Google added in v3.1.1

type Google struct {
	APIKey string // api key enabled for the custom search api
	CX     string // custom search engine id. If empty a default is used.
}

Google implements Searcher for Google custom search engines.

func (*Google) Search added in v3.1.1

func (s *Google) Search(ctx context.Context, query string) <-chan Result

Search implements Searcher for google. At most 100 results can be returned (limit by Google).

type Result added in v3.1.0

type Result struct {
	URL string // url of the search result.
}

Result represents a search result.

type Searcher added in v3.1.0

type Searcher interface {
	// Search searches for results using the query.
	// It returns a channel which sends the results.
	// To stop searching, cancel the context.
	Search(ctx context.Context, query string) <-chan Result
}

Searcher provides an interface for query-based searching.

Jump to

Keyboard shortcuts

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