main.go 364 B

1234567891011121314151617
  1. package cz88ip
  2. type IpInfo struct {
  3. Country string // 国家
  4. Region string // 省,市,区
  5. LastUpdate int64 // 上次刷新时间
  6. }
  7. func GetCountryAndRegion(ipAddress string) (country string, region string) {
  8. ipInfo := GetIpManager().getIpInfo(ipAddress)
  9. if ipInfo == nil {
  10. return
  11. }
  12. country = ipInfo.Country
  13. region = ipInfo.Region
  14. return
  15. }