Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun)
- func (c *Client) GetAk() string
- func (c *Client) GetLog() *golog.ApiClient
- func (c *Client) LocationIp(ctx context.Context, ip string, notMustParams ...gorequest.Params) (*LocationIpResult, error)
- func (c *Client) Weather(ctx context.Context, districtId string, notMustParams ...gorequest.Params) (*WeatherResult, error)
- type ClientConfig
- type LocationIpResponse
- type LocationIpResult
- type WeatherResponse
- type WeatherResult
Constants ¶
View Source
const (
LogTable = "baidu"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConfigApiClientFun ¶ added in v1.0.126
func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun)
ConfigApiClientFun 日志配置
func (*Client) LocationIp ¶ added in v1.0.126
func (c *Client) LocationIp(ctx context.Context, ip string, notMustParams ...gorequest.Params) (*LocationIpResult, error)
LocationIp 普通IP定位 https://lbsyun.baidu.com/index.php?title=webapi/ip-api
type LocationIpResponse ¶ added in v1.0.126
type LocationIpResponse struct { Address string `json:"address"` // 详细地址信息 Content struct { AddressDetail struct { Province string `json:"province"` // 省份 City string `json:"city"` // 城市 District string `json:"district"` Street string `json:"street"` StreetNumber string `json:"street_number"` CityCode int `json:"city_code"` // 百度城市代码 Adcode string `json:"adcode"` } `json:"address_detail"` Address string `json:"address"` // 简要地址信息 Point struct { X string `json:"x"` // 当前城市中心点经度 Y string `json:"y"` // 当前城市中心点纬度 } `json:"point"` } `json:"content"` Status int `json:"status"` }
type LocationIpResult ¶ added in v1.0.126
type LocationIpResult struct { Result LocationIpResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type WeatherResponse ¶ added in v1.0.126
type WeatherResponse struct { Status int `json:"status"` Result struct { Location struct { Country string `json:"country"` Province string `json:"province"` City string `json:"city"` Name string `json:"name"` Id string `json:"id"` } `json:"location"` Now struct { Text string `json:"text"` Temp int `json:"temp"` FeelsLike int `json:"feels_like"` Rh int `json:"rh"` WindClass string `json:"wind_class"` WindDir string `json:"wind_dir"` Uptime string `json:"uptime"` } `json:"now"` Forecasts []struct { TextDay string `json:"text_day"` TextNight string `json:"text_night"` High int `json:"high"` Low int `json:"low"` WcDay string `json:"wc_day"` WdDay string `json:"wd_day"` WcNight string `json:"wc_night"` WdNight string `json:"wd_night"` Date string `json:"date"` Week string `json:"week"` } `json:"forecasts"` } `json:"result"` Message string `json:"message"` }
type WeatherResult ¶ added in v1.0.126
type WeatherResult struct { Result WeatherResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
Click to show internal directories.
Click to hide internal directories.