Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) ConfigApiGormFun(apiClientFun golog.ApiGormFun)
- func (c *Client) GeocodeGeo(ctx context.Context, address string, notMustParams ...gorequest.Params) (*GeocodeGeoResult, error)
- func (c *Client) GeocodeRegeo(ctx context.Context, location string, notMustParams ...gorequest.Params) (*GeocodeRegeoResult, error)
- func (c *Client) GetKey() string
- func (c *Client) Ip(ctx context.Context, ip string, notMustParams ...gorequest.Params) (*IpResult, error)
- func (c *Client) V3ConfigDistrict(ctx context.Context, notMustParams ...gorequest.Params) (*V3ConfigDistrictResult, error)
- func (c *Client) WeatherWeatherInfo(ctx context.Context, city string, notMustParams ...gorequest.Params) (*WeatherWeatherInfoResult, error)
- type ClientConfig
- type GeocodeGeoResponse
- type GeocodeGeoResult
- type GeocodeRegeoResponse
- type GeocodeRegeoResult
- type IpResponse
- type IpResult
- type V3ConfigDistrictResponse
- type V3ConfigDistrictResult
- type WeatherWeatherInfoResponse
- type WeatherWeatherInfoResult
Constants ¶
View Source
const (
LogTable = "amap"
)
View Source
const (
Version = "1.0.2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) ConfigApiGormFun ¶
func (c *Client) ConfigApiGormFun(apiClientFun golog.ApiGormFun)
ConfigApiGormFun 接口日志配置
func (*Client) GeocodeGeo ¶
func (c *Client) GeocodeGeo(ctx context.Context, address string, notMustParams ...gorequest.Params) (*GeocodeGeoResult, error)
GeocodeGeo 地理编码 https://lbs.amap.com/api/webservice/guide/api/georegeo
func (*Client) GeocodeRegeo ¶
func (c *Client) GeocodeRegeo(ctx context.Context, location string, notMustParams ...gorequest.Params) (*GeocodeRegeoResult, error)
GeocodeRegeo 逆地理编码 https://lbs.amap.com/api/webservice/guide/api/georegeo
func (*Client) Ip ¶
func (c *Client) Ip(ctx context.Context, ip string, notMustParams ...gorequest.Params) (*IpResult, error)
Ip IP定位 https://lbs.amap.com/api/webservice/guide/api/ipconfig
func (*Client) V3ConfigDistrict ¶
func (c *Client) V3ConfigDistrict(ctx context.Context, notMustParams ...gorequest.Params) (*V3ConfigDistrictResult, error)
V3ConfigDistrict 行政区域查询 https://lbs.amap.com/api/webservice/guide/api/district
func (*Client) WeatherWeatherInfo ¶
func (c *Client) WeatherWeatherInfo(ctx context.Context, city string, notMustParams ...gorequest.Params) (*WeatherWeatherInfoResult, error)
WeatherWeatherInfo 天气查询 https://lbs.amap.com/api/webservice/guide/api/weatherinfo
type GeocodeGeoResponse ¶
type GeocodeGeoResponse struct {
Status string `json:"status"`
Info string `json:"info"`
Infocode string `json:"infocode"`
Count string `json:"count"`
Geocodes []struct {
FormattedAddress string `json:"formatted_address"`
Country string `json:"country"`
Province string `json:"province"`
Citycode string `json:"citycode"`
City string `json:"city"`
District string `json:"district"`
Township []interface{} `json:"township"`
Neighborhood struct {
Name []interface{} `json:"name"`
Type []interface{} `json:"type"`
} `json:"neighborhood"`
Building struct {
Name []interface{} `json:"name"`
Type []interface{} `json:"type"`
} `json:"building"`
Adcode string `json:"adcode"`
Street string `json:"street"`
Number string `json:"number"`
Location string `json:"location"`
Level string `json:"level"`
} `json:"geocodes"`
}
type GeocodeGeoResult ¶
type GeocodeGeoResult struct {
Result GeocodeGeoResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type GeocodeRegeoResponse ¶
type GeocodeRegeoResponse struct {
Status string `json:"status"`
Regeocode struct {
Roads []struct {
Id string `json:"id"`
Location string `json:"location"`
Direction string `json:"direction"`
Name string `json:"name"`
Distance string `json:"distance"`
} `json:"roads"`
Roadinters []struct {
SecondName string `json:"second_name"`
FirstId string `json:"first_id"`
SecondId string `json:"second_id"`
Location string `json:"location"`
Distance string `json:"distance"`
FirstName string `json:"first_name"`
Direction string `json:"direction"`
} `json:"roadinters"`
FormattedAddress string `json:"formatted_address"`
AddressComponent struct {
City []interface{} `json:"city"`
Province string `json:"province"`
Adcode string `json:"adcode"`
District string `json:"district"`
Towncode string `json:"towncode"`
StreetNumber struct {
Number string `json:"number"`
Location string `json:"location"`
Direction string `json:"direction"`
Distance string `json:"distance"`
Street string `json:"street"`
} `json:"streetNumber"`
Country string `json:"country"`
Township string `json:"township"`
BusinessAreas []struct {
Location string `json:"location"`
Name string `json:"name"`
Id string `json:"id"`
} `json:"businessAreas"`
Building struct {
Name string `json:"name"`
Type string `json:"type"`
} `json:"building"`
Neighborhood struct {
Name string `json:"name"`
Type string `json:"type"`
} `json:"neighborhood"`
Citycode string `json:"citycode"`
} `json:"addressComponent"`
Aois []struct {
Area string `json:"area"`
Type string `json:"type"`
Id string `json:"id"`
Location string `json:"location"`
Adcode string `json:"adcode"`
Name string `json:"name"`
Distance string `json:"distance"`
} `json:"aois"`
Pois []struct {
Id string `json:"id"`
Direction string `json:"direction"`
Businessarea string `json:"businessarea"`
Address string `json:"address"`
Poiweight string `json:"poiweight"`
Name string `json:"name"`
Location string `json:"location"`
Distance string `json:"distance"`
Tel interface{} `json:"tel"`
Type string `json:"type"`
} `json:"pois"`
} `json:"regeocode"`
Info string `json:"info"`
Infocode string `json:"infocode"`
}
type GeocodeRegeoResult ¶
type GeocodeRegeoResult struct {
Result GeocodeRegeoResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type IpResponse ¶
type IpResponse struct {
Status string `json:"status"` // 值为0或1,0表示失败;1表示成功
Info string `json:"info"` // 返回状态说明,status为0时,info返回错误原因,否则返回“OK”。
Infocode string `json:"infocode"` // 返回状态说明,10000代表正确,详情参阅info状态表
Province string `json:"province"` // 若为直辖市则显示直辖市名称; 如果在局域网 IP网段内,则返回“局域网”; 非法IP以及国外IP则返回空
City string `json:"city"` // 若为直辖市则显示直辖市名称; 如果为局域网网段内IP或者非法IP或国外IP,则返回空
Adcode string `json:"adcode"` // 城市的adcode编码
Rectangle string `json:"rectangle"` // 所在城市矩形区域范围
}
type IpResult ¶
type IpResult struct {
Result IpResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type V3ConfigDistrictResponse ¶
type V3ConfigDistrictResponse struct {
Status string `json:"status"` // 值为0或1 1:成功;0:失败
Info string `json:"info"` // 返回的状态信息
Infocode string `json:"infocode"` // 返回状态说明,10000代表正确
Count string `json:"count"` // 返回结果总数目
Suggestion struct {
Keywords []interface{} `json:"keywords"` // 建议关键字列表
Cities []interface{} `json:"cities"` // 建议城市列表
} `json:"suggestion"` // 建议结果列表
Districts []struct {
//Citycode []interface{} `json:"citycode,omitempty"` // 城市编码
Adcode string `json:"adcode"` // 区域编码
Name string `json:"name"` // 行政区名称
Polyline string `json:"polyline,omitempty"` // 行政区边界坐标点
Center string `json:"center"` // 区域中心点
Level string `json:"level"` // 行政区划级别
Districts []struct {
//Citycode []interface{} `json:"citycode,omitempty"` // 城市编码
Adcode string `json:"adcode"` // 区域编码
Name string `json:"name"` // 行政区名称
Polyline string `json:"polyline,omitempty"` // 行政区边界坐标点
Center string `json:"center"` // 区域中心点
Level string `json:"level"` // 行政区划级别
Districts []struct {
//Citycode interface{} `json:"citycode,omitempty"` // 城市编码
Adcode string `json:"adcode"` // 区域编码
Name string `json:"name"` // 行政区名称
Polyline string `json:"polyline"` // 行政区边界坐标点
Center string `json:"center"` // 区域中心点
Level string `json:"level"` // 行政区划级别
Districts []struct {
//Citycode interface{} `json:"citycode,omitempty"` // 城市编码
Adcode string `json:"adcode"` // 区域编码
Name string `json:"name"` // 行政区名称
Polyline string `json:"polyline"` // 行政区边界坐标点
Center string `json:"center"` // 区域中心点
Level string `json:"level"` // 行政区划级别
Districts []interface{} `json:"districts,omitempty"` // 下级行政区列表
} `json:"districts"`
} `json:"districts"`
} `json:"districts"`
} `json:"districts"` // 行政区列表
}
type V3ConfigDistrictResult ¶
type V3ConfigDistrictResult struct {
Result V3ConfigDistrictResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type WeatherWeatherInfoResponse ¶
type WeatherWeatherInfoResponse struct {
Status string `json:"status"` // 值为0或1 1:成功;0:失败
Count string `json:"count"` // 返回结果总数目
Info string `json:"info"` // 返回的状态信息
Infocode string `json:"infocode"` // 返回状态说明,10000代表正确
Lives []struct {
Province string `json:"province"` // 省份名
City string `json:"city"` // 城市名
Adcode string `json:"adcode"` // 区域编码
Weather string `json:"weather"` // 天气现象(汉字描述)
Temperature string `json:"temperature"` // 实时气温,单位:摄氏度
Winddirection string `json:"winddirection"` // 风向描述
Windpower string `json:"windpower"` // 风力级别,单位:级
Humidity string `json:"humidity"` // 空气湿度
Reporttime string `json:"reporttime"` // 数据发布的时间
TemperatureFloat string `json:"temperature_float"` // 温度
HumidityFloat string `json:"humidity_float"` // 湿度
} `json:"lives"` // 实况天气数据信息
Forecasts []struct {
City string `json:"city"` // 城市名称
Adcode string `json:"adcode"` // 城市编码
Province string `json:"province"` // 省份名称
Reporttime string `json:"reporttime"` // 预报发布时间
Casts []struct {
Date string `json:"date"` // 日期
Week string `json:"week"` // 星期几
Dayweather string `json:"dayweather"` // 白天天气现象
Nightweather string `json:"nightweather"` // 晚上天气现象
Daytemp string `json:"daytemp"` // 白天温度
Nighttemp string `json:"nighttemp"` // 晚上温度
Daywind string `json:"daywind"` // 白天风向
Nightwind string `json:"nightwind"` // 晚上风向
Daypower string `json:"daypower"` // 白天风力
Nightpower string `json:"nightpower"` // 晚上风力
DaytempFloat string `json:"daytemp_float"` // 日温度
NighttempFloat string `json:"nighttemp_float"` // 夜间温度
} `json:"casts"` // 预报数据list结构,元素cast,按顺序为当天、第二天、第三天的预报数据
} `json:"forecasts"` // 预报天气信息数据
}
type WeatherWeatherInfoResult ¶
type WeatherWeatherInfoResult struct {
Result WeatherWeatherInfoResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
Click to show internal directories.
Click to hide internal directories.