Documentation
¶
Overview ¶
Package ipisp provides a wrapper to team-cymru.com IP to ASN service.
Index ¶
- Variables
- type ASN
- type Client
- type DNSClient
- type Name
- type Response
- type WhoisClient
- func (c *WhoisClient) Close() error
- func (c *WhoisClient) LookupASN(asn ASN) (*Response, error)
- func (c *WhoisClient) LookupASNs(asns []ASN) (resp []Response, err error)
- func (c *WhoisClient) LookupIP(ip net.IP) (*Response, error)
- func (c *WhoisClient) LookupIPs(ips []net.IP) (resp []Response, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnexpectedTokens = errors.New("Unexpected tokens while reading Cymru response.")
)
Common errors
View Source
var Timeout = time.Second * 10
Timeout is the TCP connection timeout
Functions ¶
This section is empty.
Types ¶
type ASN ¶
type ASN int
ASN contains an Autonomous Systems Number
type Client ¶
type Client interface {
LookupIPs([]net.IP) ([]Response, error)
LookupIP(net.IP) (*Response, error)
LookupASNs([]ASN) ([]Response, error)
LookupASN(ASN) (*Response, error)
Close() error
}
Client is a lookup client
type Response ¶
type Response struct {
IP net.IP
ASN ASN
Name Name
Country string
Registry string
Range *net.IPNet
AllocatedAt time.Time
}
Response contains a response from Cymru
type WhoisClient ¶
WhoisClient uses the whois client
func NewWhoisClient ¶
func NewWhoisClient() (client *WhoisClient, err error)
NewWhoisClient returns a pointer to a new connected whois client
func (*WhoisClient) LookupASN ¶
func (c *WhoisClient) LookupASN(asn ASN) (*Response, error)
LookupASN is a single ASN convenience proxy of LookupASNs
func (*WhoisClient) LookupASNs ¶
func (c *WhoisClient) LookupASNs(asns []ASN) (resp []Response, err error)
LookupASNs looks up ASNs. Response IP and Range fields are zeroed
Click to show internal directories.
Click to hide internal directories.