feat: geo ip.

This commit is contained in:
tx7do
2023-10-19 15:27:32 +08:00
parent 01bdf5cc06
commit 7965576c1c
8 changed files with 73 additions and 34 deletions

15
geoip/geoip.go Normal file
View File

@@ -0,0 +1,15 @@
package geoip
// Result 归属地信息
type Result struct {
IP string `json:"ip"`
Country string `json:"country"` // 国家
Province string `json:"province"` // 省
City string `json:"city"` // 城市
ISP string `json:"isp"` // 服务提供商
}
// GeoIP 客户端
type GeoIP interface {
Query(queryIp string) (res Result, err error)
}