Documentation
¶
Overview ¶
Package location fetches geolocation data
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type City ¶
type City struct { City struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id" xml:"geoname_id"` Names xmlMap `maxminddb:"names" json:"names" xml:"names"` } `maxminddb:"city" json:"city" xml:"city"` Continent struct { Code string `maxminddb:"code" json:"code" xml:"code"` GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id" xml:"geoname_id"` Names xmlMap `maxminddb:"names" json:"names" xml:"names"` } `maxminddb:"continent" json:"continent" xml:"continent"` Country struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id" xml:"geoname_id"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_eu" xml:"is_eu"` IsoCode string `maxminddb:"iso_code" json:"iso_code" xml:"iso_code"` Names xmlMap `maxminddb:"names" json:"names" xml:"names"` } `maxminddb:"country" json:"country" xml:"country"` Location struct { AccuracyRadius uint16 `maxminddb:"accuracy_radius" json:"accuracy_radius" xml:"accuracy_radius"` Latitude float64 `maxminddb:"latitude" json:"latitude" xml:"latitude"` Longitude float64 `maxminddb:"longitude" json:"longitude" xml:"longitude"` MetroCode uint `maxminddb:"metro_code" json:"metro_code" xml:"metro_code"` TimeZone string `maxminddb:"time_zone" json:"time_zone" xml:"time_zone"` } `maxminddb:"location" json:"location" xml:"location"` Postal struct { Code string `maxminddb:"code" json:"code" xml:"code"` } `maxminddb:"postal" json:"postal" xml:"postal"` RegisteredCountry struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id" xml:"geoname_id"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_eu" xml:"is_eu"` IsoCode string `maxminddb:"iso_code" json:"iso_code" xml:"iso_code"` Names xmlMap `maxminddb:"names" json:"names" xml:"names"` } `maxminddb:"registered_country" json:"registered_country" xml:"registered_country"` RepresentedCountry struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id" xml:"geoname_id"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"is_eu" xml:"is_eu"` IsoCode string `maxminddb:"iso_code" json:"iso_code" xml:"iso_code"` Names xmlMap `maxminddb:"names" json:"names" xml:"names"` Type string `maxminddb:"type" json:"type" xml:"type"` } `maxminddb:"represented_country" json:"represented_country" xml:"represented_country"` Subdivisions []Subdivision `maxminddb:"subdivisions" json:"subdivisions" xml:"subdivisions"` Traits struct { IsAnonymousProxy bool `maxminddb:"is_anonymous_proxy" json:"is_anonymous_proxy" xml:"is_anonymous_proxy"` IsSatelliteProvider bool `maxminddb:"is_satellite_provider" json:"is_satellite_provider" xml:"is_satellite_provider"` } `maxminddb:"traits" json:"traits" xml:"traits"` }
City is like geoip2.City but adds json tags
type MaxMind ¶
type MaxMind struct {
DB string // location of MaxMind database
}
MaxMind is a location data provider For install instructions: https://dev.maxmind.com/geoip/geoipupdate/
type Subdivision ¶
type Subdivision struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoname_id" xml:"geoname_id"` IsoCode string `maxminddb:"iso_code" json:"iso_code" xml:"iso_code"` Names xmlMap `maxminddb:"names" json:"names" xml:"names"` }
Subdivision adds json tags to maxmind
Click to show internal directories.
Click to hide internal directories.