Documentation
¶
Index ¶
- type City
- type CityLite
- type CityLiteDb
- type Comparable
- type Country
- type DBUpdate
- type Database
- type GeoName
- func (g GeoName) GetCityName() string
- func (g GeoName) GetContinentCode() string
- func (g GeoName) GetContinentName() string
- func (g GeoName) GetCountryCode() string
- func (g GeoName) GetCountryName() string
- func (g GeoName) GetGeoNameID() int
- func (g GeoName) GetName() string
- func (g GeoName) GetSubdivisionName() string
- func (g GeoName) GetTimeZone() string
- func (s GeoName) MarshalJSON() ([]byte, error)
- func (s *GeoName) UnmarshalJSON(data []byte) error
- type GeoNameAdminSubdivision
- func (s GeoNameAdminSubdivision) AdminCode() string
- func (s GeoNameAdminSubdivision) GetCityName() string
- func (s GeoNameAdminSubdivision) GetContinentCode() string
- func (s GeoNameAdminSubdivision) GetContinentName() string
- func (s GeoNameAdminSubdivision) GetCountryCode() string
- func (s GeoNameAdminSubdivision) GetCountryName() string
- func (s GeoNameAdminSubdivision) GetGeoNameID() int
- func (s GeoNameAdminSubdivision) GetName() string
- func (s GeoNameAdminSubdivision) GetSubdivisionName() string
- func (s GeoNameAdminSubdivision) GetTimeZone() string
- func (s GeoNameAdminSubdivision) MarshalJSON() ([]byte, error)
- func (s *GeoNameAdminSubdivision) UnmarshalJSON(data []byte) error
- type GeoNameContinent
- func (c GeoNameContinent) Code() string
- func (c GeoNameContinent) GetCityName() string
- func (c GeoNameContinent) GetContinentCode() string
- func (c GeoNameContinent) GetContinentName() string
- func (c GeoNameContinent) GetCountryCode() string
- func (c GeoNameContinent) GetCountryName() string
- func (c GeoNameContinent) GetGeoNameID() int
- func (c GeoNameContinent) GetName() string
- func (c GeoNameContinent) GetSubdivisionName() string
- func (c GeoNameContinent) GetTimeZone() string
- func (s GeoNameContinent) MarshalJSON() ([]byte, error)
- func (s *GeoNameContinent) UnmarshalJSON(data []byte) error
- type GeoNameCountry
- func (s GeoNameCountry) GetCityName() string
- func (s GeoNameCountry) GetContinentCode() string
- func (s GeoNameCountry) GetContinentName() string
- func (s GeoNameCountry) GetCountryCode() string
- func (s GeoNameCountry) GetCountryName() string
- func (s GeoNameCountry) GetGeoNameID() int
- func (s GeoNameCountry) GetName() string
- func (s GeoNameCountry) GetSubdivisionName() string
- func (s GeoNameCountry) GetTimeZone() string
- func (s GeoNameCountry) MarshalJSON() ([]byte, error)
- func (s *GeoNameCountry) UnmarshalJSON(data []byte) error
- type GeoNameEntity
- type GeoNameFilter
- type GeoNamesVersion
- type ISP
- type LocationLite
- type MMDBVersion
- type MetaData
- type ModTimeVersion
- type PatchVersion
- type PatchedGeoNamesVersion
- type PatchedMMDBVersion
- type Update
- type Version
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 Comparable ¶
type Comparable[V any] = source.Comparable[V]
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 DBUpdate ¶
type GeoName ¶
type GeoName struct {
*models.Geoname
ContinentCode string `csv:"continent code"`
ContinentName string `csv:"continent name"`
CountryName string `csv:"country name"`
SubdivisionName string `csv:"subdivision name"`
}
func (GeoName) GetCityName ¶
func (GeoName) GetContinentCode ¶
func (GeoName) GetContinentName ¶
func (GeoName) GetCountryCode ¶
func (GeoName) GetCountryName ¶
func (GeoName) GetGeoNameID ¶
func (GeoName) GetSubdivisionName ¶
func (GeoName) GetTimeZone ¶
func (GeoName) MarshalJSON ¶
func (*GeoName) UnmarshalJSON ¶
type GeoNameAdminSubdivision ¶
type GeoNameAdminSubdivision struct {
*models.AdminDivision
ContinentCode string `csv:"continent code"`
ContinentName string `csv:"continent name"`
CountryName string `csv:"country name"`
}
func (GeoNameAdminSubdivision) AdminCode ¶
func (s GeoNameAdminSubdivision) AdminCode() string
func (GeoNameAdminSubdivision) GetCityName ¶
func (s GeoNameAdminSubdivision) GetCityName() string
func (GeoNameAdminSubdivision) GetContinentCode ¶
func (s GeoNameAdminSubdivision) GetContinentCode() string
func (GeoNameAdminSubdivision) GetContinentName ¶
func (s GeoNameAdminSubdivision) GetContinentName() string
func (GeoNameAdminSubdivision) GetCountryCode ¶
func (s GeoNameAdminSubdivision) GetCountryCode() string
func (GeoNameAdminSubdivision) GetCountryName ¶
func (s GeoNameAdminSubdivision) GetCountryName() string
func (GeoNameAdminSubdivision) GetGeoNameID ¶
func (s GeoNameAdminSubdivision) GetGeoNameID() int
func (GeoNameAdminSubdivision) GetName ¶
func (s GeoNameAdminSubdivision) GetName() string
func (GeoNameAdminSubdivision) GetSubdivisionName ¶
func (s GeoNameAdminSubdivision) GetSubdivisionName() string
func (GeoNameAdminSubdivision) GetTimeZone ¶
func (s GeoNameAdminSubdivision) GetTimeZone() string
func (GeoNameAdminSubdivision) MarshalJSON ¶
func (s GeoNameAdminSubdivision) MarshalJSON() ([]byte, error)
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) GetCityName ¶
func (c GeoNameContinent) GetCityName() string
func (GeoNameContinent) GetContinentCode ¶
func (c GeoNameContinent) GetContinentCode() string
func (GeoNameContinent) GetContinentName ¶
func (c GeoNameContinent) GetContinentName() string
func (GeoNameContinent) GetCountryCode ¶
func (c GeoNameContinent) GetCountryCode() string
func (GeoNameContinent) GetCountryName ¶
func (c GeoNameContinent) GetCountryName() string
func (GeoNameContinent) GetGeoNameID ¶
func (c GeoNameContinent) GetGeoNameID() int
func (GeoNameContinent) GetName ¶
func (c GeoNameContinent) GetName() string
func (GeoNameContinent) GetSubdivisionName ¶
func (c GeoNameContinent) GetSubdivisionName() string
func (GeoNameContinent) GetTimeZone ¶
func (c GeoNameContinent) GetTimeZone() string
func (GeoNameContinent) MarshalJSON ¶
func (s GeoNameContinent) MarshalJSON() ([]byte, error)
func (*GeoNameContinent) UnmarshalJSON ¶
func (s *GeoNameContinent) UnmarshalJSON(data []byte) error
type GeoNameCountry ¶
func (GeoNameCountry) GetCityName ¶
func (s GeoNameCountry) GetCityName() string
func (GeoNameCountry) GetContinentCode ¶
func (s GeoNameCountry) GetContinentCode() string
func (GeoNameCountry) GetContinentName ¶
func (s GeoNameCountry) GetContinentName() string
func (GeoNameCountry) GetCountryCode ¶
func (s GeoNameCountry) GetCountryCode() string
func (GeoNameCountry) GetCountryName ¶
func (s GeoNameCountry) GetCountryName() string
func (GeoNameCountry) GetGeoNameID ¶
func (s GeoNameCountry) GetGeoNameID() int
func (GeoNameCountry) GetName ¶
func (s GeoNameCountry) GetName() string
func (GeoNameCountry) GetSubdivisionName ¶
func (s GeoNameCountry) GetSubdivisionName() string
func (GeoNameCountry) GetTimeZone ¶
func (s GeoNameCountry) GetTimeZone() string
func (GeoNameCountry) MarshalJSON ¶
func (s GeoNameCountry) MarshalJSON() ([]byte, error)
func (*GeoNameCountry) UnmarshalJSON ¶
func (s *GeoNameCountry) UnmarshalJSON(data []byte) error
type GeoNameEntity ¶
type GeoNameFilter ¶
type GeoNameFilter struct {
GeoNameIDs []uint32 `schema:"geoname-ids" json:"geonameIds"`
CountryCodes []string `schema:"country-codes" json:"countryCodes"`
NamePrefix string `schema:"name-prefix" json:"namePrefix"`
Limit uint32 `schema:"limit" json:"limit"`
}
func (*GeoNameFilter) Match ¶
func (f *GeoNameFilter) Match(e GeoNameEntity) bool
type GeoNamesVersion ¶
type GeoNamesVersion = ModTimeVersion
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 ¶
type MMDBVersion ¶
type MMDBVersion source.MMDBVersion
func (MMDBVersion) Compare ¶
func (v MMDBVersion) Compare(other MMDBVersion) int
func (MMDBVersion) MarshalJSON ¶
func (v MMDBVersion) MarshalJSON() ([]byte, error)
func (*MMDBVersion) UnmarshalJSON ¶
func (v *MMDBVersion) UnmarshalJSON(data []byte) error
type ModTimeVersion ¶
func (ModTimeVersion) Compare ¶
func (v ModTimeVersion) Compare(other ModTimeVersion) int
func (ModTimeVersion) MarshalJSON ¶
func (v ModTimeVersion) MarshalJSON() ([]byte, error)
func (*ModTimeVersion) UnmarshalJSON ¶
func (v *ModTimeVersion) UnmarshalJSON(data []byte) error
type PatchVersion ¶
type PatchVersion = ModTimeVersion
type PatchedGeoNamesVersion ¶
type PatchedGeoNamesVersion struct {
DB GeoNamesVersion `json:"db,omitempty"`
Patch *ModTimeVersion `json:"patch,omitempty"`
}
func (PatchedGeoNamesVersion) Compare ¶
func (v PatchedGeoNamesVersion) Compare(other PatchedGeoNamesVersion) int
func (PatchedGeoNamesVersion) String ¶
func (v PatchedGeoNamesVersion) String() string
type PatchedMMDBVersion ¶
type PatchedMMDBVersion struct {
DB MMDBVersion `json:"db,omitempty"`
Patch *ModTimeVersion `json:"patch,omitempty"`
}
func (PatchedMMDBVersion) Compare ¶
func (v PatchedMMDBVersion) Compare(other PatchedMMDBVersion) int
func (PatchedMMDBVersion) String ¶
func (v PatchedMMDBVersion) String() string
Click to show internal directories.
Click to hide internal directories.