gork

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	// URL of result.
	URL string `json:"url"`

	// Title of result.
	Title string `json:"title"`
}

Result represents a single result from Google Search.

func Search(ctx context.Context, searchTerm string, opts ...SearchOptions) ([]Result, error)

Search returns a list of search results from Google.

type SearchOptions

type SearchOptions struct {
	// UserAgent sets the UserAgent of the http request.
	// Default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
	UserAgent string

	// ProxyAddr sets a proxy address to avoid IP blocking.
	ProxyAddr string

	// follow links
	FollowLinks bool
}

SearchOptions modifies how the Search function behaves.

Jump to

Keyboard shortcuts

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