Versions in this module Expand all Collapse all v0 v0.1.0 May 14, 2026 Changes in this version + const ASNOrganizationHeader + const ASNSystemNumberHeader + const AccuracyRadiusHeader + const CityHeader + const ContinentCodeHeader + const ContinentHeader + const CountryCodeHeader + const CountryHeader + const DefaultDBPath + const GeohashHeader + const IPAddressHeader + const LatitudeHeader + const LongitudeHeader + const PostalCodeHeader + const RegionCodeHeader + const RegionHeader + const TrafficAIBotHeader + const TrafficDatacenterHeader + const TrafficTorHeader + const TrafficTypeHeader + const TrafficVPNHeader + const Unknown + func EncodeGeoHash(lat, lng float64) string + func StringIso88591ToUtf8(value string) string + func StringUtf8ToIso88591(value string) string + func StripHeaders(req *http.Request) + type Classifier struct + func NewClassifier(config *Config) *Classifier + func (c *Classifier) Classify(req *http.Request, ipStr, asnNumber string) + type Config struct + AIBotFile string + AsnDBPath string + CityDBPath string + CountryDBPath string + DatacenterFile string + Debug bool + FailInError bool + IPHeader string + Iso88591 bool + LightMode bool + PreferXForwardedForHeader bool + RefreshSeconds int + TorFile string + VPNFile string + type GeoIPAsnResult struct + type GeoIPCityResult struct + type GeoIPCountryResult struct + type LookupGeoIPAsn func(ip net.IP) (*GeoIPAsnResult, error) + func CreateAsnDBLookup(rdr *geoip2.ASNReader) LookupGeoIPAsn + func CreateAsnDBLookupIso88591(rdr *geoip2_iso88591.ASNReader) LookupGeoIPAsn + func NewLookupAsn(dbPath, name string, iso88591 bool) (LookupGeoIPAsn, error) + type LookupGeoIPCity func(ip net.IP) (*GeoIPCityResult, error) + func CreateCityDBLookup(rdr *geoip2.CityReader) LookupGeoIPCity + func CreateCityDBLookupIso88591(rdr *geoip2_iso88591.CityReader) LookupGeoIPCity + func NewLookupCity(dbPath, name string, iso88591 bool) (LookupGeoIPCity, error) + type LookupGeoIPCountry func(ip net.IP) (*GeoIPCountryResult, error) + func CreateCountryDBLookup(rdr *geoip2.CountryReader) LookupGeoIPCountry + func CreateCountryDBLookupIso88591(rdr *geoip2_iso88591.CountryReader) LookupGeoIPCountry + func NewLookupCountry(dbPath, name string, iso88591 bool) (LookupGeoIPCountry, error) + type Options struct + Debug bool + FailInError bool + IPHeader string + Iso88591 bool + LightMode bool + PreferXForwardedForHeader bool + func ConfigToOptions(config *Config) Options + type TraefikGeoIP struct + Classifier *Classifier + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIP) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPAsn struct + Classifier *Classifier + LookupAsn LookupGeoIPAsn + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPAsn) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPCity struct + Classifier *Classifier + LookupCity LookupGeoIPCity + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPCity) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPCityAsn struct + Classifier *Classifier + LookupAsn LookupGeoIPAsn + LookupCity LookupGeoIPCity + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPCityAsn) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPCityAsnLightMode struct + Classifier *Classifier + LookupAsn LookupGeoIPAsn + LookupCity LookupGeoIPCity + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPCityAsnLightMode) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPCityLightMode struct + Classifier *Classifier + LookupCity LookupGeoIPCity + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPCityLightMode) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPCountry struct + Classifier *Classifier + LookupCountry LookupGeoIPCountry + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPCountry) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPCountryAsn struct + Classifier *Classifier + LookupAsn LookupGeoIPAsn + LookupCountry LookupGeoIPCountry + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPCountryAsn) ServeHTTP(reqWr http.ResponseWriter, req *http.Request) + type TraefikGeoIPNotFound struct + Classifier *Classifier + Name string + Next http.Handler + Options Options + func (mw *TraefikGeoIPNotFound) ServeHTTP(reqWr http.ResponseWriter, req *http.Request)