mirror of
https://github.com/zu1k/nali.git
synced 2025-03-11 19:02:03 +08:00
feat: add country code to geoip json output
This commit is contained in:
parent
0eb07b49ad
commit
214d935a25
@ -49,6 +49,7 @@ func (g GeoIP) Find(query string, params ...string) (result fmt.Stringer, err er
|
|||||||
|
|
||||||
result = Result{
|
result = Result{
|
||||||
Country: record.Country.Names[lang],
|
Country: record.Country.Names[lang],
|
||||||
|
CountryCode: record.Country.IsoCode,
|
||||||
Area: record.City.Names[lang],
|
Area: record.City.Names[lang],
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -60,6 +61,7 @@ func (db GeoIP) Name() string {
|
|||||||
|
|
||||||
type Result struct {
|
type Result struct {
|
||||||
Country string `json:"country"`
|
Country string `json:"country"`
|
||||||
|
CountryCode string `json:"country_code"`
|
||||||
Area string `json:"area"`
|
Area string `json:"area"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user