Documentation
¶
Index ¶
- func AddrByHostName(hostname string) (*net.IP, error)
- func AddrsByHostName(hostname string) ([]*net.IP, error)
- func HostAndAddr(host string) (string, *net.IP, error)
- func HostNameByIP(ip net.IP) (string, error)
- func HostNamesByIP(ip net.IP) ([]string, error)
- func IsPrivate(ip *net.IP) bool
- func NetworkByHost(host string) (*net.IP, error)
- type Func
- type InternetServiceProvider
- type NameServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrByHostName ¶
AddrByHostName resolves the ip address of the provided hostname.
func AddrsByHostName ¶
AddrsByHostName returns all ip addresses found for the provided hostname.
func HostAndAddr ¶
HostAndAddr returns the hostname and ip address of host whether host is an IP address or a hostname. HostAndAddr returns a non-nil error if host is an invalid ip address or a hostname that cannot be resolved to an IP address.
func HostNameByIP ¶
HostNameByIP returns the hostname for the provided ip address.
func HostNamesByIP ¶
HostNamesByIP returns all hostnames found for the provided ip address.
Types ¶
type InternetServiceProvider ¶
type InternetServiceProvider struct {
Name string `json:"name" table:"NAME"`
IP *net.IP `json:"ip_address" table:"IP"`
Country string `json:"country" table:"COUNTRY"`
Registry string `json:"registry" table:"REGISTRY"`
IpRange *net.IPNet `json:"ip_range" table:"IP_RANGE"`
AutonomousServiceNumber string `json:"autonomous_service_number" table:"ASN"`
AllocatedAt *time.Time `json:"allocated_at" table:"ALLOCATED_AT"`
}
InternetServiceProvider describes an internet service provider.
func ServiceProvider ¶
func ServiceProvider(ip *net.IP) (*InternetServiceProvider, error)
ServiceProvider returns the internet service provider information for ip.
type NameServer ¶
type NameServer struct {
IP net.IP `json:"ip" table:"IP"`
Host string `json:"nameserver" table:"Nameserver"`
}
NameServer is used in place of the standard library object to support table writes.
func NameServersByHostName ¶
func NameServersByHostName(hostname string) ([]NameServer, error)
NameServersByHostName looks up all nameservers for the provided hostname.