feat: geo ip.

This commit is contained in:
tx7do
2023-10-19 15:05:49 +08:00
parent 92be8b878a
commit 01bdf5cc06
21 changed files with 343 additions and 38 deletions

20
geoip/qqwry/consts.go Normal file
View File

@@ -0,0 +1,20 @@
package qqwry
const (
ipRecordLength = 7 // IndexLen 索引长度
redirectMode1 = 0x01 // RedirectMode1 国家的类型, 指向另一个指向
redirectMode2 = 0x02 // RedirectMode2 国家的类型, 指向一个指向
)
//var unCountry = []byte{"未知国家"}
//var unArea = []byte{"未知地区"}
// Result 归属地信息
type Result struct {
IP string `json:"ip"`
Country string `json:"country"`
Area string `json:"area"`
ISP string `json:"isp"`
}