Versions in this module Expand all Collapse all v1 v1.0.14 Feb 8, 2023 v1.0.13 Feb 8, 2023 v1.0.12 Jan 18, 2021 v1.0.11 Jan 18, 2021 Changes in this version + const DefaultSmSuggestUrlFmt + const HotWordSm + const SmHotWordsUrl type HotWordResult + func SmHotWordFind(hwf *HotWordFinder, from string, suggestUrl string) ([]*HotWordResult, error) v1.0.8 Dec 15, 2020 v1.0.7 Dec 15, 2020 Changes in this version type Engine + func (engine *Engine) RegisterByKind(kind, key string, finder Finder) v1.0.6 Dec 10, 2020 v1.0.5 Dec 10, 2020 v1.0.4 Dec 10, 2020 Changes in this version + const BaiduSuggestionUrl + const DefaultBaiduSuggestionUrlFmt + const KindSuggestion + const SuggestionBaidu + const SuggestionHttpTimeout + const VERSION + func CutJsonp(regex, jsonp string) (string, error) type Engine + func (engine *Engine) GetSuggestionFinder() *SuggestionFinder + type SuggestionFinder struct + From string + Provider string + SuggestUrl string + TTL int + func NewSuggestionFinder(provider string, from string, suggestUrl string, ttl int) *SuggestionFinder + func (suf *SuggestionFinder) Close() + func (suf *SuggestionFinder) Find(keyword string, from string, suggestUrl string) ([]*SuggestionResult, error) + func (suf *SuggestionFinder) GetSuggestUrl(keyword string, from string, suggestUrl string) string + func (suf *SuggestionFinder) Version() string + type SuggestionResult struct + Keyword string + Query string + SuggestUrl string + Weight int + func BaiduSuggestionFind(suf *SuggestionFinder, keyword string, from string, suggestUrl string) ([]*SuggestionResult, error) + func (wr *SuggestionResult) Json() string v1.0.3 Nov 20, 2020 v1.0.2 Nov 20, 2020 Changes in this version + const BaiduHotWordsUrl + const CMCC + const CMCC_V + const CTCC + const CTCC_V + const CUCC + const CUCC_V + const Default360SoSuggestUrlFmt + const DefaultBaiduSuggestUrlFmt + const DefaultSoGouSuggestUrlFmt + const DefaultTouTiaoSuggestUrlFmt + const HotWord360So + const HotWordBaidu + const HotWordHttpTimeout + const HotWordSogou + const HotWordTouTiao + const KindHotword + const KindIP2Loc + const KindPhone + const KindWeather + const PhoneCharLen + const PhoneHeadLength + const PhoneIndexLength + const PhoneIntLen + const SoGouHotWordsUrl + const SoHotWordsUrl + const TouTiaoHotWordsUrl + const WeatherHe + const WeatherHttpTimeout + const WeatherKindHeAir + const WeatherKindHeWeather + const WeatherSina + var CarrierMap = map[byte]string + var CityCodeMap = map[string]string + var CityName2PinYinMap = map[string]string + var CityPinYinMap = map[string]string + var HeWeatherImgMap = map[string]string + var SinaWeatherImgMap = map[string]string + type Engine struct + func NewEngine() Engine + func (engine *Engine) Destroy() + func (engine *Engine) Get(key string) Finder + func (engine *Engine) GetHowWordFinder() *HotWordFinder + func (engine *Engine) GetIP2LocFinder() *IP2LocFinder + func (engine *Engine) GetPhoneFinder() *PhoneFinder + func (engine *Engine) GetWeatherFinder() *WeatherFinder + func (engine *Engine) Register(key string, finder Finder) + func (engine *Engine) UnRegister(key string) + type Finder interface + Close func() + type HotWordFinder struct + From string + Provider string + SuggestUrl string + TTL int + func NewHotWordFinder(provider string, from string, suggestUrl string, ttl int) *HotWordFinder + func (hwf *HotWordFinder) Close() + func (hwf *HotWordFinder) Find() ([]*HotWordResult, error) + func (hwf *HotWordFinder) GetSuggestUrl(keyword string) string + func (hwf *HotWordFinder) Version() string + type HotWordResult struct + Keyword string + SuggestUrl string + Weight int + func BaiduHotWordFind(hwf *HotWordFinder) ([]*HotWordResult, error) + func SoGouHotWordFind(hwf *HotWordFinder) ([]*HotWordResult, error) + func SoHotWordFind(hwf *HotWordFinder) ([]*HotWordResult, error) + func TouTiaoHotWordFind(hwf *HotWordFinder) ([]*HotWordResult, error) + func (wr *HotWordResult) Json() string + type IP2LocFinder struct + func NewIP2LocFinder(db string) *IP2LocFinder + func (iplf *IP2LocFinder) Close() + func (iplf *IP2LocFinder) Find(ip string, algorithm string) (*IP2LocResult, error) + func (iplf *IP2LocFinder) Version() string + type IP2LocResult struct + City string + CityId int64 + Country string + IP string + ISP string + Province string + Region string + type PhoneFinder struct + func NewPhoneFinder(db string) *PhoneFinder + func (pf *PhoneFinder) BtreeSearch(phoneNum string) (*PhoneResult, error) + func (pf *PhoneFinder) Close() + func (pf *PhoneFinder) Find(key string) (*PhoneResult, error) + func (pf *PhoneFinder) Version() string + type PhoneResult struct + Carrier string + City string + Phone string + Province string + Region string + ZipCode string + type WeatherFinder struct + AppKey string + Provider string + TTL int + func NewWeatherFinder(provider string, appKey string, ttl int) *WeatherFinder + func (wf *WeatherFinder) Close() + func (wf *WeatherFinder) Find(city string, kind string) (*WeatherResult, error) + func (wf *WeatherFinder) Version() string + type WeatherResult map[string]interface + func (wr *WeatherResult) Json() string + func HeWeatherFind(wf *WeatherFinder, city string, kind string) (*WeatherResult, error)