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
+24
View File
@@ -0,0 +1,24 @@
package db
import "errors"
// Constants for database names and paths
const (
CityDBName = "GeoLite2-City"
ASNDBName = "GeoLite2-ASN"
DBExtension = ".mmdb"
CityDBPath = CityDBName + DBExtension
ASNDBPath = ASNDBName + DBExtension
)
// Error messages
var (
ErrDatabaseOpen = errors.New("failed to open database")
ErrDownloadFailed = errors.New("failed to download database")
)
// ASNRecord represents a record in the ASN database
type ASNRecord struct {
AutonomousSystemNumber uint `maxminddb:"autonomous_system_number"`
AutonomousSystemOrganization string `maxminddb:"autonomous_system_organization"`
}