Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocationByIp ¶
func GetLocationByIp(secretKey, ip string, location *IPLocationData) error
Types ¶
type IPLocation ¶
type IPLocation struct { Code int `json:"code"` //返回码 200成功 Msg string `json:"msg"` //返回消息 Data IPLocationData `json:"data"` }
type IPLocationData ¶
type IPLocationData struct { AreaCode string `json:"area_code"` //: "320311", Province string `json:"province"` //省: "江苏", City string `json:"city"` //: "徐州", District string `json:"district"` //: "丰县", CityCode string `json:"city_code"` //: "0516", Continent string `json:"continent"` //: "亚洲", Country string `json:"country"` //: "中国", CountryCode string `json:"country_code"` //: "CN", CountryEnglish string `json:"country_english"` //: "", Elevation string `json:"elevation"` //: "40", Ip string `json:"ip"` //: "114.234.76.140", Isp string `json:"isp"` //: "电信", Latitude string `json:"latitude"` //: "34.227883", LocalTime string `json:"local_time"` //: "2023-08-02 14:36", Longitude string `json:"longitude"` //: "117.213995", MultiStreet []Street `json:"multi_street"` Street string `json:"street"` //: "解放路168号", Version string `json:"version"` //: "V4", WeatherStation string `json:"weather_station"` //: "CHXX0437", ZipCode string `json:"zip_code"` //: "221006" }
type Street ¶
type Street struct { Lng string `json:"lng"` //经度: "116.60833", Lat string `json:"lat"` //纬度: "34.701533", Province string `json:"province"` //省: "江苏", City string `json:"city"` //: "徐州", District string `json:"district"` //: "丰县", Street string `json:"street"` //: "解放路168号", StreetNumber string `json:"street_number"` //: "解放路168号" }
Click to show internal directories.
Click to hide internal directories.