Documentation
¶
Index ¶
Constants ¶
View Source
const ( DBCountry = 0 DBCity = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
MaxMind Client component, configuration: components:
maxMind: countryFile: "@app/../geoip/GeoLite2-Country.mmdb" cityFile: "@app/../geoip/GeoLite2-City.mmdb"
func (*Client) GeoByIp ¶
get geo info by ip, optional args: db int: preferred geo db lang string: preferred i18n language
func (*Client) SetCityFile ¶
func (*Client) SetCountryFile ¶
type Geo ¶
type Geo struct { Code string `json:"code"` // country/area code Continent string `json:"-"` // continent name (en) Country string `json:"country,omitempty"` // country/area name (en) Province string `json:"province,omitempty"` // province name (en) City string `json:"city,omitempty"` // city name(en) // i18n name, default is en I18n struct { Continent string Country string Province string City string } `json:"-"` }
Geo lookup result
Click to show internal directories.
Click to hide internal directories.