duckduckgo

package module
Version: v0.0.0-...-47ead35 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 4 Imported by: 0

README

go-duckduckgo

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndpointAPI = "https://api.duckduckgo.com/"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Name string `json:"t"`
	// contains filtered or unexported fields
}

func New

func New(name string) *Client

func (*Client) Search

func (client *Client) Search(query string) (*InstantAnswersResult, error)

type Developer

type Developer struct {
	Name string `json:"name"`
	Type string `json:"type"`
	URL  string `json:"url"`
}

type Icon

type Icon struct {
	Width  string `json:"Width"`
	Height string `json:"Height"`
	URL    string `json:"URL"`
}

type InstantAnswersQuery

type InstantAnswersQuery struct {
	Query   string `json:"q"`
	Format  string `json:"format"`
	AppName string `json:"t"`
}

type InstantAnswersResult

type InstantAnswersResult struct {
	RelatedTopics    []*RelatedTopics `json:"RelatedTopics"`
	Heading          string           `json:"Heading"`
	Meta             *Meta            `json:"meta"`
	Answer           string           `json:"Answer"`
	Abstract         string           `json:"Abstract"`
	Redirect         string           `json:"Redirect"`
	AbstractSource   string           `json:"AbstractSource"`
	Infobox          string           `json:"Infobox"`
	DefinitionURL    string           `json:"DefinitionURL"`
	Type             string           `json:"Type"`
	Results          []*Result        `json:"Results"`
	AbstractText     string           `json:"AbstractText"`
	Entity           string           `json:"Entity"`
	Image            string           `json:"Image"`
	ImageHeight      int              `json:"ImageHeight"`
	AbstractURL      string           `json:"AbstractURL"`
	Definition       string           `json:"Definition"`
	ImageWidth       int              `json:"ImageWidth"`
	DefinitionSource string           `json:"DefinitionSource"`
	AnswerType       string           `json:"AnswerType"`
}

type Maintainer

type Maintainer struct {
	Github string `json:"github"`
}

type Meta

type Meta struct {
	ExampleQuery    string       `json:"example_query"`
	SrcDomain       string       `json:"src_domain"`
	Description     string       `json:"description"`
	SrcName         string       `json:"src_name"`
	JsCallbackName  string       `json:"js_callback_name"`
	DevMilestone    string       `json:"dev_milestone"`
	Tab             string       `json:"tab"`
	ID              string       `json:"id"`
	PerlModule      string       `json:"perl_module"`
	Blockgroup      string       `json:"blockgroup"`
	SrcOptions      *SrcOptions  `json:"src_options"`
	CreatedDate     string       `json:"created_date"`
	IsStackexchange int          `json:"is_stackexchange"`
	SrcID           int          `json:"src_id"`
	Designer        string       `json:"designer"`
	Maintainer      *Maintainer  `json:"maintainer"`
	Unsafe          int          `json:"unsafe"`
	Attribution     string       `json:"attribution"`
	Topic           []string     `json:"topic"`
	LiveDate        string       `json:"live_date"`
	SignalFrom      string       `json:"signal_from"`
	Name            string       `json:"name"`
	ProductionState string       `json:"production_state"`
	Developer       []*Developer `json:"developer"`
	Producer        string       `json:"producer"`
	SrcURL          string       `json:"src_url"`
	DevDate         string       `json:"dev_date"`
	Repo            string       `json:"repo"`
	Status          string       `json:"status"`
}

type RelatedTopics

type RelatedTopics struct {
	Result   string    `json:"Result,omitempty"`
	FirstURL string    `json:"FirstURL,omitempty"`
	Icon     *Icon     `json:"Icon,omitempty"`
	Text     string    `json:"Text,omitempty"`
	Topics   []*Topics `json:"Topics,omitempty"`
	Name     string    `json:"Name,omitempty"`
}

type Result

type Result struct {
	Result   string `json:"Result"`
	FirstURL string `json:"FirstURL"`
	Icon     *Icon  `json:"Icon"`
	Text     string `json:"Text"`
}

type SrcOptions

type SrcOptions struct {
	SkipEnd           string `json:"skip_end"`
	Language          string `json:"language"`
	SkipQr            string `json:"skip_qr"`
	SkipImageName     int    `json:"skip_image_name"`
	Directory         string `json:"directory"`
	IsMediawiki       int    `json:"is_mediawiki"`
	IsWikipedia       int    `json:"is_wikipedia"`
	SkipAbstract      int    `json:"skip_abstract"`
	SrcInfo           string `json:"src_info"`
	SkipIcon          int    `json:"skip_icon"`
	MinAbstractLength string `json:"min_abstract_length"`
	SourceSkip        string `json:"source_skip"`
	SkipAbstractParen int    `json:"skip_abstract_paren"`
	IsFanon           int    `json:"is_fanon"`
}

type Topics

type Topics struct {
	Result   string `json:"Result"`
	Text     string `json:"Text"`
	Icon     *Icon  `json:"Icon"`
	FirstURL string `json:"FirstURL"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL