Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BingAnswer ¶
type BingAnswer struct { Type string `json:"_type"` QueryContext struct { OriginalQuery string `json:"originalQuery"` } `json:"queryContext"` WebPages struct { WebSearchURL string `json:"webSearchUrl"` TotalEstimatedMatches int `json:"totalEstimatedMatches"` Value []BingHit `json:"value"` } `json:"webPages"` RelatedSearches struct { ID string `json:"id"` Value []struct { Text string `json:"text"` DisplayText string `json:"displayText"` WebSearchURL string `json:"webSearchUrl"` } `json:"value"` } `json:"relatedSearches"` RankingResponse struct { Mainline struct { Items []struct { AnswerType string `json:"answerType"` ResultIndex int `json:"resultIndex"` Value struct { ID string `json:"id"` } `json:"value"` } `json:"items"` } `json:"mainline"` Sidebar struct { Items []struct { AnswerType string `json:"answerType"` Value struct { ID string `json:"id"` } `json:"value"` } `json:"items"` } `json:"sidebar"` } `json:"rankingResponse"` }
This struct formats the answers provided by the Bing Web Search API.
func BingSearch ¶
func BingSearch(cs cache.Store, s string) (BingAnswer, error)
type BingHit ¶
type BingHit struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` IsFamilyFriendly bool `json:"isFamilyFriendly"` DisplayURL string `json:"displayUrl"` Snippet string `json:"snippet"` DateLastCrawled time.Time `json:"dateLastCrawled"` SearchTags []struct { Name string `json:"name"` Content string `json:"content"` } `json:"searchTags,omitempty"` About []struct { Name string `json:"name"` } `json:"about,omitempty"` }
type RosettaEntry ¶
type RosettaEntry struct { ID string `yaml:"id,omitempty"` URL string `yaml:"url,omitempty"` ReserveName string `yaml:"reserve_name,omitempty"` Locale string `yaml:"locale,omitempty"` Refs map[string]string `yaml:"refs"` }
func RosettaSearch ¶
func RosettaSearch(e RosettaEntry, cs cache.Store) (RosettaEntry, error)
Click to show internal directories.
Click to hide internal directories.