Documentation ¶
Index ¶
- type City
- type CityLite
- type CityLiteDb
- type Country
- type Database
- type GeoName
- type GeoNameAdminSubdivision
- func (s GeoNameAdminSubdivision) AdminCode() string
- func (s GeoNameAdminSubdivision) CountryCode() string
- func (s GeoNameAdminSubdivision) GeoNameID() int
- func (s GeoNameAdminSubdivision) MarshalJSON() ([]byte, error)
- func (s GeoNameAdminSubdivision) Name() string
- func (s *GeoNameAdminSubdivision) UnmarshalJSON(data []byte) error
- type GeoNameContinent
- type GeoNameCountry
- type GeoNameEntity
- type GeoNameFilter
- type ISP
- type LocationLite
- type MetaData
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:"geoNameID,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"city" json:"city,omitempty"` Continent struct { Code string `maxminddb:"code" json:"code,omitempty"` GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"continent" json:"continent,omitempty"` Country struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"country" json:"country,omitempty"` Location struct { AccuracyRadius uint16 `maxminddb:"accuracy_radius" json:"accuracyRadius,omitempty"` Latitude float64 `maxminddb:"latitude" json:"latitude,omitempty"` Longitude float64 `maxminddb:"longitude" json:"longitude,omitempty"` MetroCode uint `maxminddb:"metro_code" json:"metroCode,omitempty"` TimeZone string `maxminddb:"time_zone" json:"timeZone,omitempty"` } `maxminddb:"location" json:"location,omitempty"` Postal struct { Code string `maxminddb:"code" json:"code,omitempty"` } `maxminddb:"postal" json:"postal,omitempty"` RegisteredCountry struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"registered_country" json:"registeredCountry,omitempty"` RepresentedCountry struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` Type string `maxminddb:"type" json:"type,omitempty"` } `maxminddb:"represented_country" json:"representedCountry,omitempty"` Subdivisions []struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"subdivisions" json:"subdivisions,omitempty"` Traits struct { IsAnonymousProxy bool `maxminddb:"is_anonymous_proxy" json:"isAnonymousProxy,omitempty"` IsSatelliteProvider bool `maxminddb:"is_satellite_provider" json:"isSatelliteProvider,omitempty"` } `maxminddb:"traits" json:"traits,omitempty"` ISP *ISP `json:"ISP,omitempty"` }
var PrivateCity City
func (City) MarshalCSV ¶
func (City) ToMMDBType ¶
type CityLite ¶
type CityLite struct { City struct { Name string `json:"name,omitempty"` } `json:"city,omitempty"` Country struct { ISOCode string `json:"isoCode,omitempty"` Name string `json:"name,omitempty"` } `json:"country,omitempty"` Location LocationLite `json:"location,omitempty"` }
func DbToCityLite ¶
func DbToCityLite(cityLiteDb *CityLiteDb, lang string) *CityLite
type CityLiteDb ¶
type CityLiteDb struct { City struct { Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"city" json:"city,omitempty"` Country struct { ISOCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"country" json:"country,omitempty"` Location LocationLite `maxminddb:"location" json:"location,omitempty"` }
type Country ¶
type Country struct { Continent struct { Code string `maxminddb:"code" json:"code,omitempty"` GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"continent" json:"continent,omitempty"` Country struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"country" json:"country,omitempty"` RegisteredCountry struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` } `maxminddb:"registered_country" json:"registeredCountry,omitempty"` RepresentedCountry struct { GeoNameID uint `maxminddb:"geoname_id" json:"geoNameID,omitempty"` IsInEuropeanUnion bool `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"` IsoCode string `maxminddb:"iso_code" json:"isoCode,omitempty"` Names map[string]string `maxminddb:"names" json:"names,omitempty"` Type string `maxminddb:"type" json:"type,omitempty"` } `maxminddb:"represented_country" json:"representedCountry,omitempty"` Traits struct { IsAnonymousProxy bool `maxminddb:"is_anonymous_proxy" json:"isAnonymousProxy,omitempty"` IsSatelliteProvider bool `maxminddb:"is_satellite_provider" json:"isSatelliteProvider,omitempty"` } `maxminddb:"traits" json:"traits,omitempty"` }
type GeoName ¶
func (GeoName) CountryCode ¶
func (GeoName) MarshalJSON ¶
func (*GeoName) UnmarshalJSON ¶
type GeoNameAdminSubdivision ¶
type GeoNameAdminSubdivision struct {
*models.AdminDivision
}
func (GeoNameAdminSubdivision) AdminCode ¶
func (s GeoNameAdminSubdivision) AdminCode() string
func (GeoNameAdminSubdivision) CountryCode ¶
func (s GeoNameAdminSubdivision) CountryCode() string
func (GeoNameAdminSubdivision) GeoNameID ¶
func (s GeoNameAdminSubdivision) GeoNameID() int
func (GeoNameAdminSubdivision) MarshalJSON ¶
func (s GeoNameAdminSubdivision) MarshalJSON() ([]byte, error)
func (GeoNameAdminSubdivision) Name ¶
func (s GeoNameAdminSubdivision) Name() string
func (*GeoNameAdminSubdivision) UnmarshalJSON ¶
func (s *GeoNameAdminSubdivision) UnmarshalJSON(data []byte) error
type GeoNameContinent ¶
type GeoNameContinent struct {
// contains filtered or unexported fields
}
func NewGeoNameContinent ¶
func NewGeoNameContinent(geonameID int, code, name string) *GeoNameContinent
func (GeoNameContinent) Code ¶
func (c GeoNameContinent) Code() string
func (GeoNameContinent) CountryCode ¶
func (c GeoNameContinent) CountryCode() string
func (GeoNameContinent) GeoNameID ¶
func (c GeoNameContinent) GeoNameID() int
func (GeoNameContinent) MarshalJSON ¶
func (s GeoNameContinent) MarshalJSON() ([]byte, error)
func (GeoNameContinent) Name ¶
func (c GeoNameContinent) Name() string
func (*GeoNameContinent) UnmarshalJSON ¶
func (s *GeoNameContinent) UnmarshalJSON(data []byte) error
type GeoNameCountry ¶
func (GeoNameCountry) CountryCode ¶
func (s GeoNameCountry) CountryCode() string
func (GeoNameCountry) GeoNameID ¶
func (s GeoNameCountry) GeoNameID() int
func (GeoNameCountry) MarshalJSON ¶
func (s GeoNameCountry) MarshalJSON() ([]byte, error)
func (GeoNameCountry) Name ¶
func (s GeoNameCountry) Name() string
func (*GeoNameCountry) UnmarshalJSON ¶
func (s *GeoNameCountry) UnmarshalJSON(data []byte) error
type GeoNameEntity ¶
type GeoNameFilter ¶
type GeoNameFilter struct { GeoNameIDs []uint32 `schema:"geoname-ids"` CountryCodes []string `schema:"country-codes"` NamePrefix string `schema:"name-prefix"` Limit uint32 `schema:"limit"` }
func (*GeoNameFilter) Match ¶
func (f *GeoNameFilter) Match(e GeoNameEntity) bool
type ISP ¶
type ISP struct { AutonomousSystemOrganization string `maxminddb:"autonomous_system_organization"` ISP string `maxminddb:"isp"` MobileCountryCode string `maxminddb:"mobile_country_code"` MobileNetworkCode string `maxminddb:"mobile_network_code"` Organization string `maxminddb:"organization"` AutonomousSystemNumber uint `maxminddb:"autonomous_system_number"` }
The ISP struct corresponds to the data in the GeoIP2 ISP database.
func (ISP) MarshalCSV ¶
type LocationLite ¶
Click to show internal directories.
Click to hide internal directories.