Documentation ¶
Index ¶
- Constants
- func GetLoopbackIP(wantIPv6 bool) (string, error)
- func JoinIPStrings(ips []net.IP) string
- func MustGetLoopbackIP(wantIPv6 bool) string
- func ParseIPList(ips []string) []net.IP
- func RemoveDupIPs(ips []net.IP) []net.IP
- func SearchAllIP(ipList []net.IP, ips []net.IP) bool
- func SearchIP(ipList []net.IP, ip net.IP) bool
Constants ¶
View Source
const ( DefaultLoopbackIP4 = "127.0.0.1" DefaultLoopbackIP6 = "::1" )
Variables ¶
This section is empty.
Functions ¶
func GetLoopbackIP ¶
GetLoopbackIP returns the ip address of local loopback interface.
func JoinIPStrings ¶
func MustGetLoopbackIP ¶
MustGetLoopbackIP is a wrapper for GetLoopbackIP. If any error occurs or loopback interface is not found, will fall back to 127.0.0.1 for ipv4 or ::1 for ipv6.
func ParseIPList ¶ added in v1.2.0
Parse a list of IP Strings to net.IP type
func RemoveDupIPs ¶ added in v1.0.0
RemoveDupIPs removes duplicate ips from the ip list and returns a new created list
func SearchAllIP ¶ added in v1.2.1
searchAllIP returns true if all ips are in ipList
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.