mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-11-07 04:36:29 +08:00
增加基于tap设备的桥接访问模式
This commit is contained in:
36
dbdata/group.go
Normal file
36
dbdata/group.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user