MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / IsWildIP

Function IsWildIP

internal/utils/ip.go:57–69  ·  view source on GitHub ↗

IsWildIP 宽泛地判断一个数据是否为IP

(v string)

Source from the content-addressed store, hash-verified

55
56// IsWildIP 宽泛地判断一个数据是否为IP
57func IsWildIP(v string) bool {
58 var l = len(v)
59 if l == 0 {
60 return false
61 }
62
63 // for [IPv6]
64 if v[0] == '[' && v[l-1] == ']' {
65 return IsWildIP(v[1 : l-1])
66 }
67
68 return net.ParseIP(v) != nil
69}

Callers 3

TestIsWildIPFunction · 0.92
doMismatchMethod · 0.92
findNamedServerMethod · 0.92

Calls 1

ParseIPMethod · 0.80

Tested by 1

TestIsWildIPFunction · 0.74