mirror of
https://github.com/skidoodle/ipinfo.git
synced 2026-04-28 17:37:37 +02:00
25 lines
631 B
Go
25 lines
631 B
Go
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"`
|
|
}
|