MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / IsInWhiteList

Function IsInWhiteList

internal/iplibrary/list_utils.go:65–73  ·  view source on GitHub ↗

IsInWhiteList 检查IP是否在白名单中

(ip string)

Source from the content-addressed store, hash-verified

63
64// IsInWhiteList 检查IP是否在白名单中
65func IsInWhiteList(ip string) bool {
66 var ipBytes = iputils.ToBytes(ip)
67 if IsZero(ipBytes) {
68 return false
69 }
70
71 // check white lists
72 return GlobalWhiteIPList.Contains(ipBytes)
73}
74
75// AllowIPStrings 检查一组IP是否被允许访问
76func AllowIPStrings(ipStrings []string, serverId int64) bool {

Callers 1

increaseSYNFloodMethod · 0.92

Calls 2

IsZeroFunction · 0.85
ContainsMethod · 0.45

Tested by

no test coverage detected