Documentation
¶
Overview ¶
Package geoip is the GeoIP country-lookup engine: a local MaxMind GeoLite2 (.mmdb) reader with an in-memory IP→country cache. It performs no DNS resolution and no SSRF/private-range filtering — callers resolve a host to a public net.IP first (see resolveHost in package main, which owns the shared SSRF check) and then call LookupByIP. This keeps the engine a true leaf with no dependency on the rest of Culvert (extracted under ADR-0002, option F).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGeoDB ¶
InitGeoDB opens the GeoLite2-Country .mmdb file. Call once at startup. Subsequent calls replace the open reader atomically.
func LookupByIP ¶
LookupByIP returns the ISO country code and full name for an already-resolved public IP. Returns ("", "") when GeoIP is disabled, the IP is nil, or the lookup fails. Host resolution + SSRF filtering is the caller's responsibility.
Types ¶
This section is empty.