Documentation ¶
Index ¶
Constants ¶
View Source
const CHECKSUM_URL string = "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz.sha256&license_key="
View Source
const DATABASE_URL string = "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key="
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoIPHandler ¶
GeoIPHandler will keep itself up-to-date with the latest GeoIP database by updating once every 24 hours Provides methods to lookup IP addresses and return the associated latitude and longitude The structure should be created with it's maxmind license key
func NewGeoIPHandler ¶
func NewGeoIPHandler(licenseKey string) (*GeoIPHandler, error)
NewGeoIPHandler creates a new GeoIPHandler with the given license key
func (*GeoIPHandler) Close ¶
func (g *GeoIPHandler) Close()
func (*GeoIPHandler) Lookup ¶
func (g *GeoIPHandler) Lookup(ip net.IP) (*geoip2.CityResult, error)
Click to show internal directories.
Click to hide internal directories.