Documentation ¶
Overview ¶
This ip2proxy package 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 and search engine robots (SES) by using the IP2Proxy database.
Index ¶
- func Close() int8deprecated
- func DatabaseVersion() stringdeprecated
- func GetAll(ipaddress string) map[string]stringdeprecated
- func GetAs(ipaddress string) stringdeprecated
- func GetAsn(ipaddress string) stringdeprecated
- func GetCity(ipaddress string) stringdeprecated
- func GetCountryLong(ipaddress string) stringdeprecated
- func GetCountryShort(ipaddress string) stringdeprecated
- func GetDomain(ipaddress string) stringdeprecated
- func GetIsp(ipaddress string) stringdeprecated
- func GetLastSeen(ipaddress string) stringdeprecated
- func GetProxyType(ipaddress string) stringdeprecated
- func GetRegion(ipaddress string) stringdeprecated
- func GetUsageType(ipaddress string) stringdeprecated
- func IsProxy(ipaddress string) int8deprecated
- func ModuleVersion() string
- func Open(dbpath string) int8deprecated
- func PackageVersion() stringdeprecated
- func Printrecord(x IP2Proxyrecord)
- type DB
- func (d *DB) Close() error
- func (d *DB) DatabaseVersion() string
- func (d *DB) GetAll(ipaddress string) (map[string]string, 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) GetProxyType(ipaddress string) (string, error)
- func (d *DB) GetRegion(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 IP2Proxyrecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseVersion
deprecated
func DatabaseVersion() string
DatabaseVersion returns the database version.
Deprecated: No longer being updated.
func GetCountryLong
deprecated
func GetCountryShort
deprecated
func GetLastSeen
deprecated
func GetProxyType
deprecated
func GetUsageType
deprecated
func ModuleVersion ¶
func ModuleVersion() string
ModuleVersion returns the version of the component.
func PackageVersion
deprecated
func PackageVersion() string
PackageVersion returns the database type.
Deprecated: No longer being updated.
func Printrecord ¶
func Printrecord(x IP2Proxyrecord)
Printrecord is used to output the proxy data for debugging purposes.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
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 (*DB) DatabaseVersion ¶
DatabaseVersion returns the database version.
func (*DB) GetAs ¶
GetAs will return the autonomous system name based on the queried IP address., err
func (*DB) GetAsn ¶
GetAsn will return the autonomous system number based on the queried IP address., err
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., err
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 IP2Proxyrecord ¶
type IP2Proxyrecord struct { Country_short string Country_long string Region string City string Isp string Proxy_type string Domain string Usage_type string Asn string As string Last_seen string Is_proxy int8 }
The IP2Proxyrecord struct stores all of the available proxy info found in the IP2Proxy database.