This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View 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"`
}

View 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"` // 类型
}

View File

@@ -0,0 +1,7 @@
package ipconfigs
// IP名单引用
type IPListRef struct {
IsOn bool `yaml:"isOn" json:"isOn"`
ListId int64 `yaml:"listId" json:"listId"`
}

View 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,
},
}