用户端可以添加WAF 黑白名单

This commit is contained in:
GoEdgeLab
2021-01-03 20:18:47 +08:00
parent 4de1451a42
commit 4c2a4a0080
8 changed files with 508 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ package iplibrary
import "github.com/TeaOSLab/EdgeNode/internal/utils"
// IP条目
type IPItem struct {
Id int64
IPFrom uint32
@@ -9,6 +10,7 @@ type IPItem struct {
ExpiredAt int64
}
// 检查是否包含某个IP
func (this *IPItem) Contains(ip uint32) bool {
if this.IPTo == 0 {
if this.IPFrom != ip {