Documentation
¶
Overview ¶
Package ip2proxy allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES) and residential (RES) by using the IP2Proxy database.
Index ¶
- func ModuleVersion() string
- type ByteDBReader
- type DB
- func (d *DB) Close() error
- func (d *DB) DatabaseVersion() string
- func (d *DB) GetAll(ipAddress string) (IP2ProxyRecord, error)
- func (d *DB) GetAs(ipAddress string) (string, error)
- func (d *DB) GetAsn(ipAddress string) (string, error)
- func (d *DB) GetCity(ipAddress string) (string, error)
- func (d *DB) GetCountryLong(ipAddress string) (string, error)
- func (d *DB) GetCountryShort(ipAddress string) (string, error)
- func (d *DB) GetDomain(ipAddress string) (string, error)
- func (d *DB) GetIsp(ipAddress string) (string, error)
- func (d *DB) GetLastSeen(ipAddress string) (string, error)
- func (d *DB) GetProvider(ipAddress string) (string, error)
- func (d *DB) GetProxyType(ipAddress string) (string, error)
- func (d *DB) GetRegion(ipAddress string) (string, error)
- func (d *DB) GetThreat(ipAddress string) (string, error)
- func (d *DB) GetUsageType(ipAddress string) (string, error)
- func (d *DB) IsProxy(ipAddress string) (int8, error)
- func (d *DB) PackageVersion() string
- type IP2ProxyCreditResult
- type IP2ProxyRecord
- type IP2ProxyResult
- type WS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModuleVersion ¶
func ModuleVersion() string
ModuleVersion returns the version of the component.
Types ¶
type ByteDBReader ¶
func (*ByteDBReader) Close ¶
func (bdr *ByteDBReader) Close() error
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
The DB struct is the main object used to query the IP2Proxy BIN file.
func OpenDB ¶
OpenDB takes the path to the IP2Proxy BIN database file. It will read all the metadata required to be able to extract the embedded proxy data, and return the underlining DB object.
func OpenDBWithBytes ¶
OpenDBFromBytes use a byte slice to open the IP2Proxy BIN database file. It will read all the metadata required to be able to extract the embedded geolocation data, and return the underlining DB object.
func OpenDBWithReader ¶
OpenDBWithReader takes a dbReader to the IP2Proxy BIN database file. It will read all the metadata required to be able to extract the embedded proxy data, and return the underlining DB object.
func (*DB) DatabaseVersion ¶
DatabaseVersion returns the database version.
func (*DB) GetAll ¶
func (d *DB) GetAll(ipAddress string) (IP2ProxyRecord, error)
GetAll will return all proxy fields based on the queried IP address.
func (*DB) GetAsn ¶
GetAsn will return the autonomous system number based on the queried IP address.
func (*DB) GetCountryLong ¶
GetCountryLong will return the country name based on the queried IP address.
func (*DB) GetCountryShort ¶
GetCountryShort will return the ISO-3166 country code based on the queried IP address.
func (*DB) GetIsp ¶
GetIsp will return the Internet Service Provider name based on the queried IP address.
func (*DB) GetLastSeen ¶
GetLastSeen will return the number of days that the proxy was last seen based on the queried IP address.
func (*DB) GetProvider ¶
GetProvider will return the provider of the proxy.
func (*DB) GetProxyType ¶
GetProxyType will return the proxy type based on the queried IP address.
func (*DB) GetUsageType ¶
GetUsageType will return the usage type based on the queried IP address.
func (*DB) IsProxy ¶
IsProxy checks whether the queried IP address was a proxy. Returned value: -1 (errors), 0 (not a proxy), 1 (a proxy), 2 (a data center IP address or search engine robot).
func (*DB) PackageVersion ¶
PackageVersion returns the database type.
type IP2ProxyCreditResult ¶
type IP2ProxyCreditResult struct {
Response string `json:"response"`
}
The IP2ProxyCreditResult struct stores the credit balance for the IP2Proxy Web Service.
type IP2ProxyRecord ¶
type IP2ProxyRecord struct { CountryShort string CountryLong string Region string City string Isp string ProxyType string Domain string UsageType string Asn string As string LastSeen string Threat string Provider string IsProxy int8 }
The IP2ProxyRecord struct stores all of the available proxy info found in the IP2Proxy database.
type IP2ProxyResult ¶
type IP2ProxyResult struct { Response string `json:"response"` CountryCode string `json:"countryCode"` CountryName string `json:"countryName"` RegionName string `json:"regionName"` CityName string `json:"cityName"` ISP string `json:"isp"` Domain string `json:"domain"` UsageType string `json:"usageType"` ASN string `json:"asn"` AS string `json:"as"` LastSeen string `json:"lastSeen"` ProxyType string `json:"proxyType"` Threat string `json:"threat"` IsProxy string `json:"isProxy"` Provider string `json:"provider"` }
The IP2ProxyResult struct stores all of the available proxy info found in the IP2Proxy Web Service.
type WS ¶
type WS struct {
// contains filtered or unexported fields
}
The WS struct is the main object used to query the IP2Proxy Web Service.
func (*WS) GetCredit ¶
func (w *WS) GetCredit() (IP2ProxyCreditResult, error)
GetCredit will return the web service credit balance.