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 returns a no-op Locator that resolves every IP to an empty result. It is the Community Edition fallback; the real MaxMind-backed locator lives in the cloud/enterprise build.
Click to show internal directories.
Click to hide internal directories.