Documentation ¶
Overview ¶
Package gipv4 provides useful API for IPv4 address handling.
Index ¶
- func GetHostByName(hostname string) (string, error)
- func GetHostsByName(hostname string) ([]string, error)
- func GetNameByAddr(ipAddress string) (string, error)
- func GetSegment(ip string) string
- func IntranetIP() (ips []string, err error)
- func Ip2long(ipAddress string) uint32
- func IsIntranet(ipStr string) bool
- func Long2ip(properAddress uint32) string
- func ParseAddress(addr string) (string, int)
- func Validate(ip string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostByName ¶
Get the IPv4 address corresponding to a given Internet host name.
func GetHostsByName ¶
Get a list of IPv4 addresses corresponding to a given Internet host name.
func GetNameByAddr ¶
Get the Internet host name corresponding to a given IP address.
func IsIntranet ¶
判断所给ip是否为局域网ip A类 10.0.0.0--10.255.255.255 B类 172.16.0.0--172.31.255.255 C类 192.168.0.0--192.168.255.255
func ParseAddress ¶
解析地址,形如:192.168.1.1:80 -> 192.168.1.1, 80
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.