github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/helper/ipaddr/ipaddr.go (about)

     1  package ipaddr
     2  
     3  // IsAny checks if the given IP address is an IPv4 or IPv6 ANY address.
     4  func IsAny(ip string) bool {
     5  	return isAnyV4(ip) || isAnyV6(ip)
     6  }
     7  
     8  func isAnyV4(ip string) bool { return ip == "0.0.0.0" }
     9  
    10  func isAnyV6(ip string) bool { return ip == "::" || ip == "[::]" }