github.com/hernad/nomad@v1.6.112/helper/ipaddr/ipaddr.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package ipaddr
     5  
     6  // IsAny checks if the given IP address is an IPv4 or IPv6 ANY address.
     7  func IsAny(ip string) bool {
     8  	return isAnyV4(ip) || isAnyV6(ip)
     9  }
    10  
    11  func isAnyV4(ip string) bool { return ip == "0.0.0.0" }
    12  
    13  func isAnyV6(ip string) bool { return ip == "::" || ip == "[::]" }