Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get downloads and unpacks the MaxMind GeoLite2 database. The tarball is downloaded and unpacked at the provided path. The directories will created if required. The license key is used for the download and must be provided for a registered account. Please refer to MaxMinds website on how to do that: https://dev.maxmind.com/geoip/geoip2/geolite2/ The database should be updated on a regular basis.
Types ¶
type Config ¶
type Config struct { // File is the path (including the filename) to the GeoLite2 country database file. // See GeoLite2Filename for the required filename. File string // Logger is the log.Logger used for logging. // Note that this will log the IP address and should therefore only be used for debugging. // Set it to nil to disable logging for GeoDB. Logger *log.Logger }
Config is the configuration for the GeoDB.
type GeoDB ¶
type GeoDB struct {
// contains filtered or unexported fields
}
GeoDB maps IPs to their geo location based on MaxMinds GeoLite2 or GeoIP2 database.
Click to show internal directories.
Click to hide internal directories.