Documentation
¶
Overview ¶
Package geolocation provides IP-to-country lookups using MaxMind GeoLite2 databases.
Index ¶
Constants ¶
View Source
const (
// EnvDisable disables geolocation lookups entirely when set to a truthy value.
EnvDisable = "NB_PROXY_DISABLE_GEOLOCATION"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
Lookup provides IP geolocation lookups.
func NewLookup ¶
NewLookup opens or downloads the GeoLite2-City MMDB in dataDir. Returns nil without error if geolocation is disabled via environment variable, no data directory is configured, or the download fails (graceful degradation: country restrictions will deny all requests).
Click to show internal directories.
Click to hide internal directories.