Documentation ¶
Index ¶
- Variables
- type ASN
- type ASNReader
- type AnonymousIP
- type AnonymousIPReader
- type City
- type CityReader
- type CityResult
- type ConnectionType
- type ConnectionTypeReader
- type Continent
- type Country
- type CountryReader
- type CountryResult
- type Domain
- type DomainReader
- type ISP
- type ISPReader
- type Location
- type Metadata
- type Postal
- type Subdivision
- type Traits
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type ASNReader ¶ added in v0.0.2
type ASNReader struct {
// contains filtered or unexported fields
}
func NewASNReader ¶ added in v0.0.2
func NewASNReaderFromFile ¶ added in v0.0.2
type AnonymousIP ¶ added in v0.0.2
type AnonymousIPReader ¶ added in v0.0.2
type AnonymousIPReader struct {
// contains filtered or unexported fields
}
func NewAnonymousIPReader ¶ added in v0.0.2
func NewAnonymousIPReader(buffer []byte) (*AnonymousIPReader, error)
func NewAnonymousIPReaderFromFile ¶ added in v0.0.2
func NewAnonymousIPReaderFromFile(filename string) (*AnonymousIPReader, error)
func (*AnonymousIPReader) Lookup ¶ added in v0.0.2
func (r *AnonymousIPReader) Lookup(ip net.IP) (*AnonymousIP, error)
type CityReader ¶ added in v0.0.2
type CityReader struct {
// contains filtered or unexported fields
}
func NewCityReader ¶ added in v0.0.2
func NewCityReader(buffer []byte) (*CityReader, error)
func NewCityReaderFromFile ¶ added in v0.0.2
func NewCityReaderFromFile(filename string) (*CityReader, error)
func NewEnterpriseReader ¶ added in v0.0.2
func NewEnterpriseReader(buffer []byte) (*CityReader, error)
func NewEnterpriseReaderFromFile ¶ added in v0.0.2
func NewEnterpriseReaderFromFile(filename string) (*CityReader, error)
func (*CityReader) Lookup ¶ added in v0.0.2
func (r *CityReader) Lookup(ip net.IP) (*CityResult, error)
type CityResult ¶ added in v0.0.2
type ConnectionType ¶
type ConnectionType struct {
ConnectionType string
}
type ConnectionTypeReader ¶ added in v0.0.2
type ConnectionTypeReader struct {
// contains filtered or unexported fields
}
func NewConnectionTypeReader ¶ added in v0.0.2
func NewConnectionTypeReader(buffer []byte) (*ConnectionTypeReader, error)
func NewConnectionTypeReaderFromFile ¶ added in v0.0.2
func NewConnectionTypeReaderFromFile(filename string) (*ConnectionTypeReader, error)
type CountryReader ¶ added in v0.0.2
type CountryReader struct {
// contains filtered or unexported fields
}
func NewCountryReader ¶ added in v0.0.2
func NewCountryReader(buffer []byte) (*CountryReader, error)
func NewCountryReaderFromFile ¶ added in v0.0.2
func NewCountryReaderFromFile(filename string) (*CountryReader, error)
func (*CountryReader) Lookup ¶ added in v0.0.2
func (r *CountryReader) Lookup(ip net.IP) (*CountryResult, error)
type CountryResult ¶ added in v0.0.2
type DomainReader ¶ added in v0.0.2
type DomainReader struct {
// contains filtered or unexported fields
}
func NewDomainReader ¶ added in v0.0.2
func NewDomainReader(buffer []byte) (*DomainReader, error)
func NewDomainReaderFromFile ¶ added in v0.0.2
func NewDomainReaderFromFile(filename string) (*DomainReader, error)
type ISPReader ¶ added in v0.0.2
type ISPReader struct {
// contains filtered or unexported fields
}
func NewISPReader ¶ added in v0.0.2
func NewISPReaderFromFile ¶ added in v0.0.2
type Metadata ¶
type Metadata struct { NodeCount uint32 // node_count This is an unsigned 32-bit integer indicating the number of nodes in the search tree. RecordSize uint16 // record_size This is an unsigned 16-bit integer. It indicates the number of bits in a record in the search tree. Note that each node consists of two records. IPVersion uint16 // ip_version This is an unsigned 16-bit integer which is always 4 or 6. It indicates whether the database contains IPv4 or IPv6 address data. DatabaseType string // database_type This is a string that indicates the structure of each data record associated with an IP address. The actual definition of these structures is left up to the database creator. Names starting with “GeoIP” are reserved for use by MaxMind (and “GeoIP” is a trademark anyway). Languages []string // languages An array of strings, each of which is a locale code. A given record may contain data items that have been localized to some or all of these locales. Records should not contain localized data for locales not included in this array. This is an optional key, as this may not be relevant for all types of data. BinaryFormatMajorVersion uint16 // binary_format_major_version This is an unsigned 16-bit integer indicating the major version number for the database’s binary format. BinaryFormatMinorVersion uint16 // binary_format_minor_version This is an unsigned 16-bit integer indicating the minor version number for the database’s binary format. BuildEpoch uint64 // build_epoch This is an unsigned 64-bit integer that contains the database build timestamp as a Unix epoch value. Description map[string]string // description This key will always point to a map. The keys of that map will be language codes, and the values will be a description in that language as a UTF-8 string. The codes may include additional information such as script or country identifiers, like “zh-TW” or “mn-Cyrl-MN”. The additional identifiers will be separated by a dash character (“-“). }
type Subdivision ¶
type Traits ¶
type Traits struct { StaticIPScore float64 // Enterprise ISP string // Enterprise Organization string // Enterprise ConnectionType string // Enterprise Domain string // Enterprise UserType string // Enterprise AutonomousSystemOrganization string // Enterprise AutonomousSystemNumber uint32 // Enterprise IsLegitimateProxy bool // Enterprise MobileCountryCode string // Enterprise MobileNetworkCode string // Enterprise IsAnonymousProxy bool IsSatelliteProvider bool }
Source Files ¶
- anonymous_ip.go
- asn.go
- city.go
- common.go
- connection_type.go
- continent.go
- country.go
- domain.go
- isp.go
- location.go
- metadata.go
- postal.go
- reader.go
- reader_anonymous_ip.go
- reader_asn.go
- reader_city.go
- reader_connection_type.go
- reader_country.go
- reader_domain.go
- reader_isp.go
- subdivision.go
- traits.go
- types.go
Click to show internal directories.
Click to hide internal directories.