增加基于tap设备的桥接访问模式

This commit is contained in:
bjdgyc
2020-09-14 17:17:50 +08:00
parent 3b64de19b8
commit 31b1f12dbe
57 changed files with 2598 additions and 703 deletions

36
dbdata/group.go Normal file
View File

@@ -0,0 +1,36 @@
package dbdata
import (
"encoding/json"
"net"
"time"
)
const BucketGroup = "group"
type Group struct {
Id int
Name string
RouteInclude []string
RouteExclude []string
AllowLan bool
LinkAcl []struct {
Action string // allow、deny
IpNet string
IPNet net.IPNet
}
Bandwidth int // 带宽限制
CreatedAt time.Time
UpdatedAt time.Time
}
func GetGroups(lastKey string, prev bool) []Group {
res := getList(BucketUser, lastKey, prev)
datas := make([]Group, 0)
for _, data := range res {
d := Group{}
json.Unmarshal(data, &d)
datas = append(datas, d)
}
return datas
}