Documentation ¶
Overview ¶
Package geoip helps in geolocation operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locator ¶
type Locator interface { // GetCountry retrieves the ISO country code for a given IP address. // Returns an error if the IP lookup fails. GetCountry(ip net.IP) (string, error) // GetPosition retrieves the geographical [Position] for a given IP // address. Returns an error if the IP lookup fails. GetPosition(ip net.IP) (Position, error) }
func NewNullGeoLite ¶
func NewNullGeoLite() Locator
NewNullGeoLite opens a connection to GeoIp2 database and return a geoLite2 structure with the database connection.
The connection uses the local database or try to download it from MaxMind's server (the download required `MAXMIND_LICENSE`).
Click to show internal directories.
Click to hide internal directories.