Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultRegion is a two-letter country code that denotes the default region to pass to Google Search for location-aware results.
DefaultRegion = "US"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct { URL string // Desc is typically the <title> of the webpage. Desc string // Context holds text that shows why the URL is pertinent to the search query. Context string }
Link represents a single search result.
type Result ¶
type Result struct { Links []Link // RateLimited tells api's clients if Google has rate limited their requests. RateLimited bool // DYM holds the "Did you mean" suggestion, if returned by Google for a particular query. DYM string // SRF holds the "Showing results for" text, if returned by Google for a particular query. SRF string }
Result holds a complete search result.
type SearchConfig ¶
type SearchConfig struct {
Region string
}
SearchConfig holds information pertaining to a search session.
func (SearchConfig) Search ¶
func (sc SearchConfig) Search(sp SearchParameters) (Result, error)
Search queries Google Search returns a Result.
type SearchParameters ¶
SearchParameters holds information pertaining to a search query. Note that Page is 0-indexed.
func (SearchParameters) Valid ¶
func (sp SearchParameters) Valid() bool
Valid checks if a SearchParameters is valid.
type SugConfig ¶
type SugConfig struct {
Region string
}
SugConfig holds information pertaining to a suggestion session.
type Suggestions ¶
type Suggestions []string
Suggestions is a slice of strings to store suggestions in.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.