Documentation
¶
Index ¶
Constants ¶
const UnknownAlpha2Code = "ZZ" // ZZ is the commonly recoginized country/continient code for unknown, as specified in ISO alpha2
const UnknownAlpha3Code = "ZZZ" // ZZZ is derived from "ZZ" to represent 3 letter country/continent code for unknown, as specified in ISO alpha3
Variables ¶
This section is empty.
Functions ¶
func CountryAlpha2CodeToAlpha3Code ¶
CountryAlpha2CodeToAlpha3Code - get a 3-letter country code if a country identified by 2-letter country code
func CountryAlpha3CodeToAlpha2Code ¶
CountryAlpha3CodeToAlpha2Code - get a 2-letter country code if a country identified by 3-letter country code
Types ¶
type Country ¶
type Country geoip2.Country
Country - a type definition on geoip2.Country data struct while providing heloer functions to retrieve certain data in convinent way and additional country data maxmind db does not provide user is expected not to directly modify it.
func (Country) ContinentCode ¶
ContinentCode - a helper function to retrieve 2-letter ISO code for country from maxmind DB
func (Country) CountryAlpha2Code ¶
CountryAlpha2Code - a helper function to retrieve 2-letter ISO code for country from maxmind DB, if the country is found, the code will be "ZZ"
func (Country) CountryAlpha3Code ¶
CountryAlpha3Code - return 3-letter ISO code for country
type Reader ¶
type Reader struct {
*geoip2.Reader
}
Reader - a thin wrapper which provides helper function to parse information provided by embedded geoip2.Reader
func NewMaxMind ¶
func (*Reader) BuildTimestamp ¶
BuildTimestamp - the timestamp when the MaxMind DB is built