IsInWhiteList 检查IP是否在白名单中
(ip string)
| 63 | |
| 64 | // IsInWhiteList 检查IP是否在白名单中 |
| 65 | func 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是否被允许访问 |
| 76 | func AllowIPStrings(ipStrings []string, serverId int64) bool { |
no test coverage detected