Versions in this module Expand all Collapse all v1 v1.1.0 May 24, 2024 Changes in this version + const CanadaOffset + const Charset_ISO_8859_1 + const Charset_UTF_8 + const CountryBegin + const DBInfoMaxSize + const FIPSRange + const LargeCountryBegin + const LargeSegmentRecordLength + const MaxOrgRecordLength + const MaxRecordLength + const OrgRecordLength + const SegmentRecordLength + const StandardRecordLength + const StateBeginRev0 + const StateBeginRev1 + const StructureInfoMaxSize + const TeredoBit + const USOffset + const WorldOffset + var ErrEmptyIPv4Path = errors.New("empty IPv4 DB path not allowed in CombinedDB initialization") + var ErrEmptyIPv6Path = errors.New("empty IPv6 DB path not allowed in CombinedDB initialization") + var ErrInvalidCountryID = errors.New("invalid country id") + var ErrInvalidIP = errors.New("invalid IP address") + var ErrNegativeIndex = errors.New("index size is negative, database may be corrupt") + var ErrNoSegments = errors.New("database has no segments, file may be corrupt") + var ErrNotIPv6 = errors.New("expected IPv6, got IPv4") + var ErrSegmentNotRead = errors.New("didn't read full segment") + type Charset int + type CombinedDB struct + func OpenCombinedDB(path4, path6 string) (*CombinedDB, error) + func (db *CombinedDB) Close() error + func (db *CombinedDB) DBv4Path() string + func (db *CombinedDB) DBv6Path() string + func (db *CombinedDB) GetCountryByAddr(addr string) (*CountryResult, error) + func (db *CombinedDB) GetCountryByIP(ip net.IP) (*CountryResult, error) + type CountryResult struct + Code string + Code3 string + Continent string + NameASCII string + NameUTF8 string + type DB struct + Charset Charset + ModTime time.Time + Options *GeoIPOptions + RecordLength uint8 + Size int64 + Type DBType + func OpenDB(dbPath string, options *GeoIPOptions) (*DB, error) + func (db *DB) Close() error + func (db *DB) GetCountryByAddr(addr string) (*CountryResult, error) + func (db *DB) GetCountryByIP(ip net.IP) (*CountryResult, error) + func (db *DB) GetIndexSize() int32 + func (db *DB) IsIPv6() bool + func (db *DB) Path() string + type DBType int + const ASNEdition + const ASNEditionV6 + const AccuracyRadiusEdition + const AccuracyRadiusEditionV6 + const CCMCountryEdition + const CityConfEdition + const CityConfidenceDistEdition + const CityConfidenceDistISPOrgEdition + const CityConfidenceEdition + const CityEditionRev0 + const CityEditionRev0V6 + const CityEditionRev1 + const CityEditionRev1V6 + const CountryConfEdition + const CountryEdition + const CountryEditionV6 + const DomainEdition + const DomainEditionV6 + const ISPEdition + const ISPEditionV6 + const InvalidVersion + const LargeCountryEdition + const LargeCountryEditionV6 + const LocationAEdition + const LocationAEditionV6 + const NetSpeedEdition + const NetSpeedEditionRev1 + const NetSpeedEditionRev1V6 + const NumDBTypes + const OrgEdition + const OrgEditionV6 + const PostalConfEdition + const ProxyEdition + const RegionConfEdition + const RegionEditionRev0 + const RegionEditionRev1 + const RegistrarEdition + const RegistrarEditionV6 + const UserTypeEdition + const UserTypeEditionV6 + func (dt DBType) String() string + type ExtFlags uint + type GeoIPDB interface + Close func() error + GetCountryByAddr func(addr string) (*CountryResult, error) + GetCountryByIP func(ip net.IP) (*CountryResult, error) + type GeoIPOptions struct + IsIPv6 bool + Teredo bool + type NetSpeedValue int + const CableDSLSpeed + const CorporateSpeed + const DialupSpeed + const UnknownSpeed + type ProxyType int + const AnonProxy + const HTTPXForwardedForProxy