This commit is contained in:
ryan
2026-06-18 16:51:06 +08:00
parent 61cfacba55
commit e3bfd9ca6d
40 changed files with 2819 additions and 116 deletions
@@ -34,6 +34,11 @@ func IsValidProvider(provider string) bool {
return pkggeoip.IsValidProvider(provider)
}
// GeoInfoFromIP resolves geographic information using the configured default provider.
func GeoInfoFromIP(ip net.IP) (*pkggeoip.GeoInfo, error) {
return pkggeoip.GetGeoInfo(ip)
}
// Lookup resolves geographic information for rawIP using the given provider.
func Lookup(provider, rawIP string) (*LookupView, error) {
trimmedProvider := strings.TrimSpace(provider)