1.4.5.2
This commit is contained in:
17
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_item_config.go
Normal file
17
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_item_config.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package ipconfigs
|
||||
|
||||
type IPItemAction = string
|
||||
|
||||
const (
|
||||
IPItemActionAdd IPItemAction = "add"
|
||||
IPItemActionUpdate IPItemAction = "update"
|
||||
IPItemActionDelete IPItemAction = "delete"
|
||||
)
|
||||
|
||||
type IPItemConfig struct {
|
||||
Action IPItemAction `yaml:"action" json:"action"` // 对当前Item的操作
|
||||
Id int64 `yaml:"id" json:"id"`
|
||||
IPFrom string `yaml:"ipFrom" json:"ipFrom"`
|
||||
IPTo string `yaml:"ipTo" json:"ipTo"`
|
||||
ExpiredAt int64 `yaml:"expiredAt" json:"expiredAt"`
|
||||
}
|
||||
13
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_list_config.go
Normal file
13
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_list_config.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package ipconfigs
|
||||
|
||||
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
|
||||
// IP名单配置
|
||||
type IPListConfig struct {
|
||||
Id int64 `yaml:"id" json:"id"` // ID
|
||||
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
|
||||
Version int64 `yaml:"version" json:"version"` // 版本号
|
||||
Timeout *shared.TimeDuration `yaml:"timeout" json:"timeout"` // 默认超时时间
|
||||
Code string `yaml:"code" json:"code"` // 代号
|
||||
Type string `yaml:"type" json:"type"` // 类型
|
||||
}
|
||||
7
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_list_ref.go
Normal file
7
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_list_ref.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package ipconfigs
|
||||
|
||||
// IP名单引用
|
||||
type IPListRef struct {
|
||||
IsOn bool `yaml:"isOn" json:"isOn"`
|
||||
ListId int64 `yaml:"listId" json:"listId"`
|
||||
}
|
||||
26
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_list_types.go
Normal file
26
EdgeCommon/pkg/serverconfigs/ipconfigs/ip_list_types.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package ipconfigs
|
||||
|
||||
import "github.com/iwind/TeaGo/maps"
|
||||
|
||||
type IPListType = string
|
||||
|
||||
const (
|
||||
IPListTypeWhite IPListType = "white"
|
||||
IPListTypeBlack IPListType = "black"
|
||||
IPListTypeGrey IPListType = "grey"
|
||||
)
|
||||
|
||||
var IPListTypes = []maps.Map{
|
||||
{
|
||||
"name": "白名单",
|
||||
"code": IPListTypeWhite,
|
||||
},
|
||||
{
|
||||
"name": "黑名单",
|
||||
"code": IPListTypeBlack,
|
||||
},
|
||||
{
|
||||
"name": "灰名单",
|
||||
"code": IPListTypeGrey,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user