Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for IsIPv6Address (0.43 sec)

  1. pkg/util/net/ip.go

    func IsValidIPAddress(ip string) bool {
    	ipa, err := netip.ParseAddr(ip)
    	if err != nil {
    		return false
    	}
    	return ipa.IsValid()
    }
    
    // IsIPv6Address returns if ip is IPv6.
    func IsIPv6Address(ip string) bool {
    	ipa, err := netip.ParseAddr(ip)
    	if err != nil {
    		return false
    	}
    	return ipa.Is6()
    }
    
    // IsIPv4Address returns if ip is IPv4.
    func IsIPv4Address(ip string) bool {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  2. pkg/util/net/ip_test.go

    			args: args{
    				ip: "2001:db8:::1",
    			},
    			want: false,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if got := IsIPv6Address(tt.args.ip); got != tt.want {
    				t.Errorf("IsIPv6Address() = %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func TestIsIPv4Address(t *testing.T) {
    	type args struct {
    		ip string
    	}
    	tests := []struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  3. pilot/pkg/networking/core/cluster.go

    				if endpointAddress == "" {
    					endpointAddress = model.LocalhostAddressPrefix
    				}
    			} else if hostIP == model.PodIPv6AddressPrefix {
    				for _, proxyIPAddr := range cb.proxyIPAddresses {
    					if netutil.IsIPv6Address(proxyIPAddr) {
    						endpointAddress = proxyIPAddr
    						break
    					}
    				}
    				// if there is no any IPv6 address in proxyIPAddresses
    				if endpointAddress == "" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 13 01:56:28 UTC 2024
    - 33K bytes
    - Viewed (0)
Back to top