Documentation
¶
Index ¶
- func BytesToInt(bs []byte) (i int)
- func BytesToIp4(bs []byte) (s string)
- func BytesToIp6(bs []byte) (s string)
- func Cidr4ToIps(s string) (ips []string, err error)
- func Cidr4ToIpsClean(s string) (ips []string, err error)
- func Cidr6ToIps(s string) (ips []string, err error)
- func Cidr6ToIpsClean(s string) (ips []string, err error)
- func IntToBytes(n int) []byte
- func IntToIp4(i int) (s string)
- func Ip4ToBytes(s string) (bs []byte)
- func Ip4ToInt(s string) (i int)
- func Ip6ToBytes(s string) (bs []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToIp4 ¶
BytesToIp4 example [128 14 32 0] -> 128.14.32.0
func BytesToIp6 ¶
BytesToIp6 example [254 128 0 0 9 130 42 92 0 0 0 0 0 0 255 255] -> fe80:0:982:2a5c:0:0:0:ffff
func Cidr4ToIps ¶
Cidr4ToIps example 128.14.35.7/20 -> [128.14.32.0 ~ 128.14.47.255]
func Cidr4ToIpsClean ¶
Cidr4ToIpsClean example 128.14.35.7/20 -> [128.14.32.1 ~ 128.14.47.254]
func Cidr6ToIps ¶
Cidr6ToIps example fe80:0:982:2a5c:0:0:0:ffff/127 -> [fe80:0:982:2a5c:0:0:0:fffe ~ fe80:0:982:2a5c:0:0:0:ffff]
func Cidr6ToIpsClean ¶
Cidr6ToIpsClean example fe80:0:982:2a5c:0:0:0:ffff/127 -> [fe80:0:982:2a5c:0:0:0:fffe]
func Ip4ToBytes ¶
Ip4ToBytes example 128.14.32.0 -> [128 14 32 0]
func Ip6ToBytes ¶
Ip6ToBytes example fe80:0:982:2a5c:0:0:0:ffff -> [254 128 0 0 9 130 42 92 0 0 0 0 0 0 255 255]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.