Documentation ¶
Index ¶
- func Debug(debug bool)
- func TrendsCategories() map[string]string
- type ComparisonItem
- type ExploreCatTree
- type ExploreLocTree
- type ExploreRequest
- type ExploreWidget
- type GeoMap
- type KeywordRestriction
- type KeywordTopic
- type KeywordsRestriction
- type RankedKeyword
- type RequestOptions
- type SearchArticle
- type SearchImage
- type SearchTitle
- type Timeline
- type TrendingArticle
- type TrendingSearch
- type TrendingStory
- type WidgetComparisonItem
- type WidgetResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrendsCategories ¶
TrendsCategories return list of available categories for Realtime method as [param]description map.
Types ¶
type ComparisonItem ¶
type ExploreCatTree ¶
type ExploreCatTree struct { Name string `json:"name" bson:"name"` ID int `json:"id" bson:"id"` Children []*ExploreCatTree `json:"children" bson:"children"` }
func ExploreCategories ¶
func ExploreCategories(ctx context.Context) (*ExploreCatTree, error)
ExploreCategories gets available categories for explore and comparison and caches it in client.
type ExploreLocTree ¶
type ExploreLocTree struct { Name string `json:"name" bson:"name"` ID string `json:"id" bson:"id"` Children []*ExploreLocTree `json:"children" bson:"children"` }
func ExploreLocations ¶
func ExploreLocations(ctx context.Context) (*ExploreLocTree, error)
ExploreLocations gets available locations for explore and comparison and caches it in client.
type ExploreRequest ¶
type ExploreRequest struct { ComparisonItems []*ComparisonItem `json:"comparisonItem" bson:"comparison_items"` Category int `json:"category" bson:"category"` Property string `json:"property" bson:"property"` }
type ExploreWidget ¶
type ExploreWidget struct { Token string `json:"token" bson:"token"` Type string `json:"type" bson:"type"` Title string `json:"title" bson:"title"` ID string `json:"id" bson:"id"` Request *WidgetResponse `json:"request" bson:"request"` }
func Explore ¶
func Explore(ctx context.Context, r *ExploreRequest, hl string) ([]*ExploreWidget, error)
Explore list of widgets with tokens. Every widget is related to specific method (`InterestOverTime`, `InterestOverLoc`, `RelatedSearches`, `Suggestions`) and contains required token and request information.
type GeoMap ¶
type GeoMap struct { GeoCode string `json:"geoCode" bson:"geo_code"` GeoName string `json:"geoName" bson:"geo_name"` Value []int `json:"value" bson:"value"` FormattedValue []string `json:"formattedValue" bson:"formatted_value"` MaxValueIndex int `json:"maxValueIndex" bson:"max_value_index"` HasData []bool `json:"hasData" bson:"has_data"` }
func InterestByLocation ¶
InterestByLocation as list of `GeoMap`, with geo codes and interest values.
type KeywordRestriction ¶
type KeywordTopic ¶
type KeywordsRestriction ¶
type KeywordsRestriction struct {
Keyword []*KeywordRestriction `json:"keyword" bson:"keyword"`
}
type RankedKeyword ¶
type RankedKeyword struct { Query string `json:"query,omitempty" bson:"query"` Topic KeywordTopic `json:"topic,omitempty" bson:"topic"` Value int `json:"value" bson:"value"` FormattedValue string `json:"formattedValue" bson:"formatted_value"` HasData bool `json:"hasData" bson:"has_data"` Link string `json:"link" bson:"link"` }
func Related ¶
func Related(ctx context.Context, w *ExploreWidget, hl string) ([]*RankedKeyword, error)
Related topics or queries, list of `RankedKeyword`, supports two types of widgets.
type RequestOptions ¶
type SearchArticle ¶
type SearchImage ¶
type SearchTitle ¶
type SearchTitle struct {
Query string `json:"query" bson:"query"`
}
type Timeline ¶
type Timeline struct { Time string `json:"time" bson:"time"` FormattedTime string `json:"formattedTime" bson:"formatted_time"` FormattedAxisTime string `json:"formattedAxisTime" bson:"formatted_axis_time"` Value []int `json:"value" bson:"value"` HasData []bool `json:"hasData" bson:"has_data"` FormattedValue []string `json:"formattedValue" bson:"formatted_value"` }
func InterestOverTime ¶
InterestOverTime as list of `Timeline` dots for chart.
type TrendingArticle ¶
type TrendingSearch ¶
type TrendingSearch struct { Title *SearchTitle `json:"title" bson:"title"` FormattedTraffic string `json:"formattedTraffic" bson:"formatted_traffic"` Image *SearchImage `json:"image" bson:"image"` Articles []*SearchArticle `json:"articles" bson:"articles"` }
type TrendingStory ¶
type TrendingStory struct { Title string `json:"title" bson:"title"` Image *SearchImage `json:"image" bson:"image"` Articles []*TrendingArticle `json:"articles" bson:"articles"` }
type WidgetComparisonItem ¶
type WidgetComparisonItem struct { Geo map[string]string `json:"geo,omitempty" bson:"geo"` Time string `json:"time,omitempty" bson:"time"` ComplexKeywordsRestriction KeywordsRestriction `json:"complexKeywordsRestriction,omitempty" bson:"complex_keywords_restriction"` OriginalTimeRangeForExploreURL string `json:"originalTimeRangeForExploreUrl,omitempty" bson:"original_time_range_for_explore_url"` }
type WidgetResponse ¶
type WidgetResponse struct { Geo interface{} `json:"geo,omitempty" bson:"geo"` Time string `json:"time,omitempty" bson:"time"` Resolution string `json:"resolution,omitempty" bson:"resolution"` Locale string `json:"locale,omitempty" bson:"locale"` Restriction WidgetComparisonItem `json:"restriction" bson:"restriction"` CompItem []*WidgetComparisonItem `json:"comparisonItem" bson:"comparison_item"` RequestOpt RequestOptions `json:"requestOptions" bson:"request_option"` KeywordType string `json:"keywordType" bson:"keyword_type"` Metric []string `json:"metric" bson:"metric"` Language string `json:"language" bson:"language"` TrendinessSettings map[string]string `json:"trendinessSettings" bson:"trendiness_settings"` DataMode string `json:"dataMode,omitempty" bson:"data_mode"` }