Documentation
¶
Overview ¶
Package geolocate looks up ISO country codes and names
Package geolocate performs IP geolocation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
Initialize starts the geolocation service with the MaxMind MMDB file
func IsCountryCode ¶
IsCountryCode returns whether the code is a valid country code
Types ¶
type IPGeolocation ¶
type IPGeolocation struct { CountryName string `json:"country_name,omitempty"` // ISO 3166 2-letter uppercase contry code CountryCode string `json:"country_code,omitempty"` }
IPGeolocation stores the country information for an IP
func Geolocate ¶
func Geolocate(ip string) (*IPGeolocation, error)
Geolocate uses maxmind to geolocate IP to country
Click to show internal directories.
Click to hide internal directories.