Documentation
¶
Index ¶
Constants ¶
View Source
const ( Article = "A" Disambiguation = "D" Category = "C" Name = "N" Exclusive = "E" )
Result Types
View Source
const UrlApi = "api.duckduckgo.com"
Url of the DuckDuckGo API
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Dial func(network, addr string) (net.Conn, error) // Dialer to use UrlApi string // Url to duckduckgo api UserAgent string // Useragent used in requests Pretty bool // Return pritty json NoHTML bool // Do not include html in querys SkipDisambiguation bool // Skip disambiguation }
func (*Client) FeelingLucky ¶
type Result ¶
type Result struct { Abstract string // Topic summary (can contain HTML, e.g. italics) AbstractText string // Topic summary (with no HTML) AbstractSource string // Name of Abstract source AbstractURL string // Deep link to expanded topic page in AbstractSource Image string // Link to image that goes with Abstract Heading string // Name of topic that goes with Abstract Answer string // Instant answer AnswerType string // Type of Answer, e.g. calc, color, digest, info, ip, iploc, phone, pw, rand, regexp, unicode, upc, or zip (see goodies & tech pages for examples). Definition string // Dictionary definition (may differ from Abstract) DefinitionSource string // Name of Definition source DefinitionURL string // Deep link to expanded definition page in DefinitionSource RelatedTopics []struct { Result string // HTML link(s) to related topic(s) FirstURL string // First URL in Result Icon struct { URL string // URL of icon Height interface{} // Height of icon (px) Width interface{} // Width of icon (px) } Text string // Text from first URL } Results []struct { Result string // HTML link(s) to external site(s) FirstURL string // First URL in Result Icon struct { URL string // URL of icon Height interface{} // Height of icon (px) Width interface{} // Width of icon (px) } Text string // Text from FirstURL } Type string // Response category, i.e. A (article), D (disambiguation), C (category), N (name), E (exclusive), or nothing. Redirect string // !bang redirect URL }
Click to show internal directories.
Click to hide internal directories.