add domain whois/dns support, refactor codebase

This commit is contained in:
2025-09-17 20:38:51 +02:00
parent 477bc242aa
commit 16fc344a68
29 changed files with 1396 additions and 867 deletions
+28
View File
@@ -0,0 +1,28 @@
package db
import (
"net"
"github.com/oschwald/maxminddb-golang"
)
// GetCityDB retrieves the city database reader.
func (g *GeoIPManager) GetCityDB() *maxminddb.Reader {
g.mu.RLock()
defer g.mu.RUnlock()
return g.cityDB
}
// GetASNDB retrieves the ASN database reader.
func (g *GeoIPManager) GetASNDB() *maxminddb.Reader {
g.mu.RLock()
defer g.mu.RUnlock()
return g.asnDB
}
// GetASNPrefixes retrieves the list of IP prefixes for a given ASN.
func (g *GeoIPManager) GetASNPrefixes(asn uint) []*net.IPNet {
g.mu.RLock()
defer g.mu.RUnlock()
return g.asnPrefixMap[asn]
}