client

package
v0.0.0-...-1769901 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DuckDuckGoSearchClient

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

func NewDuckDuckGoSearchClient

func NewDuckDuckGoSearchClient() *DuckDuckGoSearchClient

func (*DuckDuckGoSearchClient) Search

func (c *DuckDuckGoSearchClient) Search(query string) ([]Result, error)

func (*DuckDuckGoSearchClient) SearchLimited

func (c *DuckDuckGoSearchClient) SearchLimited(query string, limit int) ([]Result, error)

type Icon

type Icon struct {
	Src    string `json:"src,omitempty"`
	Width  int    `json:"width,omitempty"`
	Height int    `json:"height,omitempty"`
}

type Result

type Result struct {
	HtmlFormattedUrl string `json:"htmlFormattedUrl,omitempty"`

	HtmlTitle string `json:"htmlTitle,omitempty"`

	HtmlSnippet string `json:"htmlSnippet,omitempty"`

	FormattedUrl string `json:"formattedUrl,omitempty"`

	Title string `json:"title,omitempty"`

	Snippet string `json:"snippet,omitempty"`

	Icon Icon `json:"icon,omitempty"`
}

type SearchClient

type SearchClient interface {
	Search(query string) ([]Result, error)
	SearchLimited(query string, limit int) ([]Result, error)
}

Jump to

Keyboard shortcuts

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