Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoDB ¶
type GeoDB struct {
// contains filtered or unexported fields
}
GeoDB maps IPs to their geological location based on MaxMinds GeoLite2 or GeoIP2 database.
func (*GeoDB) GetLocation ¶ added in v5.5.0
GetLocation looks up the country code, subdivision (region), and city for given IP. If the IP is invalid it will return an empty string. The country code is returned in lowercase.
func (*GeoDB) UpdateFromFile ¶
UpdateFromFile updates GeoDB from given file instead of downloading the database.
Click to show internal directories.
Click to hide internal directories.