You've already forked armbian-router
mirror of
https://github.com/armbian/armbian-router.git
synced 2026-01-06 10:37:03 -08:00
- Clears cache on server state change (prevents no servers being available) - Improves speed of GetValue using generated getters - Moves maxminddb items into db package - Moves util.go into util package - Updates dependencies
41 lines
1.6 KiB
Go
41 lines
1.6 KiB
Go
package db
|
|
|
|
// City represents a MaxmindDB city.
|
|
// This used to only be used on load, but is now used with rules as well.
|
|
type City struct {
|
|
Continent Continent `maxminddb:"continent" json:"continent"`
|
|
Country Country `maxminddb:"country" json:"country"`
|
|
Location Location `maxminddb:"location"`
|
|
RegisteredCountry RegisteredCountry `maxminddb:"registered_country" json:"registered_country"`
|
|
}
|
|
|
|
type Continent struct {
|
|
Code string `maxminddb:"code" json:"code"`
|
|
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id"`
|
|
Names map[string]string `maxminddb:"names" json:"names"`
|
|
}
|
|
|
|
type Country struct {
|
|
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id"`
|
|
IsoCode string `maxminddb:"iso_code" json:"iso_code"`
|
|
Names map[string]string `maxminddb:"names" json:"names"`
|
|
}
|
|
|
|
type Location struct {
|
|
AccuracyRadius uint16 `maxminddb:"accuracy_radius" json:"accuracy_radius"`
|
|
Latitude float64 `maxminddb:"latitude" json:"latitude"`
|
|
Longitude float64 `maxminddb:"longitude" json:"longitude"`
|
|
}
|
|
|
|
type RegisteredCountry struct {
|
|
GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id"`
|
|
IsoCode string `maxminddb:"iso_code" json:"iso_code"`
|
|
Names map[string]string `maxminddb:"names" json:"names"`
|
|
}
|
|
|
|
// The ASN struct corresponds to the data in the GeoLite2 ASN database.
|
|
type ASN struct {
|
|
AutonomousSystemNumber uint `maxminddb:"autonomous_system_number"`
|
|
AutonomousSystemOrganization string `maxminddb:"autonomous_system_organization"`
|
|
}
|