models

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminStateEnabled  = 1 // 已启用
	AdminStateDisabled = 0 // 已禁用
)
View Source
const (
	APINodeStateEnabled  = 1 // 已启用
	APINodeStateDisabled = 0 // 已禁用
)
View Source
const (
	ApiTokenStateEnabled  = 1 // 已启用
	ApiTokenStateDisabled = 0 // 已禁用
)
View Source
const (
	ClientBrowserStateEnabled  = 1 // 已启用
	ClientBrowserStateDisabled = 0 // 已禁用
)
View Source
const (
	ClientSystemStateEnabled  = 1 // 已启用
	ClientSystemStateDisabled = 0 // 已禁用
)
View Source
const (
	DBNodeStateEnabled  = 1 // 已启用
	DBNodeStateDisabled = 0 // 已禁用
)
View Source
const (
	FileStateEnabled  = 1 // 已启用
	FileStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPAccessLogPolicyStateEnabled  = 1 // 已启用
	HTTPAccessLogPolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPAuthPolicyStateEnabled  = 1 // 已启用
	HTTPAuthPolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPBrotliPolicyStateEnabled  = 1 // 已启用
	HTTPBrotliPolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPCachePolicyStateEnabled  = 1 // 已启用
	HTTPCachePolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPCacheTaskStateEnabled  = 1 // 已启用
	HTTPCacheTaskStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPDeflatePolicyStateEnabled  = 1 // 已启用
	HTTPDeflatePolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPFastcgiStateEnabled  = 1 // 已启用
	HTTPFastcgiStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPFirewallPolicyStateEnabled  = 1 // 已启用
	HTTPFirewallPolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPFirewallRuleStateEnabled  = 1 // 已启用
	HTTPFirewallRuleStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPFirewallRuleGroupStateEnabled  = 1 // 已启用
	HTTPFirewallRuleGroupStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPFirewallRuleSetStateEnabled  = 1 // 已启用
	HTTPFirewallRuleSetStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPGzipStateEnabled  = 1 // 已启用
	HTTPGzipStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPHeaderStateEnabled  = 1 // 已启用
	HTTPHeaderStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPHeaderPolicyStateEnabled  = 1 // 已启用
	HTTPHeaderPolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPLocationStateEnabled  = 1 // 已启用
	HTTPLocationStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPPageStateEnabled  = 1 // 已启用
	HTTPPageStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPRewriteRuleStateEnabled  = 1 // 已启用
	HTTPRewriteRuleStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPWebStateEnabled  = 1 // 已启用
	HTTPWebStateDisabled = 0 // 已禁用
)
View Source
const (
	HTTPWebsocketStateEnabled  = 1 // 已启用
	HTTPWebsocketStateDisabled = 0 // 已禁用
)
View Source
const (
	IPItemStateEnabled  = 1 // 已启用
	IPItemStateDisabled = 0 // 已禁用
)
View Source
const (
	IPLibraryArtifactStateEnabled  = 1 // 已启用
	IPLibraryArtifactStateDisabled = 0 // 已禁用
)
View Source
const (
	IPLibraryStateEnabled  = 1 // 已启用
	IPLibraryStateDisabled = 0 // 已禁用
)
View Source
const (
	IPLibraryFileStateEnabled  = 1 // 已启用
	IPLibraryFileStateDisabled = 0 // 已禁用
)
View Source
const (
	IPListStateEnabled  = 1 // 已启用
	IPListStateDisabled = 0 // 已禁用
)
View Source
const (
	LoginStateEnabled  = 1 // 已启用
	LoginStateDisabled = 0 // 已禁用
)
View Source
const (
	MessageStateEnabled  = 1 // 已启用
	MessageStateDisabled = 0 // 已禁用

	MessageLevelInfo    = "info"
	MessageLevelWarning = "warning"
	MessageLevelError   = "error"
	MessageLevelSuccess = "success"
)
View Source
const (
	MessageMediaStateEnabled  = 1 // 已启用
	MessageMediaStateDisabled = 0 // 已禁用
)
View Source
const (
	MessageMediaInstanceStateEnabled  = 1 // 已启用
	MessageMediaInstanceStateDisabled = 0 // 已禁用
)
View Source
const (
	MessageReceiverStateEnabled  = 1 // 已启用
	MessageReceiverStateDisabled = 0 // 已禁用
)
View Source
const (
	MessageRecipientStateEnabled  = 1 // 已启用
	MessageRecipientStateDisabled = 0 // 已禁用
)
View Source
const (
	MessageRecipientGroupStateEnabled  = 1 // 已启用
	MessageRecipientGroupStateDisabled = 0 // 已禁用
)
View Source
const (
	MetricChartStateEnabled  = 1 // 已启用
	MetricChartStateDisabled = 0 // 已禁用
)
View Source
const (
	MetricItemStateEnabled  = 1 // 已启用
	MetricItemStateDisabled = 0 // 已禁用
)
View Source
const (
	MonitorNodeStateEnabled  = 1 // 已启用
	MonitorNodeStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeClusterStateEnabled  = 1 // 已启用
	NodeClusterStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeClusterFirewallActionStateEnabled  = 1 // 已启用
	NodeClusterFirewallActionStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeClusterMetricItemStateEnabled  = 1 // 已启用
	NodeClusterMetricItemStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeStateEnabled  = 1 // 已启用
	NodeStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeGrantStateEnabled  = 1 // 已启用
	NodeGrantStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeGroupStateEnabled  = 1 // 已启用
	NodeGroupStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeIPAddressStateEnabled  = 1 // 已启用
	NodeIPAddressStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeIPAddressThresholdStateEnabled  = 1 // 已启用
	NodeIPAddressThresholdStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeLoginStateEnabled  = 1 // 已启用
	NodeLoginStateDisabled = 0 // 已禁用

	NodeLoginTypeSSH = "ssh"
)
View Source
const (
	NodePriceItemStateEnabled  = 1 // 已启用
	NodePriceItemStateDisabled = 0 // 已禁用

	NodePriceTypeTraffic = "traffic" // 价格类型之流量
)
View Source
const (
	NodeRegionStateEnabled  = 1 // 已启用
	NodeRegionStateDisabled = 0 // 已禁用
)
View Source
const (
	NodeThresholdStateEnabled  = 1 // 已启用
	NodeThresholdStateDisabled = 0 // 已禁用
)
View Source
const (
	LevelDebug   = "debug"
	LevelInfo    = "info"
	LevelWarning = "warning"
	LevelError   = "error"
	LevelSuccess = "success"

	LogTypeAdmin = "admin"
	LogTypeUser  = "user"
)
View Source
const (
	NSClusterStateEnabled  = 1 // 已启用
	NSClusterStateDisabled = 0 // 已禁用
)
View Source
const (
	NSNodeStateEnabled  = 1 // 已启用
	NSNodeStateDisabled = 0 // 已禁用
)
View Source
const (
	OriginStateEnabled  = 1 // 已启用
	OriginStateDisabled = 0 // 已禁用
)
View Source
const (
	PlanStateEnabled  = 1 // 已启用
	PlanStateDisabled = 0 // 已禁用
)
View Source
const (
	ProviderStateEnabled  = 1 // 已启用
	ProviderStateDisabled = 0 // 已禁用
)
View Source
const (
	ReportNodeStateEnabled  = 1 // 已启用
	ReportNodeStateDisabled = 0 // 已禁用
)
View Source
const (
	ReportNodeGroupStateEnabled  = 1 // 已启用
	ReportNodeGroupStateDisabled = 0 // 已禁用
)
View Source
const (
	ReverseProxyStateEnabled  = 1 // 已启用
	ReverseProxyStateDisabled = 0 // 已禁用
)
View Source
const (
	ServerStateEnabled  = 1 // 已启用
	ServerStateDisabled = 0 // 已禁用
)
View Source
const (
	ServerGroupStateEnabled  = 1 // 已启用
	ServerGroupStateDisabled = 0 // 已禁用
)
View Source
const (
	ServerStatBoardChartStateEnabled  = 1 // 已启用
	ServerStatBoardChartStateDisabled = 0 // 已禁用
)
View Source
const (
	ServerStatBoardStateEnabled  = 1 // 已启用
	ServerStatBoardStateDisabled = 0 // 已禁用
)
View Source
const (
	SSLCertStateEnabled  = 1 // 已启用
	SSLCertStateDisabled = 0 // 已禁用
)
View Source
const (
	SSLCertGroupStateEnabled  = 1 // 已启用
	SSLCertGroupStateDisabled = 0 // 已禁用
)
View Source
const (
	SSLPolicyStateEnabled  = 1 // 已启用
	SSLPolicyStateDisabled = 0 // 已禁用
)
View Source
const (
	SubUserStateEnabled  = 1 // 已启用
	SubUserStateDisabled = 0 // 已禁用
)
View Source
const (
	UserAccessKeyStateEnabled  = 1 // 已启用
	UserAccessKeyStateDisabled = 0 // 已禁用
)
View Source
const (
	UserStateEnabled  = 1 // 已启用
	UserStateDisabled = 0 // 已禁用
)
View Source
const (
	UserIdentityStateEnabled  = 1 // 已启用
	UserIdentityStateDisabled = 0 // 已禁用
)
View Source
const (
	UserNodeStateEnabled  = 1 // 已启用
	UserNodeStateDisabled = 0 // 已禁用
)
View Source
const (
	UserPlanStateEnabled  = 1 // 已启用
	UserPlanStateDisabled = 0 // 已禁用

	DefaultUserPlanMaxDay = "3000-01-01"
)
View Source
const DBNodePasswordEncodedPrefix = "EDGE_ENCODED:"
View Source
const MetricStatTablePartials = 20 // 表格Partial数量
View Source
const MetricSumStatTablePartials = 20 // 表格Partial数量
View Source
const (
	ServerBandwidthStatTablePartials = 20 // 分表数量
)
View Source
const (
	UserBandwidthStatTablePartials = 20
)

Variables

View Source
var DefaultGlobalIPList = &IPList{
	Id:       uint32(firewallconfigs.GlobalListId),
	Name:     "全局封锁名单",
	IsPublic: true,
	IsGlobal: true,
	Type:     "black",
	State:    IPListStateEnabled,
	IsOn:     true,
}
View Source
var ErrNotFound = errors.New("resource not found")
View Source
var SharedCacheLocker = sync.RWMutex{}

SharedCacheLocker 缓存专用Locker

View Source
var SharedHTTPAccessLogManager = NewHTTPAccessLogManager()

Functions

func AllAccessLogDBs

func AllAccessLogDBs() []*dbs.DB

func CheckSQLErrCode

func CheckSQLErrCode(err error, code uint16) bool

CheckSQLErrCode 检查数据库错误代码

func IsNotNull

func IsNotNull(data []byte) bool

IsNotNull 判断JSON是否不为空

func IsNull

func IsNull(data []byte) bool

IsNull 判断JSON是否为空

func JSONBytes

func JSONBytes(data []byte) []byte

JSONBytes 处理JSON字节Slice

func NewQuery

func NewQuery(tx *dbs.Tx, dao dbs.DAOWrapper, adminId int64, userId int64) *dbs.Query

NewQuery 构造Query

Types

type APIAccessToken

type APIAccessToken struct {
	Id        uint64 `field:"id"`        // ID
	UserId    uint32 `field:"userId"`    // 用户ID
	AdminId   uint32 `field:"adminId"`   // 管理员ID
	Token     string `field:"token"`     // 令牌
	CreatedAt uint64 `field:"createdAt"` // 创建时间
	ExpiredAt uint64 `field:"expiredAt"` // 过期时间
}

APIAccessToken API访问令牌

type APIAccessTokenDAO

type APIAccessTokenDAO dbs.DAO
var SharedAPIAccessTokenDAO *APIAccessTokenDAO

func NewAPIAccessTokenDAO

func NewAPIAccessTokenDAO() *APIAccessTokenDAO

func (*APIAccessTokenDAO) FindAccessToken

func (this *APIAccessTokenDAO) FindAccessToken(tx *dbs.Tx, token string) (*APIAccessToken, error)

FindAccessToken 查找AccessToken

func (*APIAccessTokenDAO) GenerateAccessToken

func (this *APIAccessTokenDAO) GenerateAccessToken(tx *dbs.Tx, adminId int64, userId int64) (token string, expiresAt int64, err error)

GenerateAccessToken 生成AccessToken

type APIAccessTokenOperator

type APIAccessTokenOperator struct {
	Id        interface{} // ID
	UserId    interface{} // 用户ID
	AdminId   interface{} // 管理员ID
	Token     interface{} // 令牌
	CreatedAt interface{} // 创建时间
	ExpiredAt interface{} // 过期时间
}

func NewAPIAccessTokenOperator

func NewAPIAccessTokenOperator() *APIAccessTokenOperator

type APIMethodStat

type APIMethodStat struct {
	Id         uint64  `field:"id"`         // ID
	ApiNodeId  uint32  `field:"apiNodeId"`  // API节点ID
	Method     string  `field:"method"`     // 方法
	Tag        string  `field:"tag"`        // 标签方法
	CostMs     float64 `field:"costMs"`     // 耗时Ms
	PeekMs     float64 `field:"peekMs"`     // 峰值耗时
	CountCalls uint64  `field:"countCalls"` // 调用次数
	Day        string  `field:"day"`        // 日期
}

APIMethodStat API方法统计

type APIMethodStatDAO

type APIMethodStatDAO dbs.DAO
var SharedAPIMethodStatDAO *APIMethodStatDAO

func NewAPIMethodStatDAO

func NewAPIMethodStatDAO() *APIMethodStatDAO

func (*APIMethodStatDAO) Clean

func (this *APIMethodStatDAO) Clean(tx *dbs.Tx) error

Clean 清理数据

func (*APIMethodStatDAO) CountAllStatsWithDay

func (this *APIMethodStatDAO) CountAllStatsWithDay(tx *dbs.Tx, day string) (int64, error)

CountAllStatsWithDay 统计当天数量

func (*APIMethodStatDAO) CreateStat

func (this *APIMethodStatDAO) CreateStat(tx *dbs.Tx, method string, tag string, costMs float64) error

CreateStat 记录统计数据

func (*APIMethodStatDAO) FindAllStatsWithDay

func (this *APIMethodStatDAO) FindAllStatsWithDay(tx *dbs.Tx, day string) (result []*APIMethodStat, err error)

FindAllStatsWithDay 查询当前统计

type APIMethodStatOperator

type APIMethodStatOperator struct {
	Id         interface{} // ID
	ApiNodeId  interface{} // API节点ID
	Method     interface{} // 方法
	Tag        interface{} // 标签方法
	CostMs     interface{} // 耗时Ms
	PeekMs     interface{} // 峰值耗时
	CountCalls interface{} // 调用次数
	Day        interface{} // 日期
}

func NewAPIMethodStatOperator

func NewAPIMethodStatOperator() *APIMethodStatOperator

type APINode

type APINode struct {
	Id          uint32   `field:"id"`          // ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	ClusterId   uint32   `field:"clusterId"`   // 专用集群ID
	UniqueId    string   `field:"uniqueId"`    // 唯一ID
	Secret      string   `field:"secret"`      // 密钥
	Name        string   `field:"name"`        // 名称
	Description string   `field:"description"` // 描述
	Http        dbs.JSON `field:"http"`        // 监听的HTTP配置
	Https       dbs.JSON `field:"https"`       // 监听的HTTPS配置
	RestIsOn    uint8    `field:"restIsOn"`    // 是否开放REST
	RestHTTP    dbs.JSON `field:"restHTTP"`    // REST HTTP配置
	RestHTTPS   dbs.JSON `field:"restHTTPS"`   // REST HTTPS配置
	AccessAddrs dbs.JSON `field:"accessAddrs"` // 外部访问地址
	Order       uint32   `field:"order"`       // 排序
	State       uint8    `field:"state"`       // 状态
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	Weight      uint32   `field:"weight"`      // 权重
	Status      dbs.JSON `field:"status"`      // 运行状态
	IsPrimary   bool     `field:"isPrimary"`   // 是否为主API节点
}

APINode API节点

func (*APINode) DecodeAccessAddrStrings

func (this *APINode) DecodeAccessAddrStrings() ([]string, error)

DecodeAccessAddrStrings 解析访问地址,并返回字符串形式

func (*APINode) DecodeAccessAddrs

func (this *APINode) DecodeAccessAddrs() ([]*serverconfigs.NetworkAddressConfig, error)

DecodeAccessAddrs 解析访问地址

func (*APINode) DecodeHTTP

func (this *APINode) DecodeHTTP() (*serverconfigs.HTTPProtocolConfig, error)

DecodeHTTP 解析HTTP配置

func (*APINode) DecodeHTTPS

func (this *APINode) DecodeHTTPS(tx *dbs.Tx, cacheMap *utils.CacheMap) (*serverconfigs.HTTPSProtocolConfig, error)

DecodeHTTPS 解析HTTPS配置

func (*APINode) DecodeRestHTTP

func (this *APINode) DecodeRestHTTP() (*serverconfigs.HTTPProtocolConfig, error)

DecodeRestHTTP 解析Rest HTTP配置

func (*APINode) DecodeRestHTTPS

func (this *APINode) DecodeRestHTTPS(tx *dbs.Tx, cacheMap *utils.CacheMap) (*serverconfigs.HTTPSProtocolConfig, error)

DecodeRestHTTPS 解析HTTPS配置

type APINodeDAO

type APINodeDAO dbs.DAO
var SharedAPINodeDAO *APINodeDAO

func NewAPINodeDAO

func NewAPINodeDAO() *APINodeDAO

func (*APINodeDAO) CheckAPINodeIsPrimary

func (this *APINodeDAO) CheckAPINodeIsPrimary(tx *dbs.Tx) (bool, error)

CheckAPINodeIsPrimary 检查当前节点是否为Primary节点

func (*APINodeDAO) CheckAPINodeIsPrimaryWithoutErr

func (this *APINodeDAO) CheckAPINodeIsPrimaryWithoutErr() bool

CheckAPINodeIsPrimaryWithoutErr 检查当前节点是否为Primary节点,并忽略错误

func (*APINodeDAO) CountAllEnabledAPINodes

func (this *APINodeDAO) CountAllEnabledAPINodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAPINodes 计算API节点数量

func (*APINodeDAO) CountAllEnabledAPINodesWithSSLPolicyIds

func (this *APINodeDAO) CountAllEnabledAPINodesWithSSLPolicyIds(tx *dbs.Tx, sslPolicyIds []int64) (count int64, err error)

CountAllEnabledAPINodesWithSSLPolicyIds 计算使用SSL策略的所有API节点数量

func (*APINodeDAO) CountAllEnabledAndOnAPINodes

func (this *APINodeDAO) CountAllEnabledAndOnAPINodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAndOnAPINodes 计算启用中的API节点数量

func (*APINodeDAO) CountAllEnabledAndOnOfflineAPINodes

func (this *APINodeDAO) CountAllEnabledAndOnOfflineAPINodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAndOnOfflineAPINodes 计算API节点数量

func (*APINodeDAO) CountAllLowerVersionNodes

func (this *APINodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有节点中低于某个版本的节点数量

func (*APINodeDAO) CreateAPINode

func (this *APINodeDAO) CreateAPINode(tx *dbs.Tx, name string, description string, httpJSON []byte, httpsJSON []byte, restIsOn bool, restHTTPJSON []byte, restHTTPSJSON []byte, accessAddrsJSON []byte, isOn bool) (nodeId int64, err error)

CreateAPINode 创建API节点

func (*APINodeDAO) DisableAPINode

func (this *APINodeDAO) DisableAPINode(tx *dbs.Tx, nodeId int64) error

DisableAPINode 禁用条目

func (*APINodeDAO) EnableAPINode

func (this *APINodeDAO) EnableAPINode(tx *dbs.Tx, id int64) error

EnableAPINode 启用条目

func (*APINodeDAO) FindAPINodeName

func (this *APINodeDAO) FindAPINodeName(tx *dbs.Tx, id int64) (string, error)

FindAPINodeName 根据主键查找名称

func (*APINodeDAO) FindAllEnabledAPIAccessIPs

func (this *APINodeDAO) FindAllEnabledAPIAccessIPs(tx *dbs.Tx, cacheMap *utils.CacheMap) ([]string, error)

FindAllEnabledAPIAccessIPs 获取所有的API可访问IP地址

func (*APINodeDAO) FindAllEnabledAPINodes

func (this *APINodeDAO) FindAllEnabledAPINodes(tx *dbs.Tx) (result []*APINode, err error)

FindAllEnabledAPINodes 列出所有可用API节点

func (*APINodeDAO) FindAllEnabledAndOnAPINodes

func (this *APINodeDAO) FindAllEnabledAndOnAPINodes(tx *dbs.Tx) (result []*APINode, err error)

FindAllEnabledAndOnAPINodes 列出所有可用而且启用的API节点

func (*APINodeDAO) FindEnabledAPINode

func (this *APINodeDAO) FindEnabledAPINode(tx *dbs.Tx, id int64, cacheMap *utils.CacheMap) (*APINode, error)

FindEnabledAPINode 查找启用中的条目

func (*APINodeDAO) FindEnabledAPINodeIdWithAddr

func (this *APINodeDAO) FindEnabledAPINodeIdWithAddr(tx *dbs.Tx, protocol string, host string, port int) (int64, error)

FindEnabledAPINodeIdWithAddr 根据主机名和端口获取ID

func (*APINodeDAO) FindEnabledAPINodeWithUniqueIdAndSecret

func (this *APINodeDAO) FindEnabledAPINodeWithUniqueIdAndSecret(tx *dbs.Tx, uniqueId string, secret string) (*APINode, error)

FindEnabledAPINodeWithUniqueIdAndSecret 根据ID和Secret查找节点

func (*APINodeDAO) ListEnabledAPINodes

func (this *APINodeDAO) ListEnabledAPINodes(tx *dbs.Tx, offset int64, size int64) (result []*APINode, err error)

ListEnabledAPINodes 列出单页的API节点

func (*APINodeDAO) NotifyUpdate

func (this *APINodeDAO) NotifyUpdate(tx *dbs.Tx, apiNodeId int64) error

NotifyUpdate 通知变更

func (*APINodeDAO) ResetPrimaryAPINode

func (this *APINodeDAO) ResetPrimaryAPINode(tx *dbs.Tx) error

ResetPrimaryAPINode 重置Primary节点

func (*APINodeDAO) UpdateAPINode

func (this *APINodeDAO) UpdateAPINode(tx *dbs.Tx, nodeId int64, name string, description string, httpJSON []byte, httpsJSON []byte, restIsOn bool, restHTTPJSON []byte, restHTTPSJSON []byte, accessAddrsJSON []byte, isOn bool, isPrimary bool) error

UpdateAPINode 修改API节点

func (*APINodeDAO) UpdateAPINodeStatus

func (this *APINodeDAO) UpdateAPINodeStatus(tx *dbs.Tx, apiNodeId int64, statusJSON []byte) error

UpdateAPINodeStatus 设置API节点状态

type APINodeOperator

type APINodeOperator struct {
	Id          interface{} // ID
	IsOn        interface{} // 是否启用
	ClusterId   interface{} // 专用集群ID
	UniqueId    interface{} // 唯一ID
	Secret      interface{} // 密钥
	Name        interface{} // 名称
	Description interface{} // 描述
	Http        interface{} // 监听的HTTP配置
	Https       interface{} // 监听的HTTPS配置
	RestIsOn    interface{} // 是否开放REST
	RestHTTP    interface{} // REST HTTP配置
	RestHTTPS   interface{} // REST HTTPS配置
	AccessAddrs interface{} // 外部访问地址
	Order       interface{} // 排序
	State       interface{} // 状态
	CreatedAt   interface{} // 创建时间
	AdminId     interface{} // 管理员ID
	Weight      interface{} // 权重
	Status      interface{} // 运行状态
	IsPrimary   interface{} // 是否为主API节点
}

func NewAPINodeOperator

func NewAPINodeOperator() *APINodeOperator

type Admin

type Admin struct {
	Id        uint32   `field:"id"`        // ID
	IsOn      bool     `field:"isOn"`      // 是否启用
	Username  string   `field:"username"`  // 用户名
	Password  string   `field:"password"`  // 密码
	Fullname  string   `field:"fullname"`  // 全名
	IsSuper   bool     `field:"isSuper"`   // 是否为超级管理员
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	UpdatedAt uint64   `field:"updatedAt"` // 修改时间
	State     uint8    `field:"state"`     // 状态
	Modules   dbs.JSON `field:"modules"`   // 允许的模块
	CanLogin  bool     `field:"canLogin"`  // 是否可以登录
	Theme     string   `field:"theme"`     // 模板设置
}

Admin 管理员

type AdminDAO

type AdminDAO dbs.DAO
var SharedAdminDAO *AdminDAO

func NewAdminDAO

func NewAdminDAO() *AdminDAO

func (*AdminDAO) CheckAdminPassword

func (this *AdminDAO) CheckAdminPassword(tx *dbs.Tx, username string, encryptedPassword string) (int64, error)

CheckAdminPassword 检查用户名、密码

func (*AdminDAO) CheckAdminUsername

func (this *AdminDAO) CheckAdminUsername(tx *dbs.Tx, adminId int64, username string) (bool, error)

CheckAdminUsername 检查用户名是否存在

func (*AdminDAO) CountAllEnabledAdmins

func (this *AdminDAO) CountAllEnabledAdmins(tx *dbs.Tx) (int64, error)

CountAllEnabledAdmins 计算所有管理员数量

func (*AdminDAO) CreateAdmin

func (this *AdminDAO) CreateAdmin(tx *dbs.Tx, username string, canLogin bool, password string, fullname string, isSuper bool, modulesJSON []byte) (int64, error)

CreateAdmin 创建管理员

func (*AdminDAO) DisableAdmin

func (this *AdminDAO) DisableAdmin(tx *dbs.Tx, id int64) (rowsAffected int64, err error)

DisableAdmin 禁用条目

func (*AdminDAO) EnableAdmin

func (this *AdminDAO) EnableAdmin(tx *dbs.Tx, id int64) (rowsAffected int64, err error)

EnableAdmin 启用条目

func (*AdminDAO) ExistEnabledAdmin

func (this *AdminDAO) ExistEnabledAdmin(tx *dbs.Tx, adminId int64) (bool, error)

ExistEnabledAdmin 检查管理员是否存在

func (*AdminDAO) FindAdminFullname

func (this *AdminDAO) FindAdminFullname(tx *dbs.Tx, adminId int64) (string, error)

FindAdminFullname 获取管理员名称

func (*AdminDAO) FindAdminIdWithUsername

func (this *AdminDAO) FindAdminIdWithUsername(tx *dbs.Tx, username string) (int64, error)

FindAdminIdWithUsername 根据用户名查询管理员ID

func (*AdminDAO) FindAllAdminModules

func (this *AdminDAO) FindAllAdminModules(tx *dbs.Tx) (result []*Admin, err error)

FindAllAdminModules 查询所有管理的权限

func (*AdminDAO) FindBasicAdmin added in v0.5.0

func (this *AdminDAO) FindBasicAdmin(tx *dbs.Tx, id int64) (*Admin, error)

FindBasicAdmin 查找管理员基本信息

func (*AdminDAO) FindEnabledAdmin

func (this *AdminDAO) FindEnabledAdmin(tx *dbs.Tx, id int64) (*Admin, error)

FindEnabledAdmin 查找启用中的条目

func (*AdminDAO) ListEnabledAdmins

func (this *AdminDAO) ListEnabledAdmins(tx *dbs.Tx, offset int64, size int64) (result []*Admin, err error)

ListEnabledAdmins 列出单页的管理员

func (*AdminDAO) UpdateAdmin

func (this *AdminDAO) UpdateAdmin(tx *dbs.Tx, adminId int64, username string, canLogin bool, password string, fullname string, isSuper bool, modulesJSON []byte, isOn bool) error

UpdateAdmin 修改管理员详细信息

func (*AdminDAO) UpdateAdminInfo

func (this *AdminDAO) UpdateAdminInfo(tx *dbs.Tx, adminId int64, fullname string) error

UpdateAdminInfo 修改管理员个人资料

func (*AdminDAO) UpdateAdminLogin

func (this *AdminDAO) UpdateAdminLogin(tx *dbs.Tx, adminId int64, username string, password string) error

UpdateAdminLogin 修改管理员登录信息

func (*AdminDAO) UpdateAdminModules

func (this *AdminDAO) UpdateAdminModules(tx *dbs.Tx, adminId int64, allowModulesJSON []byte) error

UpdateAdminModules 修改管理员可以管理的模块

func (*AdminDAO) UpdateAdminPassword

func (this *AdminDAO) UpdateAdminPassword(tx *dbs.Tx, adminId int64, password string) error

UpdateAdminPassword 更改管理员密码

func (*AdminDAO) UpdateAdminTheme

func (this *AdminDAO) UpdateAdminTheme(tx *dbs.Tx, adminId int64, theme string) error

UpdateAdminTheme 设置管理员Theme

type AdminOperator

type AdminOperator struct {
	Id        any // ID
	IsOn      any // 是否启用
	Username  any // 用户名
	Password  any // 密码
	Fullname  any // 全名
	IsSuper   any // 是否为超级管理员
	CreatedAt any // 创建时间
	UpdatedAt any // 修改时间
	State     any // 状态
	Modules   any // 允许的模块
	CanLogin  any // 是否可以登录
	Theme     any // 模板设置
}

func NewAdminOperator

func NewAdminOperator() *AdminOperator

type ApiToken

type ApiToken struct {
	Id     uint32 `field:"id"`     // ID
	NodeId string `field:"nodeId"` // 节点ID
	Secret string `field:"secret"` // 节点密钥
	Role   string `field:"role"`   // 节点角色
	State  uint8  `field:"state"`  // 状态
}

API令牌管理

type ApiTokenDAO

type ApiTokenDAO dbs.DAO
var SharedApiTokenDAO *ApiTokenDAO

func NewApiTokenDAO

func NewApiTokenDAO() *ApiTokenDAO

func (*ApiTokenDAO) CreateAPIToken

func (this *ApiTokenDAO) CreateAPIToken(tx *dbs.Tx, nodeId string, secret string, role nodeconfigs.NodeRole) error

CreateAPIToken 保存API Token

func (*ApiTokenDAO) DisableApiToken

func (this *ApiTokenDAO) DisableApiToken(tx *dbs.Tx, id uint32) (rowsAffected int64, err error)

DisableApiToken 禁用条目

func (*ApiTokenDAO) EnableApiToken

func (this *ApiTokenDAO) EnableApiToken(tx *dbs.Tx, id uint32) (rowsAffected int64, err error)

EnableApiToken 启用条目

func (*ApiTokenDAO) FindAllEnabledAPITokens

func (this *ApiTokenDAO) FindAllEnabledAPITokens(tx *dbs.Tx, role string) (result []*ApiToken, err error)

FindAllEnabledAPITokens 读取API令牌

func (*ApiTokenDAO) FindEnabledApiToken

func (this *ApiTokenDAO) FindEnabledApiToken(tx *dbs.Tx, id uint32) (*ApiToken, error)

FindEnabledApiToken 查找启用中的条目

func (*ApiTokenDAO) FindEnabledTokenWithNode

func (this *ApiTokenDAO) FindEnabledTokenWithNode(tx *dbs.Tx, nodeId string) (*ApiToken, error)

FindEnabledTokenWithNode 获取节点Token信息并可以缓存

func (*ApiTokenDAO) FindEnabledTokenWithNodeCacheable

func (this *ApiTokenDAO) FindEnabledTokenWithNodeCacheable(tx *dbs.Tx, nodeId string) (*ApiToken, error)

FindEnabledTokenWithNodeCacheable 获取可缓存的节点Token信息

func (*ApiTokenDAO) FindEnabledTokenWithRole

func (this *ApiTokenDAO) FindEnabledTokenWithRole(tx *dbs.Tx, role string) (*ApiToken, error)

FindEnabledTokenWithRole 根据角色获取节点

type ApiTokenOperator

type ApiTokenOperator struct {
	Id     interface{} // ID
	NodeId interface{} // 节点ID
	Secret interface{} // 节点密钥
	Role   interface{} // 节点角色
	State  interface{} // 状态
}

func NewApiTokenOperator

func NewApiTokenOperator() *ApiTokenOperator

type BillType

type BillType = string
const (
	BillTypeTraffic BillType = "traffic" // 按流量计费
)

type ClientBrowser

type ClientBrowser struct {
	Id    uint32   `field:"id"`    // ID
	Name  string   `field:"name"`  // 浏览器名称
	Codes dbs.JSON `field:"codes"` // 代号
	State uint8    `field:"state"` // 状态
}

ClientBrowser 终端浏览器信息

type ClientBrowserDAO

type ClientBrowserDAO dbs.DAO
var SharedClientBrowserDAO *ClientBrowserDAO

func NewClientBrowserDAO

func NewClientBrowserDAO() *ClientBrowserDAO

func (*ClientBrowserDAO) CreateBrowser

func (this *ClientBrowserDAO) CreateBrowser(tx *dbs.Tx, browserName string) (int64, error)

CreateBrowser 创建浏览器

func (*ClientBrowserDAO) DisableClientBrowser

func (this *ClientBrowserDAO) DisableClientBrowser(tx *dbs.Tx, id uint32) error

DisableClientBrowser 禁用条目

func (*ClientBrowserDAO) EnableClientBrowser

func (this *ClientBrowserDAO) EnableClientBrowser(tx *dbs.Tx, id uint32) error

EnableClientBrowser 启用条目

func (*ClientBrowserDAO) FindBrowserIdWithNameCacheable

func (this *ClientBrowserDAO) FindBrowserIdWithNameCacheable(tx *dbs.Tx, browserName string) (int64, error)

FindBrowserIdWithNameCacheable 根据浏览器名称查找浏览器ID

func (*ClientBrowserDAO) FindClientBrowserName

func (this *ClientBrowserDAO) FindClientBrowserName(tx *dbs.Tx, id uint32) (string, error)

FindClientBrowserName 根据主键查找名称

func (*ClientBrowserDAO) FindEnabledClientBrowser

func (this *ClientBrowserDAO) FindEnabledClientBrowser(tx *dbs.Tx, id int64) (*ClientBrowser, error)

FindEnabledClientBrowser 查找启用中的条目

type ClientBrowserOperator

type ClientBrowserOperator struct {
	Id    interface{} // ID
	Name  interface{} // 浏览器名称
	Codes interface{} // 代号
	State interface{} // 状态
}

func NewClientBrowserOperator

func NewClientBrowserOperator() *ClientBrowserOperator

type ClientSystem

type ClientSystem struct {
	Id    uint32   `field:"id"`    // ID
	Name  string   `field:"name"`  // 系统名称
	Codes dbs.JSON `field:"codes"` // 代号
	State uint8    `field:"state"` //
}

ClientSystem 终端操作系统信息

type ClientSystemDAO

type ClientSystemDAO dbs.DAO
var SharedClientSystemDAO *ClientSystemDAO

func NewClientSystemDAO

func NewClientSystemDAO() *ClientSystemDAO

func (*ClientSystemDAO) CreateSystem

func (this *ClientSystemDAO) CreateSystem(tx *dbs.Tx, systemName string) (int64, error)

CreateSystem 创建浏览器

func (*ClientSystemDAO) DisableClientSystem

func (this *ClientSystemDAO) DisableClientSystem(tx *dbs.Tx, id uint32) error

DisableClientSystem 禁用条目

func (*ClientSystemDAO) EnableClientSystem

func (this *ClientSystemDAO) EnableClientSystem(tx *dbs.Tx, id uint32) error

EnableClientSystem 启用条目

func (*ClientSystemDAO) FindClientSystemName

func (this *ClientSystemDAO) FindClientSystemName(tx *dbs.Tx, id uint32) (string, error)

FindClientSystemName 根据主键查找名称

func (*ClientSystemDAO) FindEnabledClientSystem

func (this *ClientSystemDAO) FindEnabledClientSystem(tx *dbs.Tx, id int64) (*ClientSystem, error)

FindEnabledClientSystem 查找启用中的条目

func (*ClientSystemDAO) FindSystemIdWithNameCacheable

func (this *ClientSystemDAO) FindSystemIdWithNameCacheable(tx *dbs.Tx, systemName string) (int64, error)

FindSystemIdWithNameCacheable 根据操作系统名称查找系统ID

type ClientSystemOperator

type ClientSystemOperator struct {
	Id    interface{} // ID
	Name  interface{} // 系统名称
	Codes interface{} // 代号
	State interface{} //
}

func NewClientSystemOperator

func NewClientSystemOperator() *ClientSystemOperator

type DBNode

type DBNode struct {
	Id          uint32 `field:"id"`          // ID
	IsOn        bool   `field:"isOn"`        // 是否启用
	Role        string `field:"role"`        // 数据库角色
	Name        string `field:"name"`        // 名称
	Description string `field:"description"` // 描述
	Host        string `field:"host"`        // 主机
	Port        uint32 `field:"port"`        // 端口
	Database    string `field:"database"`    // 数据库名称
	Username    string `field:"username"`    // 用户名
	Password    string `field:"password"`    // 密码
	Charset     string `field:"charset"`     // 通讯字符集
	ConnTimeout uint32 `field:"connTimeout"` // 连接超时时间(秒)
	State       uint8  `field:"state"`       // 状态
	CreatedAt   uint64 `field:"createdAt"`   // 创建时间
	Weight      uint32 `field:"weight"`      // 权重
	Order       uint32 `field:"order"`       // 排序
	AdminId     uint32 `field:"adminId"`     // 管理员ID
}

DBNode 数据库节点

func (*DBNode) DBConfig

func (this *DBNode) DBConfig() *dbs.DBConfig

获取数据库配置

type DBNodeDAO

type DBNodeDAO dbs.DAO
var SharedDBNodeDAO *DBNodeDAO

func NewDBNodeDAO

func NewDBNodeDAO() *DBNodeDAO

func (*DBNodeDAO) CheckNodeIsOn

func (this *DBNodeDAO) CheckNodeIsOn(tx *dbs.Tx, nodeId int64) (bool, error)

CheckNodeIsOn 检查节点是否已经启用

func (*DBNodeDAO) CountAllEnabledNodes

func (this *DBNodeDAO) CountAllEnabledNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledNodes 计算可用的节点数量

func (*DBNodeDAO) CreateDBNode

func (this *DBNodeDAO) CreateDBNode(tx *dbs.Tx, isOn bool, name string, description string, host string, port int32, database string, username string, password string, charset string) (int64, error)

CreateDBNode 创建节点

func (*DBNodeDAO) DecodePassword

func (this *DBNodeDAO) DecodePassword(password string) string

DecodePassword 解密密码

func (*DBNodeDAO) DisableDBNode

func (this *DBNodeDAO) DisableDBNode(tx *dbs.Tx, nodeId int64) error

DisableDBNode 禁用条目

func (*DBNodeDAO) EnableDBNode

func (this *DBNodeDAO) EnableDBNode(tx *dbs.Tx, id int64) error

EnableDBNode 启用条目

func (*DBNodeDAO) EncodePassword

func (this *DBNodeDAO) EncodePassword(password string) string

EncodePassword 加密密码

func (*DBNodeDAO) FindAllEnabledAndOnDBNodes

func (this *DBNodeDAO) FindAllEnabledAndOnDBNodes(tx *dbs.Tx) (result []*DBNode, err error)

FindAllEnabledAndOnDBNodes 查找所有可用的数据库节点

func (*DBNodeDAO) FindDBNodeName

func (this *DBNodeDAO) FindDBNodeName(tx *dbs.Tx, id int64) (string, error)

FindDBNodeName 根据主键查找名称

func (*DBNodeDAO) FindEnabledDBNode

func (this *DBNodeDAO) FindEnabledDBNode(tx *dbs.Tx, id int64) (*DBNode, error)

FindEnabledDBNode 查找启用中的条目

func (*DBNodeDAO) ListEnabledNodes

func (this *DBNodeDAO) ListEnabledNodes(tx *dbs.Tx, offset int64, size int64) (result []*DBNode, err error)

ListEnabledNodes 获取单页的节点

func (*DBNodeDAO) UpdateNode

func (this *DBNodeDAO) UpdateNode(tx *dbs.Tx, nodeId int64, isOn bool, name string, description string, host string, port int32, database string, username string, password string, charset string) error

UpdateNode 修改节点

type DBNodeInitializer

type DBNodeInitializer struct {
}

DBNodeInitializer 初始化数据库连接

func NewDBNodeInitializer

func NewDBNodeInitializer() *DBNodeInitializer

func (*DBNodeInitializer) Start

func (this *DBNodeInitializer) Start()

Start 启动

type DBNodeOperator

type DBNodeOperator struct {
	Id          interface{} // ID
	IsOn        interface{} // 是否启用
	Role        interface{} // 数据库角色
	Name        interface{} // 名称
	Description interface{} // 描述
	Host        interface{} // 主机
	Port        interface{} // 端口
	Database    interface{} // 数据库名称
	Username    interface{} // 用户名
	Password    interface{} // 密码
	Charset     interface{} // 通讯字符集
	ConnTimeout interface{} // 连接超时时间(秒)
	State       interface{} // 状态
	CreatedAt   interface{} // 创建时间
	Weight      interface{} // 权重
	Order       interface{} // 排序
	AdminId     interface{} // 管理员ID
}

func NewDBNodeOperator

func NewDBNodeOperator() *DBNodeOperator

type EventInterface

type EventInterface interface {
	Type() string
	Run() error
}

接口

type File

type File struct {
	Id          uint32 `field:"id"`          // ID
	AdminId     uint32 `field:"adminId"`     // 管理员ID
	Code        string `field:"code"`        // 代号
	UserId      uint32 `field:"userId"`      // 用户ID
	Description string `field:"description"` // 文件描述
	Filename    string `field:"filename"`    // 文件名
	Size        uint32 `field:"size"`        // 文件尺寸
	MimeType    string `field:"mimeType"`    // Mime类型
	CreatedAt   uint64 `field:"createdAt"`   // 创建时间
	Order       uint32 `field:"order"`       // 排序
	Type        string `field:"type"`        // 类型
	State       uint8  `field:"state"`       // 状态
	IsFinished  bool   `field:"isFinished"`  // 是否已完成上传
	IsPublic    bool   `field:"isPublic"`    // 是否可以公开访问
}

File 文件管理

type FileChunk

type FileChunk struct {
	Id     uint32 `field:"id"`     // ID
	FileId uint32 `field:"fileId"` // 文件ID
	Data   []byte `field:"data"`   // 分块内容
}

type FileChunkDAO

type FileChunkDAO dbs.DAO
var SharedFileChunkDAO *FileChunkDAO

func NewFileChunkDAO

func NewFileChunkDAO() *FileChunkDAO

func (*FileChunkDAO) CreateFileChunk

func (this *FileChunkDAO) CreateFileChunk(tx *dbs.Tx, fileId int64, data []byte) (int64, error)

CreateFileChunk 创建文件Chunk

func (*FileChunkDAO) DeleteFileChunks

func (this *FileChunkDAO) DeleteFileChunks(tx *dbs.Tx, fileId int64) error

DeleteFileChunks 删除以前的文件

func (*FileChunkDAO) FindAllFileChunkIds

func (this *FileChunkDAO) FindAllFileChunkIds(tx *dbs.Tx, fileId int64) ([]int64, error)

FindAllFileChunkIds 读取文件的所有片段ID

func (*FileChunkDAO) FindAllFileChunks

func (this *FileChunkDAO) FindAllFileChunks(tx *dbs.Tx, fileId int64) (result []*FileChunk, err error)

FindAllFileChunks 列出所有的文件Chunk

func (*FileChunkDAO) FindFileChunk

func (this *FileChunkDAO) FindFileChunk(tx *dbs.Tx, chunkId int64) (*FileChunk, error)

FindFileChunk 根据ID查找片段

type FileChunkOperator

type FileChunkOperator struct {
	Id     interface{} // ID
	FileId interface{} // 文件ID
	Data   interface{} // 分块内容
}

func NewFileChunkOperator

func NewFileChunkOperator() *FileChunkOperator

type FileDAO

type FileDAO dbs.DAO
var SharedFileDAO *FileDAO

func NewFileDAO

func NewFileDAO() *FileDAO

func (*FileDAO) CheckUserFile added in v0.4.10

func (this *FileDAO) CheckUserFile(tx *dbs.Tx, userId int64, fileId int64) error

CheckUserFile 检查用户ID

func (*FileDAO) CreateFile

func (this *FileDAO) CreateFile(tx *dbs.Tx, adminId int64, userId int64, businessType string, description string, filename string, size int64, mimeType string, isPublic bool) (int64, error)

CreateFile 创建文件

func (*FileDAO) DisableFile

func (this *FileDAO) DisableFile(tx *dbs.Tx, id int64) error

DisableFile 禁用条目

func (*FileDAO) EnableFile

func (this *FileDAO) EnableFile(tx *dbs.Tx, id int64) error

EnableFile 启用条目

func (*FileDAO) FindEnabledFile

func (this *FileDAO) FindEnabledFile(tx *dbs.Tx, id int64) (*File, error)

FindEnabledFile 查找启用中的条目

func (*FileDAO) UpdateFileIsFinished

func (this *FileDAO) UpdateFileIsFinished(tx *dbs.Tx, fileId int64) error

UpdateFileIsFinished 将文件置为已完成

type FileOperator

type FileOperator struct {
	Id          interface{} // ID
	AdminId     interface{} // 管理员ID
	Code        interface{} // 代号
	UserId      interface{} // 用户ID
	Description interface{} // 文件描述
	Filename    interface{} // 文件名
	Size        interface{} // 文件尺寸
	MimeType    interface{} // Mime类型
	CreatedAt   interface{} // 创建时间
	Order       interface{} // 排序
	Type        interface{} // 类型
	State       interface{} // 状态
	IsFinished  interface{} // 是否已完成上传
	IsPublic    interface{} // 是否可以公开访问
}

func NewFileOperator

func NewFileOperator() *FileOperator

type HTTPAccessLog

type HTTPAccessLog struct {
	Id                  uint64   `field:"id"`                  // ID
	ServerId            uint32   `field:"serverId"`            // 服务ID
	NodeId              uint32   `field:"nodeId"`              // 节点ID
	Status              uint32   `field:"status"`              // 状态码
	CreatedAt           uint64   `field:"createdAt"`           // 创建时间
	Content             dbs.JSON `field:"content"`             // 日志内容
	RequestId           string   `field:"requestId"`           // 请求ID
	FirewallPolicyId    uint32   `field:"firewallPolicyId"`    // WAF策略ID
	FirewallRuleGroupId uint32   `field:"firewallRuleGroupId"` // WAF分组ID
	FirewallRuleSetId   uint32   `field:"firewallRuleSetId"`   // WAF集ID
	FirewallRuleId      uint32   `field:"firewallRuleId"`      // WAF规则ID
	RemoteAddr          string   `field:"remoteAddr"`          // IP地址
	Domain              string   `field:"domain"`              // 域名
	RequestBody         []byte   `field:"requestBody"`         // 请求内容
	ResponseBody        []byte   `field:"responseBody"`        // 响应内容
}

HTTPAccessLog 访问日志

func (*HTTPAccessLog) ToPB

func (this *HTTPAccessLog) ToPB() (*pb.HTTPAccessLog, error)

ToPB 转换成PB对象

type HTTPAccessLogDAO

type HTTPAccessLogDAO dbs.DAO
var SharedHTTPAccessLogDAO *HTTPAccessLogDAO

func NewHTTPAccessLogDAO

func NewHTTPAccessLogDAO() *HTTPAccessLogDAO

func (*HTTPAccessLogDAO) CreateHTTPAccessLog

func (this *HTTPAccessLogDAO) CreateHTTPAccessLog(tx *dbs.Tx, dao *HTTPAccessLogDAO, accessLog *pb.HTTPAccessLog) error

CreateHTTPAccessLog 写入单条访问日志

func (*HTTPAccessLogDAO) CreateHTTPAccessLogs

func (this *HTTPAccessLogDAO) CreateHTTPAccessLogs(tx *dbs.Tx, accessLogs []*pb.HTTPAccessLog) error

CreateHTTPAccessLogs 创建访问日志

func (*HTTPAccessLogDAO) DumpAccessLogsFromQueue

func (this *HTTPAccessLogDAO) DumpAccessLogsFromQueue(size int) (hasMore bool, err error)

DumpAccessLogsFromQueue 从队列导入访问日志

func (*HTTPAccessLogDAO) FindAccessLogWithRequestId

func (this *HTTPAccessLogDAO) FindAccessLogWithRequestId(tx *dbs.Tx, requestId string) (*HTTPAccessLog, error)

FindAccessLogWithRequestId 根据请求ID获取访问日志

func (*HTTPAccessLogDAO) ListAccessLogs

func (this *HTTPAccessLogDAO) ListAccessLogs(tx *dbs.Tx,
	partition int32,
	lastRequestId string,
	size int64,
	day string,
	hourFrom string,
	hourTo string,
	clusterId int64,
	nodeId int64,
	serverId int64,
	reverse bool,
	hasError bool,
	firewallPolicyId int64,
	firewallRuleGroupId int64,
	firewallRuleSetId int64,
	hasFirewallPolicy bool,
	userId int64,
	keyword string,
	ip string,
	domain string) (result []*HTTPAccessLog, nextLastRequestId string, hasMore bool, err error)

ListAccessLogs 读取往前的 单页访问日志

func (*HTTPAccessLogDAO) SetupQueue

func (this *HTTPAccessLogDAO) SetupQueue()

SetupQueue 建立队列

type HTTPAccessLogDAOWrapper

type HTTPAccessLogDAOWrapper struct {
	DAO    *HTTPAccessLogDAO
	NodeId int64
}

HTTPAccessLogDAOWrapper HTTP访问日志DAO

type HTTPAccessLogManager

type HTTPAccessLogManager struct {
	// contains filtered or unexported fields
}

func NewHTTPAccessLogManager

func NewHTTPAccessLogManager() *HTTPAccessLogManager

func (*HTTPAccessLogManager) CreateTable

func (this *HTTPAccessLogManager) CreateTable(db *dbs.DB, tableName string) error

CreateTable 创建访问日志表格

func (*HTTPAccessLogManager) FindLastTable

func (this *HTTPAccessLogManager) FindLastTable(db *dbs.DB, day string, force bool) (*httpAccessLogDefinition, error)

FindLastTable 根据日期获取上一个可以使用的表名 表名组成

  • PREFIX_DAY
  • PREFIX_DAY_0001

func (*HTTPAccessLogManager) FindLatestPartition

func (this *HTTPAccessLogManager) FindLatestPartition(day string) (int32, error)

FindLatestPartition 读取最后一个分区

func (*HTTPAccessLogManager) FindPartitionTable

func (this *HTTPAccessLogManager) FindPartitionTable(db *dbs.DB, day string, partition int32) (*httpAccessLogDefinition, error)

func (*HTTPAccessLogManager) FindTableNames

func (this *HTTPAccessLogManager) FindTableNames(db *dbs.DB, day string) ([]string, error)

FindTableNames 读取数据库中某日所有日志表名称

func (*HTTPAccessLogManager) FindTables

func (this *HTTPAccessLogManager) FindTables(db *dbs.DB, day string) ([]*httpAccessLogDefinition, error)

FindTables 读取数据库中某日所有日志表

func (*HTTPAccessLogManager) ResetTable

func (this *HTTPAccessLogManager) ResetTable(db *dbs.DB, day string)

ResetTable 清除某个数据库表名缓存

func (*HTTPAccessLogManager) TablePartition

func (this *HTTPAccessLogManager) TablePartition(tableName string) (partition int32)

TablePartition 从表名中获取分区

type HTTPAccessLogOperator

type HTTPAccessLogOperator struct {
	Id                  interface{} // ID
	ServerId            interface{} // 服务ID
	NodeId              interface{} // 节点ID
	Status              interface{} // 状态码
	CreatedAt           interface{} // 创建时间
	Content             interface{} // 日志内容
	RequestId           interface{} // 请求ID
	FirewallPolicyId    interface{} // WAF策略ID
	FirewallRuleGroupId interface{} // WAF分组ID
	FirewallRuleSetId   interface{} // WAF集ID
	FirewallRuleId      interface{} // WAF规则ID
	RemoteAddr          interface{} // IP地址
	Domain              interface{} // 域名
	RequestBody         interface{} // 请求内容
	ResponseBody        interface{} // 响应内容
}

func NewHTTPAccessLogOperator

func NewHTTPAccessLogOperator() *HTTPAccessLogOperator

type HTTPAccessLogPolicy

type HTTPAccessLogPolicy struct {
	Id           uint32   `field:"id"`           // ID
	TemplateId   uint32   `field:"templateId"`   // 模版ID
	AdminId      uint32   `field:"adminId"`      // 管理员ID
	UserId       uint32   `field:"userId"`       // 用户ID
	State        uint8    `field:"state"`        // 状态
	CreatedAt    uint64   `field:"createdAt"`    // 创建时间
	Name         string   `field:"name"`         // 名称
	IsOn         bool     `field:"isOn"`         // 是否启用
	Type         string   `field:"type"`         // 存储类型
	Options      dbs.JSON `field:"options"`      // 存储选项
	Conds        dbs.JSON `field:"conds"`        // 请求条件
	IsPublic     bool     `field:"isPublic"`     // 是否为公用
	FirewallOnly uint8    `field:"firewallOnly"` // 是否只记录防火墙相关
	Version      uint32   `field:"version"`      // 版本号
}

HTTPAccessLogPolicy 访问日志策略

type HTTPAccessLogPolicyDAO

type HTTPAccessLogPolicyDAO dbs.DAO
var SharedHTTPAccessLogPolicyDAO *HTTPAccessLogPolicyDAO

func NewHTTPAccessLogPolicyDAO

func NewHTTPAccessLogPolicyDAO() *HTTPAccessLogPolicyDAO

func (*HTTPAccessLogPolicyDAO) CancelAllPublicPolicies

func (this *HTTPAccessLogPolicyDAO) CancelAllPublicPolicies(tx *dbs.Tx) error

CancelAllPublicPolicies 取消别的公用的策略

func (*HTTPAccessLogPolicyDAO) CountAllEnabledPolicies

func (this *HTTPAccessLogPolicyDAO) CountAllEnabledPolicies(tx *dbs.Tx) (int64, error)

CountAllEnabledPolicies 计算策略数量

func (*HTTPAccessLogPolicyDAO) CreatePolicy

func (this *HTTPAccessLogPolicyDAO) CreatePolicy(tx *dbs.Tx, name string, policyType string, optionsJSON []byte, condsJSON []byte, isPublic bool, firewallOnly bool) (policyId int64, err error)

CreatePolicy 创建策略

func (*HTTPAccessLogPolicyDAO) DisableHTTPAccessLogPolicy

func (this *HTTPAccessLogPolicyDAO) DisableHTTPAccessLogPolicy(tx *dbs.Tx, id int64) error

DisableHTTPAccessLogPolicy 禁用条目

func (*HTTPAccessLogPolicyDAO) EnableHTTPAccessLogPolicy

func (this *HTTPAccessLogPolicyDAO) EnableHTTPAccessLogPolicy(tx *dbs.Tx, id int64) error

EnableHTTPAccessLogPolicy 启用条目

func (*HTTPAccessLogPolicyDAO) FindAllEnabledAndOnPolicies

func (this *HTTPAccessLogPolicyDAO) FindAllEnabledAndOnPolicies(tx *dbs.Tx) (result []*HTTPAccessLogPolicy, err error)

FindAllEnabledAndOnPolicies 获取所有的策略信息

func (*HTTPAccessLogPolicyDAO) FindCurrentPublicPolicyId

func (this *HTTPAccessLogPolicyDAO) FindCurrentPublicPolicyId(tx *dbs.Tx) (int64, error)

FindCurrentPublicPolicyId 取得当前的公用策略

func (*HTTPAccessLogPolicyDAO) FindEnabledHTTPAccessLogPolicy

func (this *HTTPAccessLogPolicyDAO) FindEnabledHTTPAccessLogPolicy(tx *dbs.Tx, id int64) (*HTTPAccessLogPolicy, error)

FindEnabledHTTPAccessLogPolicy 查找启用中的条目

func (*HTTPAccessLogPolicyDAO) FindHTTPAccessLogPolicyName

func (this *HTTPAccessLogPolicyDAO) FindHTTPAccessLogPolicyName(tx *dbs.Tx, id int64) (string, error)

FindHTTPAccessLogPolicyName 根据主键查找名称

func (*HTTPAccessLogPolicyDAO) Init

func (this *HTTPAccessLogPolicyDAO) Init()

Init 初始化

func (*HTTPAccessLogPolicyDAO) ListEnabledPolicies

func (this *HTTPAccessLogPolicyDAO) ListEnabledPolicies(tx *dbs.Tx, offset int64, size int64) (result []*HTTPAccessLogPolicy, err error)

ListEnabledPolicies 查找所有可用策略信息

func (*HTTPAccessLogPolicyDAO) UpdatePolicy

func (this *HTTPAccessLogPolicyDAO) UpdatePolicy(tx *dbs.Tx, policyId int64, name string, optionsJSON []byte, condsJSON []byte, isPublic bool, firewallOnly bool, isOn bool) error

UpdatePolicy 修改策略

type HTTPAccessLogPolicyOperator

type HTTPAccessLogPolicyOperator struct {
	Id           interface{} // ID
	TemplateId   interface{} // 模版ID
	AdminId      interface{} // 管理员ID
	UserId       interface{} // 用户ID
	State        interface{} // 状态
	CreatedAt    interface{} // 创建时间
	Name         interface{} // 名称
	IsOn         interface{} // 是否启用
	Type         interface{} // 存储类型
	Options      interface{} // 存储选项
	Conds        interface{} // 请求条件
	IsPublic     interface{} // 是否为公用
	FirewallOnly interface{} // 是否只记录防火墙相关
	Version      interface{} // 版本号
}

func NewHTTPAccessLogPolicyOperator

func NewHTTPAccessLogPolicyOperator() *HTTPAccessLogPolicyOperator

type HTTPAuthPolicy

type HTTPAuthPolicy struct {
	Id      uint64   `field:"id"`      // ID
	AdminId uint32   `field:"adminId"` // 管理员ID
	UserId  uint32   `field:"userId"`  // 用户ID
	IsOn    bool     `field:"isOn"`    // 是否启用
	Name    string   `field:"name"`    // 名称
	Type    string   `field:"type"`    // 类型
	Params  dbs.JSON `field:"params"`  // 参数
	State   uint8    `field:"state"`   // 状态
}

HTTPAuthPolicy HTTP认证策略

type HTTPAuthPolicyDAO

type HTTPAuthPolicyDAO dbs.DAO
var SharedHTTPAuthPolicyDAO *HTTPAuthPolicyDAO

func NewHTTPAuthPolicyDAO

func NewHTTPAuthPolicyDAO() *HTTPAuthPolicyDAO

func (*HTTPAuthPolicyDAO) CheckUserPolicy added in v0.5.2

func (this *HTTPAuthPolicyDAO) CheckUserPolicy(tx *dbs.Tx, userId int64, policyId int64) error

CheckUserPolicy 检查用户权限

func (*HTTPAuthPolicyDAO) ComposePolicyConfig

func (this *HTTPAuthPolicyDAO) ComposePolicyConfig(tx *dbs.Tx, policyId int64, cacheMap *utils.CacheMap) (*serverconfigs.HTTPAuthPolicy, error)

ComposePolicyConfig 组合配置

func (*HTTPAuthPolicyDAO) CreateHTTPAuthPolicy

func (this *HTTPAuthPolicyDAO) CreateHTTPAuthPolicy(tx *dbs.Tx, userId int64, name string, methodType string, paramsJSON []byte) (int64, error)

CreateHTTPAuthPolicy 创建策略

func (*HTTPAuthPolicyDAO) DisableHTTPAuthPolicy

func (this *HTTPAuthPolicyDAO) DisableHTTPAuthPolicy(tx *dbs.Tx, id int64) error

DisableHTTPAuthPolicy 禁用条目

func (*HTTPAuthPolicyDAO) EnableHTTPAuthPolicy

func (this *HTTPAuthPolicyDAO) EnableHTTPAuthPolicy(tx *dbs.Tx, id int64) error

EnableHTTPAuthPolicy 启用条目

func (*HTTPAuthPolicyDAO) FindEnabledHTTPAuthPolicy

func (this *HTTPAuthPolicyDAO) FindEnabledHTTPAuthPolicy(tx *dbs.Tx, id int64) (*HTTPAuthPolicy, error)

FindEnabledHTTPAuthPolicy 查找启用中的条目

func (*HTTPAuthPolicyDAO) NotifyUpdate

func (this *HTTPAuthPolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更改

func (*HTTPAuthPolicyDAO) UpdateHTTPAuthPolicy

func (this *HTTPAuthPolicyDAO) UpdateHTTPAuthPolicy(tx *dbs.Tx, policyId int64, name string, paramsJSON []byte, isOn bool) error

UpdateHTTPAuthPolicy 修改策略

type HTTPAuthPolicyOperator

type HTTPAuthPolicyOperator struct {
	Id      interface{} // ID
	AdminId interface{} // 管理员ID
	UserId  interface{} // 用户ID
	IsOn    interface{} // 是否启用
	Name    interface{} // 名称
	Type    interface{} // 类型
	Params  interface{} // 参数
	State   interface{} // 状态
}

func NewHTTPAuthPolicyOperator

func NewHTTPAuthPolicyOperator() *HTTPAuthPolicyOperator

type HTTPBrotliPolicy

type HTTPBrotliPolicy struct {
	Id        uint32   `field:"id"`        // ID
	AdminId   uint32   `field:"adminId"`   // 管理员ID
	UserId    uint32   `field:"userId"`    // 用户ID
	IsOn      bool     `field:"isOn"`      // 是否启用
	Level     uint32   `field:"level"`     // 压缩级别
	MinLength dbs.JSON `field:"minLength"` // 可压缩最小值
	MaxLength dbs.JSON `field:"maxLength"` // 可压缩最大值
	State     uint8    `field:"state"`     // 状态
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	Conds     dbs.JSON `field:"conds"`     // 条件
}

HTTPBrotliPolicy Gzip配置

type HTTPBrotliPolicyDAO

type HTTPBrotliPolicyDAO dbs.DAO
var SharedHTTPBrotliPolicyDAO *HTTPBrotliPolicyDAO

func NewHTTPBrotliPolicyDAO

func NewHTTPBrotliPolicyDAO() *HTTPBrotliPolicyDAO

func (*HTTPBrotliPolicyDAO) ComposeBrotliConfig

func (this *HTTPBrotliPolicyDAO) ComposeBrotliConfig(tx *dbs.Tx, policyId int64) (*serverconfigs.HTTPBrotliCompressionConfig, error)

ComposeBrotliConfig 组合配置

func (*HTTPBrotliPolicyDAO) CreatePolicy

func (this *HTTPBrotliPolicyDAO) CreatePolicy(tx *dbs.Tx, level int, minLengthJSON []byte, maxLengthJSON []byte, condsJSON []byte) (int64, error)

CreatePolicy 创建策略

func (*HTTPBrotliPolicyDAO) DisableHTTPBrotliPolicy

func (this *HTTPBrotliPolicyDAO) DisableHTTPBrotliPolicy(tx *dbs.Tx, id int64) error

DisableHTTPBrotliPolicy 禁用条目

func (*HTTPBrotliPolicyDAO) EnableHTTPBrotliPolicy

func (this *HTTPBrotliPolicyDAO) EnableHTTPBrotliPolicy(tx *dbs.Tx, id int64) error

EnableHTTPBrotliPolicy 启用条目

func (*HTTPBrotliPolicyDAO) FindEnabledHTTPBrotliPolicy

func (this *HTTPBrotliPolicyDAO) FindEnabledHTTPBrotliPolicy(tx *dbs.Tx, id int64) (*HTTPBrotliPolicy, error)

FindEnabledHTTPBrotliPolicy 查找启用中的条目

func (*HTTPBrotliPolicyDAO) NotifyUpdate

func (this *HTTPBrotliPolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更新

func (*HTTPBrotliPolicyDAO) UpdatePolicy

func (this *HTTPBrotliPolicyDAO) UpdatePolicy(tx *dbs.Tx, policyId int64, level int, minLengthJSON []byte, maxLengthJSON []byte, condsJSON []byte) error

UpdatePolicy 修改Policy

type HTTPBrotliPolicyOperator

type HTTPBrotliPolicyOperator struct {
	Id        interface{} // ID
	AdminId   interface{} // 管理员ID
	UserId    interface{} // 用户ID
	IsOn      interface{} // 是否启用
	Level     interface{} // 压缩级别
	MinLength interface{} // 可压缩最小值
	MaxLength interface{} // 可压缩最大值
	State     interface{} // 状态
	CreatedAt interface{} // 创建时间
	Conds     interface{} // 条件
}

func NewHTTPBrotliPolicyOperator

func NewHTTPBrotliPolicyOperator() *HTTPBrotliPolicyOperator

type HTTPCachePolicy

type HTTPCachePolicy struct {
	Id                   uint32   `field:"id"`                   // ID
	AdminId              uint32   `field:"adminId"`              // 管理员ID
	UserId               uint32   `field:"userId"`               // 用户ID
	TemplateId           uint32   `field:"templateId"`           // 模版ID
	IsOn                 bool     `field:"isOn"`                 // 是否启用
	Name                 string   `field:"name"`                 // 名称
	Capacity             dbs.JSON `field:"capacity"`             // 容量数据
	MaxKeys              uint64   `field:"maxKeys"`              // 最多Key值
	MaxSize              dbs.JSON `field:"maxSize"`              // 最大缓存内容尺寸
	Type                 string   `field:"type"`                 // 存储类型
	Options              dbs.JSON `field:"options"`              // 存储选项
	CreatedAt            uint64   `field:"createdAt"`            // 创建时间
	State                uint8    `field:"state"`                // 状态
	Description          string   `field:"description"`          // 描述
	Refs                 dbs.JSON `field:"refs"`                 // 默认的缓存设置
	SyncCompressionCache uint8    `field:"syncCompressionCache"` // 是否同步写入压缩缓存
}

HTTPCachePolicy HTTP缓存策略

type HTTPCachePolicyDAO

type HTTPCachePolicyDAO dbs.DAO
var SharedHTTPCachePolicyDAO *HTTPCachePolicyDAO

func NewHTTPCachePolicyDAO

func NewHTTPCachePolicyDAO() *HTTPCachePolicyDAO

func (*HTTPCachePolicyDAO) ComposeCachePolicy

func (this *HTTPCachePolicyDAO) ComposeCachePolicy(tx *dbs.Tx, policyId int64, cacheMap *utils.CacheMap) (*serverconfigs.HTTPCachePolicy, error)

ComposeCachePolicy 组合配置

func (*HTTPCachePolicyDAO) CountAllEnabledHTTPCachePolicies

func (this *HTTPCachePolicyDAO) CountAllEnabledHTTPCachePolicies(tx *dbs.Tx, clusterId int64, keyword string, storageType string) (int64, error)

CountAllEnabledHTTPCachePolicies 计算可用缓存策略数量

func (*HTTPCachePolicyDAO) CreateCachePolicy

func (this *HTTPCachePolicyDAO) CreateCachePolicy(tx *dbs.Tx, isOn bool, name string, description string, capacityJSON []byte, maxKeys int64, maxSizeJSON []byte, storageType string, storageOptionsJSON []byte, syncCompressionCache bool) (int64, error)

CreateCachePolicy 创建缓存策略

func (*HTTPCachePolicyDAO) CreateDefaultCachePolicy

func (this *HTTPCachePolicyDAO) CreateDefaultCachePolicy(tx *dbs.Tx, name string) (int64, error)

CreateDefaultCachePolicy 创建默认的缓存策略

func (*HTTPCachePolicyDAO) DisableHTTPCachePolicy

func (this *HTTPCachePolicyDAO) DisableHTTPCachePolicy(tx *dbs.Tx, policyId int64) error

DisableHTTPCachePolicy 禁用条目

func (*HTTPCachePolicyDAO) EnableHTTPCachePolicy

func (this *HTTPCachePolicyDAO) EnableHTTPCachePolicy(tx *dbs.Tx, id int64) error

EnableHTTPCachePolicy 启用条目

func (*HTTPCachePolicyDAO) FindAllEnabledCachePolicies

func (this *HTTPCachePolicyDAO) FindAllEnabledCachePolicies(tx *dbs.Tx) (result []*HTTPCachePolicy, err error)

FindAllEnabledCachePolicies 查找所有可用的缓存策略

func (*HTTPCachePolicyDAO) FindEnabledHTTPCachePolicy

func (this *HTTPCachePolicyDAO) FindEnabledHTTPCachePolicy(tx *dbs.Tx, id int64) (*HTTPCachePolicy, error)

FindEnabledHTTPCachePolicy 查找启用中的条目

func (*HTTPCachePolicyDAO) FindHTTPCachePolicyName

func (this *HTTPCachePolicyDAO) FindHTTPCachePolicyName(tx *dbs.Tx, id int64) (string, error)

FindHTTPCachePolicyName 根据主键查找名称

func (*HTTPCachePolicyDAO) Init

func (this *HTTPCachePolicyDAO) Init()

Init 初始化

func (*HTTPCachePolicyDAO) ListEnabledHTTPCachePolicies

func (this *HTTPCachePolicyDAO) ListEnabledHTTPCachePolicies(tx *dbs.Tx, clusterId int64, keyword string, storageType string, offset int64, size int64) ([]*serverconfigs.HTTPCachePolicy, error)

ListEnabledHTTPCachePolicies 列出单页的缓存策略

func (*HTTPCachePolicyDAO) NotifyUpdate

func (this *HTTPCachePolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更新

func (*HTTPCachePolicyDAO) UpdateCachePolicy

func (this *HTTPCachePolicyDAO) UpdateCachePolicy(tx *dbs.Tx, policyId int64, isOn bool, name string, description string, capacityJSON []byte, maxKeys int64, maxSizeJSON []byte, storageType string, storageOptionsJSON []byte, syncCompressionCache bool) error

UpdateCachePolicy 修改缓存策略

func (*HTTPCachePolicyDAO) UpdatePolicyRefs

func (this *HTTPCachePolicyDAO) UpdatePolicyRefs(tx *dbs.Tx, policyId int64, refsJSON []byte) error

UpdatePolicyRefs 设置默认的缓存条件

type HTTPCachePolicyOperator

type HTTPCachePolicyOperator struct {
	Id                   interface{} // ID
	AdminId              interface{} // 管理员ID
	UserId               interface{} // 用户ID
	TemplateId           interface{} // 模版ID
	IsOn                 interface{} // 是否启用
	Name                 interface{} // 名称
	Capacity             interface{} // 容量数据
	MaxKeys              interface{} // 最多Key值
	MaxSize              interface{} // 最大缓存内容尺寸
	Type                 interface{} // 存储类型
	Options              interface{} // 存储选项
	CreatedAt            interface{} // 创建时间
	State                interface{} // 状态
	Description          interface{} // 描述
	Refs                 interface{} // 默认的缓存设置
	SyncCompressionCache interface{} // 是否同步写入压缩缓存
}

func NewHTTPCachePolicyOperator

func NewHTTPCachePolicyOperator() *HTTPCachePolicyOperator

type HTTPCacheTask

type HTTPCacheTask struct {
	Id          uint64 `field:"id"`          // ID
	UserId      uint32 `field:"userId"`      // 用户ID
	Type        string `field:"type"`        // 任务类型:purge|fetch
	KeyType     string `field:"keyType"`     // Key类型
	State       uint8  `field:"state"`       // 状态
	CreatedAt   uint64 `field:"createdAt"`   // 创建时间
	DoneAt      uint64 `field:"doneAt"`      // 完成时间
	Day         string `field:"day"`         // 创建日期YYYYMMDD
	IsDone      bool   `field:"isDone"`      // 是否已完成
	IsOk        bool   `field:"isOk"`        // 是否完全成功
	IsReady     bool   `field:"isReady"`     // 是否已准备好
	Description string `field:"description"` // 描述
}

HTTPCacheTask 缓存相关任务

type HTTPCacheTaskDAO

type HTTPCacheTaskDAO dbs.DAO
var SharedHTTPCacheTaskDAO *HTTPCacheTaskDAO

func NewHTTPCacheTaskDAO

func NewHTTPCacheTaskDAO() *HTTPCacheTaskDAO

func (*HTTPCacheTaskDAO) CheckUserTask

func (this *HTTPCacheTaskDAO) CheckUserTask(tx *dbs.Tx, userId int64, taskId int64) error

CheckUserTask 检查用户任务

func (*HTTPCacheTaskDAO) Clean

func (this *HTTPCacheTaskDAO) Clean(tx *dbs.Tx, days int) error

Clean 清理以往的任务

func (*HTTPCacheTaskDAO) CountDoingTasks

func (this *HTTPCacheTaskDAO) CountDoingTasks(tx *dbs.Tx, userId int64) (int64, error)

CountDoingTasks 查询正在执行的任务数量

func (*HTTPCacheTaskDAO) CountTasks

func (this *HTTPCacheTaskDAO) CountTasks(tx *dbs.Tx, userId int64) (int64, error)

CountTasks 查询所有任务数量

func (*HTTPCacheTaskDAO) CreateTask

func (this *HTTPCacheTaskDAO) CreateTask(tx *dbs.Tx, userId int64, taskType HTTPCacheTaskType, keyType string, description string) (int64, error)

CreateTask 创建任务

func (*HTTPCacheTaskDAO) DisableHTTPCacheTask

func (this *HTTPCacheTaskDAO) DisableHTTPCacheTask(tx *dbs.Tx, taskId int64) error

DisableHTTPCacheTask 禁用条目

func (*HTTPCacheTaskDAO) EnableHTTPCacheTask

func (this *HTTPCacheTaskDAO) EnableHTTPCacheTask(tx *dbs.Tx, taskId int64) error

EnableHTTPCacheTask 启用条目

func (*HTTPCacheTaskDAO) FindEnabledHTTPCacheTask

func (this *HTTPCacheTaskDAO) FindEnabledHTTPCacheTask(tx *dbs.Tx, taskId int64) (*HTTPCacheTask, error)

FindEnabledHTTPCacheTask 查找启用中的条目

func (*HTTPCacheTaskDAO) ListDoingTasks

func (this *HTTPCacheTaskDAO) ListDoingTasks(tx *dbs.Tx, size int64) (result []*HTTPCacheTask, err error)

ListDoingTasks 列出需要执行的任务

func (*HTTPCacheTaskDAO) ListTasks

func (this *HTTPCacheTaskDAO) ListTasks(tx *dbs.Tx, userId int64, offset int64, size int64) (result []*HTTPCacheTask, err error)

ListTasks 列出单页任务

func (*HTTPCacheTaskDAO) NotifyChange

func (this *HTTPCacheTaskDAO) NotifyChange(tx *dbs.Tx, taskId int64) error

NotifyChange 发送通知

func (*HTTPCacheTaskDAO) ResetTask

func (this *HTTPCacheTaskDAO) ResetTask(tx *dbs.Tx, taskId int64) error

ResetTask 重置服务状态

func (*HTTPCacheTaskDAO) UpdateTaskReady

func (this *HTTPCacheTaskDAO) UpdateTaskReady(tx *dbs.Tx, taskId int64) error

UpdateTaskReady 设置任务为已准备

func (*HTTPCacheTaskDAO) UpdateTaskStatus

func (this *HTTPCacheTaskDAO) UpdateTaskStatus(tx *dbs.Tx, taskId int64, isDone bool, isOk bool) error

UpdateTaskStatus 标记任务已完成

type HTTPCacheTaskKey

type HTTPCacheTaskKey struct {
	Id        uint64   `field:"id"`        // ID
	TaskId    uint64   `field:"taskId"`    // 任务ID
	Key       string   `field:"key"`       // Key
	KeyType   string   `field:"keyType"`   // Key类型:key|prefix
	Type      string   `field:"type"`      // 操作类型
	ClusterId uint32   `field:"clusterId"` // 集群ID
	Nodes     dbs.JSON `field:"nodes"`     // 节点
	Errors    dbs.JSON `field:"errors"`    // 错误信息
	IsDone    bool     `field:"isDone"`    // 是否已完成
}

HTTPCacheTaskKey 缓存任务Key

func (*HTTPCacheTaskKey) DecodeNodes

func (this *HTTPCacheTaskKey) DecodeNodes() map[string]bool

DecodeNodes 解析已完成节点信息

type HTTPCacheTaskKeyDAO

type HTTPCacheTaskKeyDAO dbs.DAO
var SharedHTTPCacheTaskKeyDAO *HTTPCacheTaskKeyDAO

func NewHTTPCacheTaskKeyDAO

func NewHTTPCacheTaskKeyDAO() *HTTPCacheTaskKeyDAO

func (*HTTPCacheTaskKeyDAO) Clean

func (this *HTTPCacheTaskKeyDAO) Clean(tx *dbs.Tx, days int) error

Clean 清理以往的任务

func (*HTTPCacheTaskKeyDAO) CountUserTasksInDay

func (this *HTTPCacheTaskKeyDAO) CountUserTasksInDay(tx *dbs.Tx, userId int64, day string, taskType HTTPCacheTaskType) (int64, error)

CountUserTasksInDay 读取某个用户当前数量 day YYYYMMDD

func (*HTTPCacheTaskKeyDAO) CreateKey

func (this *HTTPCacheTaskKeyDAO) CreateKey(tx *dbs.Tx, taskId int64, key string, taskType HTTPCacheTaskType, keyType string, clusterId int64) (int64, error)

CreateKey 创建Key 参数:

  • clusterId 集群ID
  • nodeMapJSON 集群下节点映射,格式类似于 `{ "节点1":true, ... }`

func (*HTTPCacheTaskKeyDAO) FindAllTaskKeys

func (this *HTTPCacheTaskKeyDAO) FindAllTaskKeys(tx *dbs.Tx, taskId int64) (result []*HTTPCacheTaskKey, err error)

FindAllTaskKeys 查询某个任务下的所有Key

func (*HTTPCacheTaskKeyDAO) FindDoingTaskKeys

func (this *HTTPCacheTaskKeyDAO) FindDoingTaskKeys(tx *dbs.Tx, nodeId int64, size int64) (result []*HTTPCacheTaskKey, err error)

FindDoingTaskKeys 查询要执行的任务

func (*HTTPCacheTaskKeyDAO) ResetCacheKeysWithTaskId

func (this *HTTPCacheTaskKeyDAO) ResetCacheKeysWithTaskId(tx *dbs.Tx, taskId int64) error

ResetCacheKeysWithTaskId 重置任务下的Key状态

func (*HTTPCacheTaskKeyDAO) UpdateKeyStatus

func (this *HTTPCacheTaskKeyDAO) UpdateKeyStatus(tx *dbs.Tx, keyId int64, nodeId int64, errString string, nodesJSON []byte) error

UpdateKeyStatus 修改Key状态

type HTTPCacheTaskKeyOperator

type HTTPCacheTaskKeyOperator struct {
	Id        interface{} // ID
	TaskId    interface{} // 任务ID
	Key       interface{} // Key
	KeyType   interface{} // Key类型:key|prefix
	Type      interface{} // 操作类型
	ClusterId interface{} // 集群ID
	Nodes     interface{} // 节点
	Errors    interface{} // 错误信息
	IsDone    interface{} // 是否已完成
}

func NewHTTPCacheTaskKeyOperator

func NewHTTPCacheTaskKeyOperator() *HTTPCacheTaskKeyOperator

type HTTPCacheTaskOperator

type HTTPCacheTaskOperator struct {
	Id          any // ID
	UserId      any // 用户ID
	Type        any // 任务类型:purge|fetch
	KeyType     any // Key类型
	State       any // 状态
	CreatedAt   any // 创建时间
	DoneAt      any // 完成时间
	Day         any // 创建日期YYYYMMDD
	IsDone      any // 是否已完成
	IsOk        any // 是否完全成功
	IsReady     any // 是否已准备好
	Description any // 描述
}

func NewHTTPCacheTaskOperator

func NewHTTPCacheTaskOperator() *HTTPCacheTaskOperator

type HTTPCacheTaskType

type HTTPCacheTaskType = string
const (
	HTTPCacheTaskTypePurge HTTPCacheTaskType = "purge"
	HTTPCacheTaskTypeFetch HTTPCacheTaskType = "fetch"
)

type HTTPDeflatePolicy

type HTTPDeflatePolicy struct {
	Id        uint32   `field:"id"`        // ID
	AdminId   uint32   `field:"adminId"`   // 管理员ID
	UserId    uint32   `field:"userId"`    // 用户ID
	IsOn      bool     `field:"isOn"`      // 是否启用
	Level     uint32   `field:"level"`     // 压缩级别
	MinLength dbs.JSON `field:"minLength"` // 可压缩最小值
	MaxLength dbs.JSON `field:"maxLength"` // 可压缩最大值
	State     uint8    `field:"state"`     // 状态
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	Conds     dbs.JSON `field:"conds"`     // 条件
}

HTTPDeflatePolicy Gzip配置

type HTTPDeflatePolicyDAO

type HTTPDeflatePolicyDAO dbs.DAO
var SharedHTTPDeflatePolicyDAO *HTTPDeflatePolicyDAO

func NewHTTPDeflatePolicyDAO

func NewHTTPDeflatePolicyDAO() *HTTPDeflatePolicyDAO

func (*HTTPDeflatePolicyDAO) ComposeDeflateConfig

func (this *HTTPDeflatePolicyDAO) ComposeDeflateConfig(tx *dbs.Tx, policyId int64) (*serverconfigs.HTTPDeflateCompressionConfig, error)

ComposeDeflateConfig 组合配置

func (*HTTPDeflatePolicyDAO) CreatePolicy

func (this *HTTPDeflatePolicyDAO) CreatePolicy(tx *dbs.Tx, level int, minLengthJSON []byte, maxLengthJSON []byte, condsJSON []byte) (int64, error)

CreatePolicy 创建策略

func (*HTTPDeflatePolicyDAO) DisableHTTPDeflatePolicy

func (this *HTTPDeflatePolicyDAO) DisableHTTPDeflatePolicy(tx *dbs.Tx, id int64) error

DisableHTTPDeflatePolicy 禁用条目

func (*HTTPDeflatePolicyDAO) EnableHTTPDeflatePolicy

func (this *HTTPDeflatePolicyDAO) EnableHTTPDeflatePolicy(tx *dbs.Tx, id int64) error

EnableHTTPDeflatePolicy 启用条目

func (*HTTPDeflatePolicyDAO) FindEnabledHTTPDeflatePolicy

func (this *HTTPDeflatePolicyDAO) FindEnabledHTTPDeflatePolicy(tx *dbs.Tx, id int64) (*HTTPDeflatePolicy, error)

FindEnabledHTTPDeflatePolicy 查找启用中的条目

func (*HTTPDeflatePolicyDAO) NotifyUpdate

func (this *HTTPDeflatePolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更新

func (*HTTPDeflatePolicyDAO) UpdatePolicy

func (this *HTTPDeflatePolicyDAO) UpdatePolicy(tx *dbs.Tx, policyId int64, level int, minLengthJSON []byte, maxLengthJSON []byte, condsJSON []byte) error

UpdatePolicy 修改Policy

type HTTPDeflatePolicyOperator

type HTTPDeflatePolicyOperator struct {
	Id        interface{} // ID
	AdminId   interface{} // 管理员ID
	UserId    interface{} // 用户ID
	IsOn      interface{} // 是否启用
	Level     interface{} // 压缩级别
	MinLength interface{} // 可压缩最小值
	MaxLength interface{} // 可压缩最大值
	State     interface{} // 状态
	CreatedAt interface{} // 创建时间
	Conds     interface{} // 条件
}

func NewHTTPDeflatePolicyOperator

func NewHTTPDeflatePolicyOperator() *HTTPDeflatePolicyOperator

type HTTPFastcgi

type HTTPFastcgi struct {
	Id              uint64   `field:"id"`              // ID
	AdminId         uint32   `field:"adminId"`         // 管理员ID
	UserId          uint32   `field:"userId"`          // 用户ID
	IsOn            bool     `field:"isOn"`            // 是否启用
	Address         string   `field:"address"`         // 地址
	Params          dbs.JSON `field:"params"`          // 参数
	ReadTimeout     dbs.JSON `field:"readTimeout"`     // 读取超时
	ConnTimeout     dbs.JSON `field:"connTimeout"`     // 连接超时
	PoolSize        uint32   `field:"poolSize"`        // 连接池尺寸
	PathInfoPattern string   `field:"pathInfoPattern"` // PATH_INFO匹配
	State           uint8    `field:"state"`           // 状态
}

HTTPFastcgi Fastcgi设置

type HTTPFastcgiDAO

type HTTPFastcgiDAO dbs.DAO
var SharedHTTPFastcgiDAO *HTTPFastcgiDAO

func NewHTTPFastcgiDAO

func NewHTTPFastcgiDAO() *HTTPFastcgiDAO

func (*HTTPFastcgiDAO) CheckUserFastcgi

func (this *HTTPFastcgiDAO) CheckUserFastcgi(tx *dbs.Tx, userId int64, fastcgiId int64) error

CheckUserFastcgi 检查用户Fastcgi权限

func (*HTTPFastcgiDAO) ComposeFastcgiConfig

func (this *HTTPFastcgiDAO) ComposeFastcgiConfig(tx *dbs.Tx, fastcgiId int64) (*serverconfigs.HTTPFastcgiConfig, error)

ComposeFastcgiConfig 组合配置

func (*HTTPFastcgiDAO) CreateFastcgi

func (this *HTTPFastcgiDAO) CreateFastcgi(tx *dbs.Tx, adminId int64, userId int64, isOn bool, address string, paramsJSON []byte, readTimeoutJSON []byte, connTimeoutJSON []byte, poolSize int32, pathInfoPattern string) (int64, error)

CreateFastcgi 创建Fastcgi

func (*HTTPFastcgiDAO) DisableHTTPFastcgi

func (this *HTTPFastcgiDAO) DisableHTTPFastcgi(tx *dbs.Tx, id int64) error

DisableHTTPFastcgi 禁用条目

func (*HTTPFastcgiDAO) EnableHTTPFastcgi

func (this *HTTPFastcgiDAO) EnableHTTPFastcgi(tx *dbs.Tx, id int64) error

EnableHTTPFastcgi 启用条目

func (*HTTPFastcgiDAO) FindEnabledHTTPFastcgi

func (this *HTTPFastcgiDAO) FindEnabledHTTPFastcgi(tx *dbs.Tx, id int64) (*HTTPFastcgi, error)

FindEnabledHTTPFastcgi 查找启用中的条目

func (*HTTPFastcgiDAO) NotifyUpdate

func (this *HTTPFastcgiDAO) NotifyUpdate(tx *dbs.Tx, fastcgiId int64) error

NotifyUpdate 通知更新

func (*HTTPFastcgiDAO) UpdateFastcgi

func (this *HTTPFastcgiDAO) UpdateFastcgi(tx *dbs.Tx, fastcgiId int64, isOn bool, address string, paramsJSON []byte, readTimeoutJSON []byte, connTimeoutJSON []byte, poolSize int32, pathInfoPattern string) error

UpdateFastcgi 修改Fastcgi

type HTTPFastcgiOperator

type HTTPFastcgiOperator struct {
	Id              interface{} // ID
	AdminId         interface{} // 管理员ID
	UserId          interface{} // 用户ID
	IsOn            interface{} // 是否启用
	Address         interface{} // 地址
	Params          interface{} // 参数
	ReadTimeout     interface{} // 读取超时
	ConnTimeout     interface{} // 连接超时
	PoolSize        interface{} // 连接池尺寸
	PathInfoPattern interface{} // PATH_INFO匹配
	State           interface{} // 状态
}

func NewHTTPFastcgiOperator

func NewHTTPFastcgiOperator() *HTTPFastcgiOperator

type HTTPFirewallPolicy

type HTTPFirewallPolicy struct {
	Id               uint32   `field:"id"`               // ID
	TemplateId       uint32   `field:"templateId"`       // 模版ID
	AdminId          uint32   `field:"adminId"`          // 管理员ID
	UserId           uint32   `field:"userId"`           // 用户ID
	ServerId         uint32   `field:"serverId"`         // 服务ID
	GroupId          uint32   `field:"groupId"`          // 服务分组ID
	State            uint8    `field:"state"`            // 状态
	CreatedAt        uint64   `field:"createdAt"`        // 创建时间
	IsOn             bool     `field:"isOn"`             // 是否启用
	Name             string   `field:"name"`             // 名称
	Description      string   `field:"description"`      // 描述
	Inbound          dbs.JSON `field:"inbound"`          // 入站规则
	Outbound         dbs.JSON `field:"outbound"`         // 出站规则
	BlockOptions     dbs.JSON `field:"blockOptions"`     // BLOCK选项
	CaptchaOptions   dbs.JSON `field:"captchaOptions"`   // 验证码选项
	Mode             string   `field:"mode"`             // 模式
	UseLocalFirewall uint8    `field:"useLocalFirewall"` // 是否自动使用本地防火墙
	SynFlood         dbs.JSON `field:"synFlood"`         // SynFlood防御设置
	Log              dbs.JSON `field:"log"`              // 日志配置
}

HTTPFirewallPolicy HTTP防火墙

type HTTPFirewallPolicyDAO

type HTTPFirewallPolicyDAO dbs.DAO
var SharedHTTPFirewallPolicyDAO *HTTPFirewallPolicyDAO

func NewHTTPFirewallPolicyDAO

func NewHTTPFirewallPolicyDAO() *HTTPFirewallPolicyDAO

func (*HTTPFirewallPolicyDAO) CheckUserFirewallPolicy

func (this *HTTPFirewallPolicyDAO) CheckUserFirewallPolicy(tx *dbs.Tx, userId int64, firewallPolicyId int64) error

CheckUserFirewallPolicy 检查用户防火墙策略

func (*HTTPFirewallPolicyDAO) ComposeFirewallPolicy

func (this *HTTPFirewallPolicyDAO) ComposeFirewallPolicy(tx *dbs.Tx, policyId int64, cacheMap *utils.CacheMap) (*firewallconfigs.HTTPFirewallPolicy, error)

ComposeFirewallPolicy 组合策略配置

func (*HTTPFirewallPolicyDAO) CountAllEnabledFirewallPolicies

func (this *HTTPFirewallPolicyDAO) CountAllEnabledFirewallPolicies(tx *dbs.Tx, clusterId int64, keyword string) (int64, error)

CountAllEnabledFirewallPolicies 计算所有可用的策略数量

func (*HTTPFirewallPolicyDAO) CreateDefaultFirewallPolicy

func (this *HTTPFirewallPolicyDAO) CreateDefaultFirewallPolicy(tx *dbs.Tx, name string) (int64, error)

CreateDefaultFirewallPolicy 创建默认的WAF策略

func (*HTTPFirewallPolicyDAO) CreateFirewallPolicy

func (this *HTTPFirewallPolicyDAO) CreateFirewallPolicy(tx *dbs.Tx, userId int64, serverGroupId int64, serverId int64, isOn bool, name string, description string, inboundJSON []byte, outboundJSON []byte) (int64, error)

CreateFirewallPolicy 创建策略

func (*HTTPFirewallPolicyDAO) DisableHTTPFirewallPolicy

func (this *HTTPFirewallPolicyDAO) DisableHTTPFirewallPolicy(tx *dbs.Tx, policyId int64) error

DisableHTTPFirewallPolicy 禁用条目

func (*HTTPFirewallPolicyDAO) EnableHTTPFirewallPolicy

func (this *HTTPFirewallPolicyDAO) EnableHTTPFirewallPolicy(tx *dbs.Tx, id int64) error

EnableHTTPFirewallPolicy 启用条目

func (*HTTPFirewallPolicyDAO) FindAllEnabledFirewallPolicies

func (this *HTTPFirewallPolicyDAO) FindAllEnabledFirewallPolicies(tx *dbs.Tx) (result []*HTTPFirewallPolicy, err error)

FindAllEnabledFirewallPolicies 查找所有可用策略

func (*HTTPFirewallPolicyDAO) FindEnabledFirewallPolicyIdWithRuleGroupId

func (this *HTTPFirewallPolicyDAO) FindEnabledFirewallPolicyIdWithRuleGroupId(tx *dbs.Tx, ruleGroupId int64) (int64, error)

FindEnabledFirewallPolicyIdWithRuleGroupId 查找包含某个规则分组的策略ID

func (*HTTPFirewallPolicyDAO) FindEnabledFirewallPolicyIdsWithIPListId

func (this *HTTPFirewallPolicyDAO) FindEnabledFirewallPolicyIdsWithIPListId(tx *dbs.Tx, ipListId int64) ([]int64, error)

FindEnabledFirewallPolicyIdsWithIPListId 查找包含某个IPList的所有策略 TODO 改成通过 serverId 查询

func (*HTTPFirewallPolicyDAO) FindEnabledFirewallPolicyWithIPListId

func (this *HTTPFirewallPolicyDAO) FindEnabledFirewallPolicyWithIPListId(tx *dbs.Tx, ipListId int64) (*HTTPFirewallPolicy, error)

FindEnabledFirewallPolicyWithIPListId 查找使用某个IPList的策略 TODO 改成通过 serverId 查询

func (*HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicy

func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicy(tx *dbs.Tx, id int64) (*HTTPFirewallPolicy, error)

FindEnabledHTTPFirewallPolicy 查找启用中的条目

func (*HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyBasic

func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyBasic(tx *dbs.Tx, policyId int64) (*HTTPFirewallPolicy, error)

FindEnabledHTTPFirewallPolicyBasic 获取WAF策略基本信息

func (*HTTPFirewallPolicyDAO) FindFirewallPolicyIdsWithServerId

func (this *HTTPFirewallPolicyDAO) FindFirewallPolicyIdsWithServerId(tx *dbs.Tx, serverId int64) ([]int64, error)

FindFirewallPolicyIdsWithServerId 查找服务独立关联的策略IDs

func (*HTTPFirewallPolicyDAO) FindHTTPFirewallPolicyName

func (this *HTTPFirewallPolicyDAO) FindHTTPFirewallPolicyName(tx *dbs.Tx, id int64) (string, error)

FindHTTPFirewallPolicyName 根据主键查找名称

func (*HTTPFirewallPolicyDAO) Init

func (this *HTTPFirewallPolicyDAO) Init()

Init 初始化

func (*HTTPFirewallPolicyDAO) ListEnabledFirewallPolicies

func (this *HTTPFirewallPolicyDAO) ListEnabledFirewallPolicies(tx *dbs.Tx, clusterId int64, keyword string, offset int64, size int64) (result []*HTTPFirewallPolicy, err error)

ListEnabledFirewallPolicies 列出单页的策略

func (*HTTPFirewallPolicyDAO) NotifyDisable

func (this *HTTPFirewallPolicyDAO) NotifyDisable(tx *dbs.Tx, policyId int64) error

NotifyDisable 通知禁用

func (*HTTPFirewallPolicyDAO) NotifyUpdate

func (this *HTTPFirewallPolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更新

func (*HTTPFirewallPolicyDAO) UpdateFirewallPolicy

func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicy(tx *dbs.Tx,
	policyId int64,
	isOn bool,
	name string,
	description string,
	inboundJSON []byte,
	outboundJSON []byte,
	blockOptionsJSON []byte,
	captchaOptionsJSON []byte,
	mode firewallconfigs.FirewallMode,
	useLocalFirewall bool,
	synFloodConfig *firewallconfigs.SYNFloodConfig,
	logConfig *firewallconfigs.HTTPFirewallPolicyLogConfig) error

UpdateFirewallPolicy 修改策略

func (*HTTPFirewallPolicyDAO) UpdateFirewallPolicyInbound

func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicyInbound(tx *dbs.Tx, policyId int64, inboundJSON []byte) error

UpdateFirewallPolicyInbound 修改策略的Inbound

func (*HTTPFirewallPolicyDAO) UpdateFirewallPolicyInboundAndOutbound

func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicyInboundAndOutbound(tx *dbs.Tx, policyId int64, inboundJSON []byte, outboundJSON []byte, shouldNotify bool) error

UpdateFirewallPolicyInboundAndOutbound 修改策略的Inbound和Outbound

func (*HTTPFirewallPolicyDAO) UpdateFirewallPolicyServerId

func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicyServerId(tx *dbs.Tx, policyId int64, serverId int64) error

UpdateFirewallPolicyServerId 设置某个策略所属的服务ID

type HTTPFirewallPolicyOperator

type HTTPFirewallPolicyOperator struct {
	Id               interface{} // ID
	TemplateId       interface{} // 模版ID
	AdminId          interface{} // 管理员ID
	UserId           interface{} // 用户ID
	ServerId         interface{} // 服务ID
	GroupId          interface{} // 服务分组ID
	State            interface{} // 状态
	CreatedAt        interface{} // 创建时间
	IsOn             interface{} // 是否启用
	Name             interface{} // 名称
	Description      interface{} // 描述
	Inbound          interface{} // 入站规则
	Outbound         interface{} // 出站规则
	BlockOptions     interface{} // BLOCK选项
	CaptchaOptions   interface{} // 验证码选项
	Mode             interface{} // 模式
	UseLocalFirewall interface{} // 是否自动使用本地防火墙
	SynFlood         interface{} // SynFlood防御设置
	Log              interface{} // 日志配置
}

func NewHTTPFirewallPolicyOperator

func NewHTTPFirewallPolicyOperator() *HTTPFirewallPolicyOperator

type HTTPFirewallRule

type HTTPFirewallRule struct {
	Id                uint32   `field:"id"`                // ID
	IsOn              bool     `field:"isOn"`              // 是否启用
	Description       string   `field:"description"`       // 说明
	Param             string   `field:"param"`             // 参数
	ParamFilters      dbs.JSON `field:"paramFilters"`      // 处理器
	Operator          string   `field:"operator"`          // 操作符
	Value             string   `field:"value"`             // 对比值
	IsCaseInsensitive bool     `field:"isCaseInsensitive"` // 是否大小写不敏感
	CheckpointOptions dbs.JSON `field:"checkpointOptions"` // 检查点参数
	State             uint8    `field:"state"`             // 状态
	CreatedAt         uint64   `field:"createdAt"`         // 创建时间
	AdminId           uint32   `field:"adminId"`           // 管理员ID
	UserId            uint32   `field:"userId"`            // 用户ID
}

HTTPFirewallRule 防火墙规则

type HTTPFirewallRuleDAO

type HTTPFirewallRuleDAO dbs.DAO
var SharedHTTPFirewallRuleDAO *HTTPFirewallRuleDAO

func NewHTTPFirewallRuleDAO

func NewHTTPFirewallRuleDAO() *HTTPFirewallRuleDAO

func (*HTTPFirewallRuleDAO) ComposeFirewallRule

func (this *HTTPFirewallRuleDAO) ComposeFirewallRule(tx *dbs.Tx, ruleId int64) (*firewallconfigs.HTTPFirewallRule, error)

ComposeFirewallRule 组合配置

func (*HTTPFirewallRuleDAO) CreateOrUpdateRuleFromConfig

func (this *HTTPFirewallRuleDAO) CreateOrUpdateRuleFromConfig(tx *dbs.Tx, ruleConfig *firewallconfigs.HTTPFirewallRule) (int64, error)

CreateOrUpdateRuleFromConfig 从配置中配置规则

func (*HTTPFirewallRuleDAO) DisableHTTPFirewallRule

func (this *HTTPFirewallRuleDAO) DisableHTTPFirewallRule(tx *dbs.Tx, ruleId int64) error

DisableHTTPFirewallRule 禁用条目

func (*HTTPFirewallRuleDAO) EnableHTTPFirewallRule

func (this *HTTPFirewallRuleDAO) EnableHTTPFirewallRule(tx *dbs.Tx, id int64) error

EnableHTTPFirewallRule 启用条目

func (*HTTPFirewallRuleDAO) FindEnabledHTTPFirewallRule

func (this *HTTPFirewallRuleDAO) FindEnabledHTTPFirewallRule(tx *dbs.Tx, id int64) (*HTTPFirewallRule, error)

FindEnabledHTTPFirewallRule 查找启用中的条目

func (*HTTPFirewallRuleDAO) Init

func (this *HTTPFirewallRuleDAO) Init()

Init 初始化

func (*HTTPFirewallRuleDAO) NotifyUpdate

func (this *HTTPFirewallRuleDAO) NotifyUpdate(tx *dbs.Tx, ruleId int64) error

NotifyUpdate 通知更新

type HTTPFirewallRuleGroup

type HTTPFirewallRuleGroup struct {
	Id          uint32   `field:"id"`          // ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	Name        string   `field:"name"`        // 名称
	Description string   `field:"description"` // 描述
	Code        string   `field:"code"`        // 代号
	IsTemplate  bool     `field:"isTemplate"`  // 是否为预置模板
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	UserId      uint32   `field:"userId"`      // 用户ID
	State       uint8    `field:"state"`       // 状态
	Sets        dbs.JSON `field:"sets"`        // 规则集列表
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
}

HTTPFirewallRuleGroup 防火墙规则分组

type HTTPFirewallRuleGroupDAO

type HTTPFirewallRuleGroupDAO dbs.DAO
var SharedHTTPFirewallRuleGroupDAO *HTTPFirewallRuleGroupDAO

func NewHTTPFirewallRuleGroupDAO

func NewHTTPFirewallRuleGroupDAO() *HTTPFirewallRuleGroupDAO

func (*HTTPFirewallRuleGroupDAO) CheckUserRuleGroup

func (this *HTTPFirewallRuleGroupDAO) CheckUserRuleGroup(tx *dbs.Tx, userId int64, groupId int64) error

CheckUserRuleGroup 检查用户所属分组

func (*HTTPFirewallRuleGroupDAO) ComposeFirewallRuleGroup

func (this *HTTPFirewallRuleGroupDAO) ComposeFirewallRuleGroup(tx *dbs.Tx, groupId int64) (*firewallconfigs.HTTPFirewallRuleGroup, error)

ComposeFirewallRuleGroup 组合配置

func (*HTTPFirewallRuleGroupDAO) CreateGroup

func (this *HTTPFirewallRuleGroupDAO) CreateGroup(tx *dbs.Tx, isOn bool, name string, code string, description string) (int64, error)

CreateGroup 创建分组

func (*HTTPFirewallRuleGroupDAO) CreateGroupFromConfig

func (this *HTTPFirewallRuleGroupDAO) CreateGroupFromConfig(tx *dbs.Tx, groupConfig *firewallconfigs.HTTPFirewallRuleGroup) (int64, error)

CreateGroupFromConfig 从配置中创建分组

func (*HTTPFirewallRuleGroupDAO) DisableHTTPFirewallRuleGroup

func (this *HTTPFirewallRuleGroupDAO) DisableHTTPFirewallRuleGroup(tx *dbs.Tx, id int64) error

DisableHTTPFirewallRuleGroup 禁用条目

func (*HTTPFirewallRuleGroupDAO) EnableHTTPFirewallRuleGroup

func (this *HTTPFirewallRuleGroupDAO) EnableHTTPFirewallRuleGroup(tx *dbs.Tx, id int64) error

EnableHTTPFirewallRuleGroup 启用条目

func (*HTTPFirewallRuleGroupDAO) FindEnabledHTTPFirewallRuleGroup

func (this *HTTPFirewallRuleGroupDAO) FindEnabledHTTPFirewallRuleGroup(tx *dbs.Tx, id int64) (*HTTPFirewallRuleGroup, error)

FindEnabledHTTPFirewallRuleGroup 查找启用中的条目

func (*HTTPFirewallRuleGroupDAO) FindHTTPFirewallRuleGroupName

func (this *HTTPFirewallRuleGroupDAO) FindHTTPFirewallRuleGroupName(tx *dbs.Tx, id int64) (string, error)

FindHTTPFirewallRuleGroupName 根据主键查找名称

func (*HTTPFirewallRuleGroupDAO) FindRuleGroupIdWithRuleSetId

func (this *HTTPFirewallRuleGroupDAO) FindRuleGroupIdWithRuleSetId(tx *dbs.Tx, setId int64) (int64, error)

FindRuleGroupIdWithRuleSetId 根据规则集查找规则分组

func (*HTTPFirewallRuleGroupDAO) Init

func (this *HTTPFirewallRuleGroupDAO) Init()

Init 初始化

func (*HTTPFirewallRuleGroupDAO) NotifyUpdate

func (this *HTTPFirewallRuleGroupDAO) NotifyUpdate(tx *dbs.Tx, groupId int64) error

NotifyUpdate 通知更新

func (*HTTPFirewallRuleGroupDAO) UpdateGroup

func (this *HTTPFirewallRuleGroupDAO) UpdateGroup(tx *dbs.Tx, groupId int64, isOn bool, name string, code string, description string) error

UpdateGroup 修改分组

func (*HTTPFirewallRuleGroupDAO) UpdateGroupIsOn

func (this *HTTPFirewallRuleGroupDAO) UpdateGroupIsOn(tx *dbs.Tx, groupId int64, isOn bool) error

UpdateGroupIsOn 修改开启状态

func (*HTTPFirewallRuleGroupDAO) UpdateGroupSets

func (this *HTTPFirewallRuleGroupDAO) UpdateGroupSets(tx *dbs.Tx, groupId int64, setRefsJSON []byte) error

UpdateGroupSets 修改分组中的规则集

type HTTPFirewallRuleGroupOperator

type HTTPFirewallRuleGroupOperator struct {
	Id          interface{} // ID
	IsOn        interface{} // 是否启用
	Name        interface{} // 名称
	Description interface{} // 描述
	Code        interface{} // 代号
	IsTemplate  interface{} // 是否为预置模板
	AdminId     interface{} // 管理员ID
	UserId      interface{} // 用户ID
	State       interface{} // 状态
	Sets        interface{} // 规则集列表
	CreatedAt   interface{} // 创建时间
}

func NewHTTPFirewallRuleGroupOperator

func NewHTTPFirewallRuleGroupOperator() *HTTPFirewallRuleGroupOperator

type HTTPFirewallRuleOperator

type HTTPFirewallRuleOperator struct {
	Id                interface{} // ID
	IsOn              interface{} // 是否启用
	Description       interface{} // 说明
	Param             interface{} // 参数
	ParamFilters      interface{} // 处理器
	Operator          interface{} // 操作符
	Value             interface{} // 对比值
	IsCaseInsensitive interface{} // 是否大小写不敏感
	CheckpointOptions interface{} // 检查点参数
	State             interface{} // 状态
	CreatedAt         interface{} // 创建时间
	AdminId           interface{} // 管理员ID
	UserId            interface{} // 用户ID
}

func NewHTTPFirewallRuleOperator

func NewHTTPFirewallRuleOperator() *HTTPFirewallRuleOperator

type HTTPFirewallRuleSet

type HTTPFirewallRuleSet struct {
	Id            uint32   `field:"id"`            // ID
	IsOn          bool     `field:"isOn"`          // 是否启用
	Code          string   `field:"code"`          // 代号
	Name          string   `field:"name"`          // 名称
	Description   string   `field:"description"`   // 描述
	CreatedAt     uint64   `field:"createdAt"`     // 创建时间
	Rules         dbs.JSON `field:"rules"`         // 规则列表
	Connector     string   `field:"connector"`     // 规则之间的关系
	State         uint8    `field:"state"`         // 状态
	AdminId       uint32   `field:"adminId"`       // 管理员ID
	UserId        uint32   `field:"userId"`        // 用户ID
	Action        string   `field:"action"`        // 执行的动作(过期)
	ActionOptions dbs.JSON `field:"actionOptions"` // 动作的选项(过期)
	Actions       dbs.JSON `field:"actions"`       // 一组动作
	IgnoreLocal   uint8    `field:"ignoreLocal"`   // 忽略局域网请求
}

HTTPFirewallRuleSet 防火墙规则集

type HTTPFirewallRuleSetDAO

type HTTPFirewallRuleSetDAO dbs.DAO
var SharedHTTPFirewallRuleSetDAO *HTTPFirewallRuleSetDAO

func NewHTTPFirewallRuleSetDAO

func NewHTTPFirewallRuleSetDAO() *HTTPFirewallRuleSetDAO

func (*HTTPFirewallRuleSetDAO) CheckUserRuleSet

func (this *HTTPFirewallRuleSetDAO) CheckUserRuleSet(tx *dbs.Tx, userId int64, setId int64) error

CheckUserRuleSet 检查用户

func (*HTTPFirewallRuleSetDAO) ComposeFirewallRuleSet

func (this *HTTPFirewallRuleSetDAO) ComposeFirewallRuleSet(tx *dbs.Tx, setId int64) (*firewallconfigs.HTTPFirewallRuleSet, error)

ComposeFirewallRuleSet 组合配置

func (*HTTPFirewallRuleSetDAO) CreateOrUpdateSetFromConfig

func (this *HTTPFirewallRuleSetDAO) CreateOrUpdateSetFromConfig(tx *dbs.Tx, setConfig *firewallconfigs.HTTPFirewallRuleSet) (int64, error)

CreateOrUpdateSetFromConfig 从配置中创建规则集

func (*HTTPFirewallRuleSetDAO) DisableHTTPFirewallRuleSet

func (this *HTTPFirewallRuleSetDAO) DisableHTTPFirewallRuleSet(tx *dbs.Tx, ruleSetId int64) error

DisableHTTPFirewallRuleSet 禁用条目

func (*HTTPFirewallRuleSetDAO) EnableHTTPFirewallRuleSet

func (this *HTTPFirewallRuleSetDAO) EnableHTTPFirewallRuleSet(tx *dbs.Tx, id int64) error

EnableHTTPFirewallRuleSet 启用条目

func (*HTTPFirewallRuleSetDAO) FindEnabledHTTPFirewallRuleSet

func (this *HTTPFirewallRuleSetDAO) FindEnabledHTTPFirewallRuleSet(tx *dbs.Tx, id int64) (*HTTPFirewallRuleSet, error)

FindEnabledHTTPFirewallRuleSet 查找启用中的条目

func (*HTTPFirewallRuleSetDAO) FindEnabledRuleSetIdWithRuleId

func (this *HTTPFirewallRuleSetDAO) FindEnabledRuleSetIdWithRuleId(tx *dbs.Tx, ruleId int64) (int64, error)

FindEnabledRuleSetIdWithRuleId 根据规则查找规则集

func (*HTTPFirewallRuleSetDAO) FindHTTPFirewallRuleSetName

func (this *HTTPFirewallRuleSetDAO) FindHTTPFirewallRuleSetName(tx *dbs.Tx, id int64) (string, error)

FindHTTPFirewallRuleSetName 根据主键查找名称

func (*HTTPFirewallRuleSetDAO) Init

func (this *HTTPFirewallRuleSetDAO) Init()

Init 初始化

func (*HTTPFirewallRuleSetDAO) NotifyUpdate

func (this *HTTPFirewallRuleSetDAO) NotifyUpdate(tx *dbs.Tx, setId int64) error

NotifyUpdate 通知更新

func (*HTTPFirewallRuleSetDAO) UpdateRuleSetIsOn

func (this *HTTPFirewallRuleSetDAO) UpdateRuleSetIsOn(tx *dbs.Tx, ruleSetId int64, isOn bool) error

UpdateRuleSetIsOn 设置是否启用

type HTTPFirewallRuleSetOperator

type HTTPFirewallRuleSetOperator struct {
	Id            interface{} // ID
	IsOn          interface{} // 是否启用
	Code          interface{} // 代号
	Name          interface{} // 名称
	Description   interface{} // 描述
	CreatedAt     interface{} // 创建时间
	Rules         interface{} // 规则列表
	Connector     interface{} // 规则之间的关系
	State         interface{} // 状态
	AdminId       interface{} // 管理员ID
	UserId        interface{} // 用户ID
	Action        interface{} // 执行的动作(过期)
	ActionOptions interface{} // 动作的选项(过期)
	Actions       interface{} // 一组动作
	IgnoreLocal   interface{} // 忽略局域网请求
}

func NewHTTPFirewallRuleSetOperator

func NewHTTPFirewallRuleSetOperator() *HTTPFirewallRuleSetOperator

type HTTPGzip

type HTTPGzip struct {
	Id        uint32   `field:"id"`        // ID
	AdminId   uint32   `field:"adminId"`   // 管理员ID
	UserId    uint32   `field:"userId"`    // 用户ID
	IsOn      bool     `field:"isOn"`      // 是否启用
	Level     uint32   `field:"level"`     // 压缩级别
	MinLength dbs.JSON `field:"minLength"` // 可压缩最小值
	MaxLength dbs.JSON `field:"maxLength"` // 可压缩最大值
	State     uint8    `field:"state"`     // 状态
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	Conds     dbs.JSON `field:"conds"`     // 条件
}

HTTPGzip Gzip配置

func (*HTTPGzip) DecodeMaxLength

func (this *HTTPGzip) DecodeMaxLength() (*shared.SizeCapacity, error)

DecodeMaxLength 解析最大长度

func (*HTTPGzip) DecodeMinLength

func (this *HTTPGzip) DecodeMinLength() (*shared.SizeCapacity, error)

DecodeMinLength 解析最小长度

type HTTPGzipDAO

type HTTPGzipDAO dbs.DAO
var SharedHTTPGzipDAO *HTTPGzipDAO

func NewHTTPGzipDAO

func NewHTTPGzipDAO() *HTTPGzipDAO

func (*HTTPGzipDAO) ComposeGzipConfig

func (this *HTTPGzipDAO) ComposeGzipConfig(tx *dbs.Tx, gzipId int64) (*serverconfigs.HTTPGzipCompressionConfig, error)

ComposeGzipConfig 组合配置

func (*HTTPGzipDAO) CreateGzip

func (this *HTTPGzipDAO) CreateGzip(tx *dbs.Tx, level int, minLengthJSON []byte, maxLengthJSON []byte, condsJSON []byte) (int64, error)

CreateGzip 创建Gzip

func (*HTTPGzipDAO) DisableHTTPGzip

func (this *HTTPGzipDAO) DisableHTTPGzip(tx *dbs.Tx, gzipId int64) error

DisableHTTPGzip 禁用条目

func (*HTTPGzipDAO) EnableHTTPGzip

func (this *HTTPGzipDAO) EnableHTTPGzip(tx *dbs.Tx, id int64) error

EnableHTTPGzip 启用条目

func (*HTTPGzipDAO) FindEnabledHTTPGzip

func (this *HTTPGzipDAO) FindEnabledHTTPGzip(tx *dbs.Tx, id int64) (*HTTPGzip, error)

FindEnabledHTTPGzip 查找启用中的条目

func (*HTTPGzipDAO) Init

func (this *HTTPGzipDAO) Init()

Init 初始化

func (*HTTPGzipDAO) NotifyUpdate

func (this *HTTPGzipDAO) NotifyUpdate(tx *dbs.Tx, gzipId int64) error

NotifyUpdate 通知更新

func (*HTTPGzipDAO) UpdateGzip

func (this *HTTPGzipDAO) UpdateGzip(tx *dbs.Tx, gzipId int64, level int, minLengthJSON []byte, maxLengthJSON []byte, condsJSON []byte) error

UpdateGzip 修改Gzip

type HTTPGzipOperator

type HTTPGzipOperator struct {
	Id        interface{} // ID
	AdminId   interface{} // 管理员ID
	UserId    interface{} // 用户ID
	IsOn      interface{} // 是否启用
	Level     interface{} // 压缩级别
	MinLength interface{} // 可压缩最小值
	MaxLength interface{} // 可压缩最大值
	State     interface{} // 状态
	CreatedAt interface{} // 创建时间
	Conds     interface{} // 条件
}

func NewHTTPGzipOperator

func NewHTTPGzipOperator() *HTTPGzipOperator

type HTTPHeader

type HTTPHeader struct {
	Id              uint32   `field:"id"`              // ID
	AdminId         uint32   `field:"adminId"`         // 管理员ID
	UserId          uint32   `field:"userId"`          // 用户ID
	TemplateId      uint32   `field:"templateId"`      // 模版ID
	IsOn            bool     `field:"isOn"`            // 是否启用
	Name            string   `field:"name"`            // 名称
	Value           string   `field:"value"`           // 值
	Order           uint32   `field:"order"`           // 排序
	Status          dbs.JSON `field:"status"`          // 状态码设置
	DisableRedirect uint8    `field:"disableRedirect"` // 是否不支持跳转
	ShouldAppend    uint8    `field:"shouldAppend"`    // 是否为附加
	ShouldReplace   uint8    `field:"shouldReplace"`   // 是否替换变量
	ReplaceValues   dbs.JSON `field:"replaceValues"`   // 替换的值
	Methods         dbs.JSON `field:"methods"`         // 支持的方法
	Domains         dbs.JSON `field:"domains"`         // 支持的域名
	State           uint8    `field:"state"`           // 状态
	CreatedAt       uint64   `field:"createdAt"`       // 创建时间
}

HTTPHeader HTTP Header

type HTTPHeaderDAO

type HTTPHeaderDAO dbs.DAO
var SharedHTTPHeaderDAO *HTTPHeaderDAO

func NewHTTPHeaderDAO

func NewHTTPHeaderDAO() *HTTPHeaderDAO

func (*HTTPHeaderDAO) ComposeHeaderConfig

func (this *HTTPHeaderDAO) ComposeHeaderConfig(tx *dbs.Tx, headerId int64) (*shared.HTTPHeaderConfig, error)

ComposeHeaderConfig 组合Header配置

func (*HTTPHeaderDAO) CreateHeader

func (this *HTTPHeaderDAO) CreateHeader(tx *dbs.Tx, userId int64, name string, value string, status []int, disableRedirect bool, shouldAppend bool, shouldReplace bool, replaceValues []*shared.HTTPHeaderReplaceValue, methods []string, domains []string) (int64, error)

CreateHeader 创建Header

func (*HTTPHeaderDAO) DisableHTTPHeader

func (this *HTTPHeaderDAO) DisableHTTPHeader(tx *dbs.Tx, id uint32) error

DisableHTTPHeader 禁用条目

func (*HTTPHeaderDAO) EnableHTTPHeader

func (this *HTTPHeaderDAO) EnableHTTPHeader(tx *dbs.Tx, id int64) error

EnableHTTPHeader 启用条目

func (*HTTPHeaderDAO) FindEnabledHTTPHeader

func (this *HTTPHeaderDAO) FindEnabledHTTPHeader(tx *dbs.Tx, id int64) (*HTTPHeader, error)

FindEnabledHTTPHeader 查找启用中的条目

func (*HTTPHeaderDAO) FindHTTPHeaderName

func (this *HTTPHeaderDAO) FindHTTPHeaderName(tx *dbs.Tx, id int64) (string, error)

FindHTTPHeaderName 根据主键查找名称

func (*HTTPHeaderDAO) Init

func (this *HTTPHeaderDAO) Init()

Init 初始化

func (*HTTPHeaderDAO) NotifyUpdate

func (this *HTTPHeaderDAO) NotifyUpdate(tx *dbs.Tx, headerId int64) error

NotifyUpdate 通知更新

func (*HTTPHeaderDAO) UpdateHeader

func (this *HTTPHeaderDAO) UpdateHeader(tx *dbs.Tx, headerId int64, name string, value string, status []int, disableRedirect bool, shouldAppend bool, shouldReplace bool, replaceValues []*shared.HTTPHeaderReplaceValue, methods []string, domains []string) error

UpdateHeader 修改Header

type HTTPHeaderOperator

type HTTPHeaderOperator struct {
	Id              interface{} // ID
	AdminId         interface{} // 管理员ID
	UserId          interface{} // 用户ID
	TemplateId      interface{} // 模版ID
	IsOn            interface{} // 是否启用
	Name            interface{} // 名称
	Value           interface{} // 值
	Order           interface{} // 排序
	Status          interface{} // 状态码设置
	DisableRedirect interface{} // 是否不支持跳转
	ShouldAppend    interface{} // 是否为附加
	ShouldReplace   interface{} // 是否替换变量
	ReplaceValues   interface{} // 替换的值
	Methods         interface{} // 支持的方法
	Domains         interface{} // 支持的域名
	State           interface{} // 状态
	CreatedAt       interface{} // 创建时间
}

func NewHTTPHeaderOperator

func NewHTTPHeaderOperator() *HTTPHeaderOperator

type HTTPHeaderPolicy

type HTTPHeaderPolicy struct {
	Id             uint32   `field:"id"`             // ID
	IsOn           bool     `field:"isOn"`           // 是否启用
	State          uint8    `field:"state"`          // 状态
	AdminId        uint32   `field:"adminId"`        // 管理员ID
	UserId         uint32   `field:"userId"`         // 用户ID
	CreatedAt      uint64   `field:"createdAt"`      // 创建时间
	AddHeaders     dbs.JSON `field:"addHeaders"`     // 添加的Header
	AddTrailers    dbs.JSON `field:"addTrailers"`    // 添加的Trailers
	SetHeaders     dbs.JSON `field:"setHeaders"`     // 设置Header
	ReplaceHeaders dbs.JSON `field:"replaceHeaders"` // 替换Header内容
	Expires        dbs.JSON `field:"expires"`        // Expires单独设置
	DeleteHeaders  dbs.JSON `field:"deleteHeaders"`  // 删除的Headers
}

type HTTPHeaderPolicyDAO

type HTTPHeaderPolicyDAO dbs.DAO
var SharedHTTPHeaderPolicyDAO *HTTPHeaderPolicyDAO

func NewHTTPHeaderPolicyDAO

func NewHTTPHeaderPolicyDAO() *HTTPHeaderPolicyDAO

func (*HTTPHeaderPolicyDAO) ComposeHeaderPolicyConfig

func (this *HTTPHeaderPolicyDAO) ComposeHeaderPolicyConfig(tx *dbs.Tx, headerPolicyId int64) (*shared.HTTPHeaderPolicy, error)

ComposeHeaderPolicyConfig 组合配置

func (*HTTPHeaderPolicyDAO) CreateHeaderPolicy

func (this *HTTPHeaderPolicyDAO) CreateHeaderPolicy(tx *dbs.Tx) (int64, error)

CreateHeaderPolicy 创建策略

func (*HTTPHeaderPolicyDAO) DisableHTTPHeaderPolicy

func (this *HTTPHeaderPolicyDAO) DisableHTTPHeaderPolicy(tx *dbs.Tx, policyId int64) error

DisableHTTPHeaderPolicy 禁用条目

func (*HTTPHeaderPolicyDAO) EnableHTTPHeaderPolicy

func (this *HTTPHeaderPolicyDAO) EnableHTTPHeaderPolicy(tx *dbs.Tx, id int64) error

EnableHTTPHeaderPolicy 启用条目

func (*HTTPHeaderPolicyDAO) FindEnabledHTTPHeaderPolicy

func (this *HTTPHeaderPolicyDAO) FindEnabledHTTPHeaderPolicy(tx *dbs.Tx, id int64) (*HTTPHeaderPolicy, error)

FindEnabledHTTPHeaderPolicy 查找启用中的条目

func (*HTTPHeaderPolicyDAO) FindHeaderPolicyIdWithHeaderId

func (this *HTTPHeaderPolicyDAO) FindHeaderPolicyIdWithHeaderId(tx *dbs.Tx, headerId int64) (int64, error)

FindHeaderPolicyIdWithHeaderId 查找Header所在Policy

func (*HTTPHeaderPolicyDAO) Init

func (this *HTTPHeaderPolicyDAO) Init()

Init 初始化

func (*HTTPHeaderPolicyDAO) NotifyUpdate

func (this *HTTPHeaderPolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更新

func (*HTTPHeaderPolicyDAO) UpdateAddingHeaders

func (this *HTTPHeaderPolicyDAO) UpdateAddingHeaders(tx *dbs.Tx, policyId int64, headersJSON []byte) error

UpdateAddingHeaders 修改AddHeaders

func (*HTTPHeaderPolicyDAO) UpdateAddingTrailers

func (this *HTTPHeaderPolicyDAO) UpdateAddingTrailers(tx *dbs.Tx, policyId int64, headersJSON []byte) error

UpdateAddingTrailers 修改AddTrailers

func (*HTTPHeaderPolicyDAO) UpdateDeletingHeaders

func (this *HTTPHeaderPolicyDAO) UpdateDeletingHeaders(tx *dbs.Tx, policyId int64, headerNames []string) error

UpdateDeletingHeaders 修改DeleteHeaders

func (*HTTPHeaderPolicyDAO) UpdateReplacingHeaders

func (this *HTTPHeaderPolicyDAO) UpdateReplacingHeaders(tx *dbs.Tx, policyId int64, headersJSON []byte) error

UpdateReplacingHeaders 修改ReplaceHeaders

func (*HTTPHeaderPolicyDAO) UpdateSettingHeaders

func (this *HTTPHeaderPolicyDAO) UpdateSettingHeaders(tx *dbs.Tx, policyId int64, headersJSON []byte) error

UpdateSettingHeaders 修改SetHeaders

type HTTPHeaderPolicyOperator

type HTTPHeaderPolicyOperator struct {
	Id             interface{} // ID
	IsOn           interface{} // 是否启用
	State          interface{} // 状态
	AdminId        interface{} // 管理员ID
	UserId         interface{} // 用户ID
	CreatedAt      interface{} // 创建时间
	AddHeaders     interface{} // 添加的Header
	AddTrailers    interface{} // 添加的Trailers
	SetHeaders     interface{} // 设置Header
	ReplaceHeaders interface{} // 替换Header内容
	Expires        interface{} // Expires单独设置
	DeleteHeaders  interface{} // 删除的Headers
}

func NewHTTPHeaderPolicyOperator

func NewHTTPHeaderPolicyOperator() *HTTPHeaderPolicyOperator

type HTTPLocation

type HTTPLocation struct {
	Id           uint32   `field:"id"`           // ID
	TemplateId   uint32   `field:"templateId"`   // 模版ID
	AdminId      uint32   `field:"adminId"`      // 管理员ID
	UserId       uint32   `field:"userId"`       // 用户ID
	ParentId     uint32   `field:"parentId"`     // 父级ID
	State        uint8    `field:"state"`        // 状态
	CreatedAt    uint64   `field:"createdAt"`    // 创建时间
	Pattern      string   `field:"pattern"`      // 匹配规则
	IsOn         bool     `field:"isOn"`         // 是否启用
	Name         string   `field:"name"`         // 名称
	Description  string   `field:"description"`  // 描述
	WebId        uint32   `field:"webId"`        // Web配置ID
	ReverseProxy dbs.JSON `field:"reverseProxy"` // 反向代理
	UrlPrefix    string   `field:"urlPrefix"`    // URL前缀
	IsBreak      bool     `field:"isBreak"`      // 是否终止匹配
	Conds        dbs.JSON `field:"conds"`        // 匹配条件
	Domains      dbs.JSON `field:"domains"`      // 专属域名
}

HTTPLocation 路由规则配置

type HTTPLocationDAO

type HTTPLocationDAO dbs.DAO
var SharedHTTPLocationDAO *HTTPLocationDAO

func NewHTTPLocationDAO

func NewHTTPLocationDAO() *HTTPLocationDAO

func (*HTTPLocationDAO) ComposeLocationConfig

func (this *HTTPLocationDAO) ComposeLocationConfig(tx *dbs.Tx, locationId int64, cacheMap *utils.CacheMap) (*serverconfigs.HTTPLocationConfig, error)

ComposeLocationConfig 组合配置

func (*HTTPLocationDAO) ConvertLocationRefs

func (this *HTTPLocationDAO) ConvertLocationRefs(tx *dbs.Tx, refs []*serverconfigs.HTTPLocationRef, cacheMap *utils.CacheMap) (locations []*serverconfigs.HTTPLocationConfig, err error)

ConvertLocationRefs 转换引用为配置

func (*HTTPLocationDAO) CreateLocation

func (this *HTTPLocationDAO) CreateLocation(tx *dbs.Tx, parentId int64, name string, pattern string, description string, isBreak bool, condsJSON []byte, domains []string) (int64, error)

CreateLocation 创建路由规则

func (*HTTPLocationDAO) DisableHTTPLocation

func (this *HTTPLocationDAO) DisableHTTPLocation(tx *dbs.Tx, locationId int64) error

DisableHTTPLocation 禁用条目

func (*HTTPLocationDAO) EnableHTTPLocation

func (this *HTTPLocationDAO) EnableHTTPLocation(tx *dbs.Tx, id int64) error

EnableHTTPLocation 启用条目

func (*HTTPLocationDAO) FindEnabledHTTPLocation

func (this *HTTPLocationDAO) FindEnabledHTTPLocation(tx *dbs.Tx, id int64) (*HTTPLocation, error)

FindEnabledHTTPLocation 查找启用中的条目

func (*HTTPLocationDAO) FindEnabledLocationIdWithReverseProxyId

func (this *HTTPLocationDAO) FindEnabledLocationIdWithReverseProxyId(tx *dbs.Tx, reverseProxyId int64) (serverId int64, err error)

FindEnabledLocationIdWithReverseProxyId 查找包含某个反向代理的路由规则

func (*HTTPLocationDAO) FindEnabledLocationIdWithWebId

func (this *HTTPLocationDAO) FindEnabledLocationIdWithWebId(tx *dbs.Tx, webId int64) (locationId int64, err error)

FindEnabledLocationIdWithWebId 根据WebId查找LocationId

func (*HTTPLocationDAO) FindHTTPLocationName

func (this *HTTPLocationDAO) FindHTTPLocationName(tx *dbs.Tx, id int64) (string, error)

FindHTTPLocationName 根据主键查找名称

func (*HTTPLocationDAO) FindLocationReverseProxy

func (this *HTTPLocationDAO) FindLocationReverseProxy(tx *dbs.Tx, locationId int64) (*serverconfigs.ReverseProxyRef, error)

FindLocationReverseProxy 查找反向代理设置

func (*HTTPLocationDAO) FindLocationWebId

func (this *HTTPLocationDAO) FindLocationWebId(tx *dbs.Tx, locationId int64) (int64, error)

FindLocationWebId 查找WebId

func (*HTTPLocationDAO) Init

func (this *HTTPLocationDAO) Init()

Init 初始化

func (*HTTPLocationDAO) NotifyUpdate

func (this *HTTPLocationDAO) NotifyUpdate(tx *dbs.Tx, locationId int64) error

NotifyUpdate 通知更新

func (*HTTPLocationDAO) UpdateLocation

func (this *HTTPLocationDAO) UpdateLocation(tx *dbs.Tx, locationId int64, name string, pattern string, description string, isOn bool, isBreak bool, condsJSON []byte, domains []string) error

UpdateLocation 修改路由规则

func (*HTTPLocationDAO) UpdateLocationReverseProxy

func (this *HTTPLocationDAO) UpdateLocationReverseProxy(tx *dbs.Tx, locationId int64, reverseProxyJSON []byte) error

UpdateLocationReverseProxy 更改反向代理设置

func (*HTTPLocationDAO) UpdateLocationWeb

func (this *HTTPLocationDAO) UpdateLocationWeb(tx *dbs.Tx, locationId int64, webId int64) error

UpdateLocationWeb 更改Web设置

type HTTPLocationOperator

type HTTPLocationOperator struct {
	Id           interface{} // ID
	TemplateId   interface{} // 模版ID
	AdminId      interface{} // 管理员ID
	UserId       interface{} // 用户ID
	ParentId     interface{} // 父级ID
	State        interface{} // 状态
	CreatedAt    interface{} // 创建时间
	Pattern      interface{} // 匹配规则
	IsOn         interface{} // 是否启用
	Name         interface{} // 名称
	Description  interface{} // 描述
	WebId        interface{} // Web配置ID
	ReverseProxy interface{} // 反向代理
	UrlPrefix    interface{} // URL前缀
	IsBreak      interface{} // 是否终止匹配
	Conds        interface{} // 匹配条件
	Domains      interface{} // 专属域名
}

func NewHTTPLocationOperator

func NewHTTPLocationOperator() *HTTPLocationOperator

type HTTPPage

type HTTPPage struct {
	Id         uint32   `field:"id"`         // ID
	AdminId    uint32   `field:"adminId"`    // 管理员ID
	UserId     uint32   `field:"userId"`     // 用户ID
	IsOn       bool     `field:"isOn"`       // 是否启用
	StatusList dbs.JSON `field:"statusList"` // 状态列表
	Url        string   `field:"url"`        // 页面URL
	NewStatus  int32    `field:"newStatus"`  // 新状态码
	State      uint8    `field:"state"`      // 状态
	CreatedAt  uint64   `field:"createdAt"`  // 创建时间
	Body       string   `field:"body"`       // 页面内容
	BodyType   string   `field:"bodyType"`   // 内容类型
}

HTTPPage 特殊页面

type HTTPPageDAO

type HTTPPageDAO dbs.DAO
var SharedHTTPPageDAO *HTTPPageDAO

func NewHTTPPageDAO

func NewHTTPPageDAO() *HTTPPageDAO

func (*HTTPPageDAO) CheckUserPage

func (this *HTTPPageDAO) CheckUserPage(tx *dbs.Tx, userId int64, pageId int64) error

CheckUserPage 检查用户页面

func (*HTTPPageDAO) ComposePageConfig

func (this *HTTPPageDAO) ComposePageConfig(tx *dbs.Tx, pageId int64, cacheMap *utils.CacheMap) (*serverconfigs.HTTPPageConfig, error)

ComposePageConfig 组合配置

func (*HTTPPageDAO) CreatePage

func (this *HTTPPageDAO) CreatePage(tx *dbs.Tx, userId int64, statusList []string, bodyType shared.BodyType, url string, body string, newStatus int) (pageId int64, err error)

CreatePage 创建Page

func (*HTTPPageDAO) DisableHTTPPage

func (this *HTTPPageDAO) DisableHTTPPage(tx *dbs.Tx, id int64) error

DisableHTTPPage 禁用条目

func (*HTTPPageDAO) EnableHTTPPage

func (this *HTTPPageDAO) EnableHTTPPage(tx *dbs.Tx, pageId int64) error

EnableHTTPPage 启用条目

func (*HTTPPageDAO) FindEnabledHTTPPage

func (this *HTTPPageDAO) FindEnabledHTTPPage(tx *dbs.Tx, id int64) (*HTTPPage, error)

FindEnabledHTTPPage 查找启用中的条目

func (*HTTPPageDAO) Init

func (this *HTTPPageDAO) Init()

Init 初始化

func (*HTTPPageDAO) NotifyUpdate

func (this *HTTPPageDAO) NotifyUpdate(tx *dbs.Tx, pageId int64) error

NotifyUpdate 通知更新

func (*HTTPPageDAO) UpdatePage

func (this *HTTPPageDAO) UpdatePage(tx *dbs.Tx, pageId int64, statusList []string, bodyType shared.BodyType, url string, body string, newStatus int) error

UpdatePage 修改Page

type HTTPPageOperator

type HTTPPageOperator struct {
	Id         interface{} // ID
	AdminId    interface{} // 管理员ID
	UserId     interface{} // 用户ID
	IsOn       interface{} // 是否启用
	StatusList interface{} // 状态列表
	Url        interface{} // 页面URL
	NewStatus  interface{} // 新状态码
	State      interface{} // 状态
	CreatedAt  interface{} // 创建时间
	Body       interface{} // 页面内容
	BodyType   interface{} // 内容类型
}

func NewHTTPPageOperator

func NewHTTPPageOperator() *HTTPPageOperator

type HTTPRewriteRule

type HTTPRewriteRule struct {
	Id             uint32   `field:"id"`             // ID
	AdminId        uint32   `field:"adminId"`        // 管理员ID
	UserId         uint32   `field:"userId"`         // 用户ID
	TemplateId     uint32   `field:"templateId"`     // 模版ID
	IsOn           bool     `field:"isOn"`           // 是否启用
	State          uint8    `field:"state"`          // 状态
	CreatedAt      uint64   `field:"createdAt"`      // 创建时间
	Pattern        string   `field:"pattern"`        // 匹配规则
	Replace        string   `field:"replace"`        // 跳转后的地址
	Mode           string   `field:"mode"`           // 替换模式
	RedirectStatus uint32   `field:"redirectStatus"` // 跳转的状态码
	ProxyHost      string   `field:"proxyHost"`      // 代理的主机名
	IsBreak        bool     `field:"isBreak"`        // 是否终止解析
	WithQuery      uint8    `field:"withQuery"`      // 是否保留URI参数
	Conds          dbs.JSON `field:"conds"`          // 匹配条件
}

重写规则

type HTTPRewriteRuleDAO

type HTTPRewriteRuleDAO dbs.DAO
var SharedHTTPRewriteRuleDAO *HTTPRewriteRuleDAO

func NewHTTPRewriteRuleDAO

func NewHTTPRewriteRuleDAO() *HTTPRewriteRuleDAO

func (*HTTPRewriteRuleDAO) ComposeRewriteRule

func (this *HTTPRewriteRuleDAO) ComposeRewriteRule(tx *dbs.Tx, rewriteRuleId int64, cacheMap *utils.CacheMap) (*serverconfigs.HTTPRewriteRule, error)

ComposeRewriteRule 构造配置

func (*HTTPRewriteRuleDAO) CreateRewriteRule

func (this *HTTPRewriteRuleDAO) CreateRewriteRule(tx *dbs.Tx, pattern string, replace string, mode string, redirectStatus int, isBreak bool, proxyHost string, withQuery bool, isOn bool, condsJSON []byte) (int64, error)

CreateRewriteRule 创建规则

func (*HTTPRewriteRuleDAO) DisableHTTPRewriteRule

func (this *HTTPRewriteRuleDAO) DisableHTTPRewriteRule(tx *dbs.Tx, rewriteRuleId int64) error

DisableHTTPRewriteRule 禁用条目

func (*HTTPRewriteRuleDAO) EnableHTTPRewriteRule

func (this *HTTPRewriteRuleDAO) EnableHTTPRewriteRule(tx *dbs.Tx, id int64) error

EnableHTTPRewriteRule 启用条目

func (*HTTPRewriteRuleDAO) FindEnabledHTTPRewriteRule

func (this *HTTPRewriteRuleDAO) FindEnabledHTTPRewriteRule(tx *dbs.Tx, id int64) (*HTTPRewriteRule, error)

FindEnabledHTTPRewriteRule 查找启用中的条目

func (*HTTPRewriteRuleDAO) Init

func (this *HTTPRewriteRuleDAO) Init()

Init 初始化

func (*HTTPRewriteRuleDAO) NotifyUpdate

func (this *HTTPRewriteRuleDAO) NotifyUpdate(tx *dbs.Tx, rewriteRuleId int64) error

NotifyUpdate 通知更新

func (*HTTPRewriteRuleDAO) UpdateRewriteRule

func (this *HTTPRewriteRuleDAO) UpdateRewriteRule(tx *dbs.Tx, rewriteRuleId int64, pattern string, replace string, mode string, redirectStatus int, isBreak bool, proxyHost string, withQuery bool, isOn bool, condsJSON []byte) error

UpdateRewriteRule 修改规则

type HTTPRewriteRuleOperator

type HTTPRewriteRuleOperator struct {
	Id             interface{} // ID
	AdminId        interface{} // 管理员ID
	UserId         interface{} // 用户ID
	TemplateId     interface{} // 模版ID
	IsOn           interface{} // 是否启用
	State          interface{} // 状态
	CreatedAt      interface{} // 创建时间
	Pattern        interface{} // 匹配规则
	Replace        interface{} // 跳转后的地址
	Mode           interface{} // 替换模式
	RedirectStatus interface{} // 跳转的状态码
	ProxyHost      interface{} // 代理的主机名
	IsBreak        interface{} // 是否终止解析
	WithQuery      interface{} // 是否保留URI参数
	Conds          interface{} // 匹配条件
}

func NewHTTPRewriteRuleOperator

func NewHTTPRewriteRuleOperator() *HTTPRewriteRuleOperator

type HTTPWeb

type HTTPWeb struct {
	Id                 uint32   `field:"id"`                 // ID
	IsOn               bool     `field:"isOn"`               // 是否启用
	TemplateId         uint32   `field:"templateId"`         // 模版ID
	AdminId            uint32   `field:"adminId"`            // 管理员ID
	UserId             uint32   `field:"userId"`             // 用户ID
	State              uint8    `field:"state"`              // 状态
	CreatedAt          uint64   `field:"createdAt"`          // 创建时间
	Root               dbs.JSON `field:"root"`               // 根目录
	Charset            dbs.JSON `field:"charset"`            // 字符集
	Shutdown           dbs.JSON `field:"shutdown"`           // 临时关闭页面配置
	Pages              dbs.JSON `field:"pages"`              // 特殊页面
	RedirectToHttps    dbs.JSON `field:"redirectToHttps"`    // 跳转到HTTPS设置
	Indexes            dbs.JSON `field:"indexes"`            // 首页文件列表
	MaxRequestBodySize dbs.JSON `field:"maxRequestBodySize"` // 最大允许的请求内容尺寸
	RequestHeader      dbs.JSON `field:"requestHeader"`      // 请求Header配置
	ResponseHeader     dbs.JSON `field:"responseHeader"`     // 响应Header配置
	AccessLog          dbs.JSON `field:"accessLog"`          // 访问日志配置
	Stat               dbs.JSON `field:"stat"`               // 统计配置
	Gzip               dbs.JSON `field:"gzip"`               // Gzip配置(v0.3.2弃用)
	Compression        dbs.JSON `field:"compression"`        // 压缩配置
	Cache              dbs.JSON `field:"cache"`              // 缓存配置
	Firewall           dbs.JSON `field:"firewall"`           // 防火墙设置
	Locations          dbs.JSON `field:"locations"`          // 路由规则配置
	Websocket          dbs.JSON `field:"websocket"`          // Websocket设置
	RewriteRules       dbs.JSON `field:"rewriteRules"`       // 重写规则配置
	HostRedirects      dbs.JSON `field:"hostRedirects"`      // 域名跳转
	Fastcgi            dbs.JSON `field:"fastcgi"`            // Fastcgi配置
	Auth               dbs.JSON `field:"auth"`               // 认证策略配置
	Webp               dbs.JSON `field:"webp"`               // WebP配置
	RemoteAddr         dbs.JSON `field:"remoteAddr"`         // 客户端IP配置
	MergeSlashes       uint8    `field:"mergeSlashes"`       // 是否合并路径中的斜杠
	RequestLimit       dbs.JSON `field:"requestLimit"`       // 请求限制
	RequestScripts     dbs.JSON `field:"requestScripts"`     // 请求脚本
	Uam                dbs.JSON `field:"uam"`                // UAM设置
	Referers           dbs.JSON `field:"referers"`           // 防盗链设置
}

HTTPWeb HTTP Web

type HTTPWebDAO

type HTTPWebDAO dbs.DAO
var SharedHTTPWebDAO *HTTPWebDAO

func NewHTTPWebDAO

func NewHTTPWebDAO() *HTTPWebDAO

func (*HTTPWebDAO) CheckUserWeb

func (this *HTTPWebDAO) CheckUserWeb(tx *dbs.Tx, userId int64, webId int64) error

CheckUserWeb 检查用户权限

func (*HTTPWebDAO) ComposeWebConfig

func (this *HTTPWebDAO) ComposeWebConfig(tx *dbs.Tx, webId int64, cacheMap *utils.CacheMap) (*serverconfigs.HTTPWebConfig, error)

ComposeWebConfig 组合配置

func (*HTTPWebDAO) CreateWeb

func (this *HTTPWebDAO) CreateWeb(tx *dbs.Tx, adminId int64, userId int64, rootJSON []byte) (int64, error)

CreateWeb 创建Web配置

func (*HTTPWebDAO) DisableHTTPWeb

func (this *HTTPWebDAO) DisableHTTPWeb(tx *dbs.Tx, id int64) error

DisableHTTPWeb 禁用条目

func (*HTTPWebDAO) EnableHTTPWeb

func (this *HTTPWebDAO) EnableHTTPWeb(tx *dbs.Tx, id int64) error

EnableHTTPWeb 启用条目

func (*HTTPWebDAO) FindAllWebIdsWithCachePolicyId

func (this *HTTPWebDAO) FindAllWebIdsWithCachePolicyId(tx *dbs.Tx, cachePolicyId int64) ([]int64, error)

FindAllWebIdsWithCachePolicyId 根据缓存策略ID查找所有的WebId

func (*HTTPWebDAO) FindAllWebIdsWithHTTPFirewallPolicyId

func (this *HTTPWebDAO) FindAllWebIdsWithHTTPFirewallPolicyId(tx *dbs.Tx, firewallPolicyId int64) ([]int64, error)

FindAllWebIdsWithHTTPFirewallPolicyId 根据防火墙策略ID查找所有的WebId

func (*HTTPWebDAO) FindEnabledHTTPWeb

func (this *HTTPWebDAO) FindEnabledHTTPWeb(tx *dbs.Tx, id int64) (*HTTPWeb, error)

FindEnabledHTTPWeb 查找启用中的条目

func (*HTTPWebDAO) FindEnabledWebIdWithBrotliPolicyId

func (this *HTTPWebDAO) FindEnabledWebIdWithBrotliPolicyId(tx *dbs.Tx, brotliPolicyId int64) (webId int64, err error)

FindEnabledWebIdWithBrotliPolicyId 查找包含某个Brotli配置的Web

func (*HTTPWebDAO) FindEnabledWebIdWithDeflatePolicyId

func (this *HTTPWebDAO) FindEnabledWebIdWithDeflatePolicyId(tx *dbs.Tx, deflatePolicyId int64) (webId int64, err error)

FindEnabledWebIdWithDeflatePolicyId 查找包含某个Deflate配置的Web

func (*HTTPWebDAO) FindEnabledWebIdWithFastcgiId

func (this *HTTPWebDAO) FindEnabledWebIdWithFastcgiId(tx *dbs.Tx, fastcgiId int64) (webId int64, err error)

FindEnabledWebIdWithFastcgiId 查找包含某个Fastcgi配置的Web

func (*HTTPWebDAO) FindEnabledWebIdWithGzipId

func (this *HTTPWebDAO) FindEnabledWebIdWithGzipId(tx *dbs.Tx, gzipId int64) (webId int64, err error)

FindEnabledWebIdWithGzipId 查找包含某个Gzip配置的Web

func (*HTTPWebDAO) FindEnabledWebIdWithHTTPAuthPolicyId

func (this *HTTPWebDAO) FindEnabledWebIdWithHTTPAuthPolicyId(tx *dbs.Tx, httpAuthPolicyId int64) (webId int64, err error)

FindEnabledWebIdWithHTTPAuthPolicyId 查找包含某个认证策略的Web

func (*HTTPWebDAO) FindEnabledWebIdWithHeaderPolicyId

func (this *HTTPWebDAO) FindEnabledWebIdWithHeaderPolicyId(tx *dbs.Tx, headerPolicyId int64) (webId int64, err error)

FindEnabledWebIdWithHeaderPolicyId 查找包含某个Header的Web

func (*HTTPWebDAO) FindEnabledWebIdWithLocationId

func (this *HTTPWebDAO) FindEnabledWebIdWithLocationId(tx *dbs.Tx, locationId int64) (webId int64, err error)

FindEnabledWebIdWithLocationId 查找包含某个Location的Web

func (*HTTPWebDAO) FindEnabledWebIdWithPageId

func (this *HTTPWebDAO) FindEnabledWebIdWithPageId(tx *dbs.Tx, pageId int64) (webId int64, err error)

FindEnabledWebIdWithPageId 查找包含某个页面的Web

func (*HTTPWebDAO) FindEnabledWebIdWithRewriteRuleId

func (this *HTTPWebDAO) FindEnabledWebIdWithRewriteRuleId(tx *dbs.Tx, rewriteRuleId int64) (webId int64, err error)

FindEnabledWebIdWithRewriteRuleId 查找包含某个重写规则的Web

func (*HTTPWebDAO) FindEnabledWebIdWithWebsocketId

func (this *HTTPWebDAO) FindEnabledWebIdWithWebsocketId(tx *dbs.Tx, websocketId int64) (webId int64, err error)

FindEnabledWebIdWithWebsocketId 查找包含某个Websocket配置的Web

func (*HTTPWebDAO) FindWebHostRedirects

func (this *HTTPWebDAO) FindWebHostRedirects(tx *dbs.Tx, webId int64) ([]byte, error)

FindWebHostRedirects 查找主机跳转

func (*HTTPWebDAO) FindWebReferers added in v0.5.3

func (this *HTTPWebDAO) FindWebReferers(tx *dbs.Tx, webId int64) ([]byte, error)

FindWebReferers 查找服务的防盗链配置

func (*HTTPWebDAO) FindWebRequestLimit

func (this *HTTPWebDAO) FindWebRequestLimit(tx *dbs.Tx, webId int64) (*serverconfigs.HTTPRequestLimitConfig, error)

FindWebRequestLimit 获取服务的请求限制

func (*HTTPWebDAO) FindWebRequestScripts

func (this *HTTPWebDAO) FindWebRequestScripts(tx *dbs.Tx, webId int64) (*serverconfigs.HTTPRequestScriptsConfig, error)

FindWebRequestScripts 查找服务的脚本设置

func (*HTTPWebDAO) FindWebServerGroupId

func (this *HTTPWebDAO) FindWebServerGroupId(tx *dbs.Tx, webId int64) (groupId int64, err error)

FindWebServerGroupId 查找使用此Web的分组ID

func (*HTTPWebDAO) FindWebServerId

func (this *HTTPWebDAO) FindWebServerId(tx *dbs.Tx, webId int64) (serverId int64, err error)

FindWebServerId 查找使用此Web的Server

func (*HTTPWebDAO) FindWebUAM

func (this *HTTPWebDAO) FindWebUAM(tx *dbs.Tx, webId int64) ([]byte, error)

FindWebUAM 查找服务的UAM配置

func (*HTTPWebDAO) Init

func (this *HTTPWebDAO) Init()

func (*HTTPWebDAO) NotifyUpdate

func (this *HTTPWebDAO) NotifyUpdate(tx *dbs.Tx, webId int64) error

NotifyUpdate 通知更新

func (*HTTPWebDAO) UpdateWeb

func (this *HTTPWebDAO) UpdateWeb(tx *dbs.Tx, webId int64, rootJSON []byte) error

UpdateWeb 修改Web配置

func (*HTTPWebDAO) UpdateWebAccessLogConfig

func (this *HTTPWebDAO) UpdateWebAccessLogConfig(tx *dbs.Tx, webId int64, accessLogJSON []byte) error

UpdateWebAccessLogConfig 更改访问日志策略

func (*HTTPWebDAO) UpdateWebAuth

func (this *HTTPWebDAO) UpdateWebAuth(tx *dbs.Tx, webId int64, authJSON []byte) error

UpdateWebAuth 修改认证信息

func (*HTTPWebDAO) UpdateWebCache

func (this *HTTPWebDAO) UpdateWebCache(tx *dbs.Tx, webId int64, cacheJSON []byte) error

UpdateWebCache 更改缓存配置

func (*HTTPWebDAO) UpdateWebCharset

func (this *HTTPWebDAO) UpdateWebCharset(tx *dbs.Tx, webId int64, charsetJSON []byte) error

UpdateWebCharset 修改字符编码

func (*HTTPWebDAO) UpdateWebCommon

func (this *HTTPWebDAO) UpdateWebCommon(tx *dbs.Tx, webId int64, mergeSlashes bool) error

UpdateWebCommon 修改通用设置

func (*HTTPWebDAO) UpdateWebCompression

func (this *HTTPWebDAO) UpdateWebCompression(tx *dbs.Tx, webId int64, compressionConfig []byte) error

UpdateWebCompression 修改压缩配置

func (*HTTPWebDAO) UpdateWebFastcgi

func (this *HTTPWebDAO) UpdateWebFastcgi(tx *dbs.Tx, webId int64, fastcgiJSON []byte) error

UpdateWebFastcgi 修改Fastcgi设置

func (*HTTPWebDAO) UpdateWebFirewall

func (this *HTTPWebDAO) UpdateWebFirewall(tx *dbs.Tx, webId int64, firewallJSON []byte) error

UpdateWebFirewall 更改防火墙配置

func (*HTTPWebDAO) UpdateWebHostRedirects

func (this *HTTPWebDAO) UpdateWebHostRedirects(tx *dbs.Tx, webId int64, hostRedirects []*serverconfigs.HTTPHostRedirectConfig) error

UpdateWebHostRedirects 设置主机跳转

func (*HTTPWebDAO) UpdateWebLocations

func (this *HTTPWebDAO) UpdateWebLocations(tx *dbs.Tx, webId int64, locationsJSON []byte) error

UpdateWebLocations 更改路由规则配置

func (*HTTPWebDAO) UpdateWebPages

func (this *HTTPWebDAO) UpdateWebPages(tx *dbs.Tx, webId int64, pagesJSON []byte) error

UpdateWebPages 更改特殊页面配置

func (*HTTPWebDAO) UpdateWebRedirectToHTTPS

func (this *HTTPWebDAO) UpdateWebRedirectToHTTPS(tx *dbs.Tx, webId int64, redirectToHTTPSJSON []byte) error

UpdateWebRedirectToHTTPS 更改跳转到HTTPS设置

func (*HTTPWebDAO) UpdateWebReferers added in v0.5.3

func (this *HTTPWebDAO) UpdateWebReferers(tx *dbs.Tx, webId int64, referersConfig *serverconfigs.ReferersConfig) error

UpdateWebReferers 修改防盗链设置

func (*HTTPWebDAO) UpdateWebRemoteAddr

func (this *HTTPWebDAO) UpdateWebRemoteAddr(tx *dbs.Tx, webId int64, remoteAddrConfig []byte) error

UpdateWebRemoteAddr 修改RemoteAddr配置

func (*HTTPWebDAO) UpdateWebRequestHeaderPolicy

func (this *HTTPWebDAO) UpdateWebRequestHeaderPolicy(tx *dbs.Tx, webId int64, headerPolicyJSON []byte) error

UpdateWebRequestHeaderPolicy 更改请求Header策略

func (*HTTPWebDAO) UpdateWebRequestLimit

func (this *HTTPWebDAO) UpdateWebRequestLimit(tx *dbs.Tx, webId int64, config *serverconfigs.HTTPRequestLimitConfig) error

UpdateWebRequestLimit 修改服务的请求限制

func (*HTTPWebDAO) UpdateWebRequestScripts

func (this *HTTPWebDAO) UpdateWebRequestScripts(tx *dbs.Tx, webId int64, config *serverconfigs.HTTPRequestScriptsConfig) error

UpdateWebRequestScripts 修改服务的请求脚本设置

func (*HTTPWebDAO) UpdateWebResponseHeaderPolicy

func (this *HTTPWebDAO) UpdateWebResponseHeaderPolicy(tx *dbs.Tx, webId int64, headerPolicyJSON []byte) error

UpdateWebResponseHeaderPolicy 更改响应Header策略

func (*HTTPWebDAO) UpdateWebRewriteRules

func (this *HTTPWebDAO) UpdateWebRewriteRules(tx *dbs.Tx, webId int64, rewriteRulesJSON []byte) error

UpdateWebRewriteRules 修改重写规则设置

func (*HTTPWebDAO) UpdateWebShutdown

func (this *HTTPWebDAO) UpdateWebShutdown(tx *dbs.Tx, webId int64, shutdownJSON []byte) error

UpdateWebShutdown 更改Shutdown配置

func (*HTTPWebDAO) UpdateWebStat

func (this *HTTPWebDAO) UpdateWebStat(tx *dbs.Tx, webId int64, statJSON []byte) error

UpdateWebStat 更改统计配置

func (*HTTPWebDAO) UpdateWebUAM

func (this *HTTPWebDAO) UpdateWebUAM(tx *dbs.Tx, webId int64, uamConfig *serverconfigs.UAMConfig) error

UpdateWebUAM 开启UAM

func (*HTTPWebDAO) UpdateWebWebP

func (this *HTTPWebDAO) UpdateWebWebP(tx *dbs.Tx, webId int64, webpConfig []byte) error

UpdateWebWebP 修改WebP配置

func (*HTTPWebDAO) UpdateWebsocket

func (this *HTTPWebDAO) UpdateWebsocket(tx *dbs.Tx, webId int64, websocketJSON []byte) error

UpdateWebsocket 修改Websocket设置

type HTTPWebOperator

type HTTPWebOperator struct {
	Id                 any // ID
	IsOn               any // 是否启用
	TemplateId         any // 模版ID
	AdminId            any // 管理员ID
	UserId             any // 用户ID
	State              any // 状态
	CreatedAt          any // 创建时间
	Root               any // 根目录
	Charset            any // 字符集
	Shutdown           any // 临时关闭页面配置
	Pages              any // 特殊页面
	RedirectToHttps    any // 跳转到HTTPS设置
	Indexes            any // 首页文件列表
	MaxRequestBodySize any // 最大允许的请求内容尺寸
	RequestHeader      any // 请求Header配置
	ResponseHeader     any // 响应Header配置
	AccessLog          any // 访问日志配置
	Stat               any // 统计配置
	Gzip               any // Gzip配置(v0.3.2弃用)
	Compression        any // 压缩配置
	Cache              any // 缓存配置
	Firewall           any // 防火墙设置
	Locations          any // 路由规则配置
	Websocket          any // Websocket设置
	RewriteRules       any // 重写规则配置
	HostRedirects      any // 域名跳转
	Fastcgi            any // Fastcgi配置
	Auth               any // 认证策略配置
	Webp               any // WebP配置
	RemoteAddr         any // 客户端IP配置
	MergeSlashes       any // 是否合并路径中的斜杠
	RequestLimit       any // 请求限制
	RequestScripts     any // 请求脚本
	Uam                any // UAM设置
	Referers           any // 防盗链设置
}

func NewHTTPWebOperator

func NewHTTPWebOperator() *HTTPWebOperator

type HTTPWebsocket

type HTTPWebsocket struct {
	Id                uint32   `field:"id"`                // ID
	AdminId           uint32   `field:"adminId"`           // 管理员ID
	UserId            uint32   `field:"userId"`            // 用户ID
	CreatedAt         uint64   `field:"createdAt"`         // 创建时间
	State             uint8    `field:"state"`             // 状态
	IsOn              bool     `field:"isOn"`              // 是否启用
	HandshakeTimeout  dbs.JSON `field:"handshakeTimeout"`  // 握手超时时间
	AllowAllOrigins   uint8    `field:"allowAllOrigins"`   // 是否支持所有源
	AllowedOrigins    dbs.JSON `field:"allowedOrigins"`    // 支持的源域名列表
	RequestSameOrigin uint8    `field:"requestSameOrigin"` // 是否请求一样的Origin
	RequestOrigin     string   `field:"requestOrigin"`     // 请求Origin
}

Websocket设置

type HTTPWebsocketDAO

type HTTPWebsocketDAO dbs.DAO
var SharedHTTPWebsocketDAO *HTTPWebsocketDAO

func NewHTTPWebsocketDAO

func NewHTTPWebsocketDAO() *HTTPWebsocketDAO

func (*HTTPWebsocketDAO) ComposeWebsocketConfig

func (this *HTTPWebsocketDAO) ComposeWebsocketConfig(tx *dbs.Tx, websocketId int64) (*serverconfigs.HTTPWebsocketConfig, error)

ComposeWebsocketConfig 组合配置

func (*HTTPWebsocketDAO) CreateWebsocket

func (this *HTTPWebsocketDAO) CreateWebsocket(tx *dbs.Tx, handshakeTimeoutJSON []byte, allowAllOrigins bool, allowedOrigins []string, requestSameOrigin bool, requestOrigin string) (websocketId int64, err error)

CreateWebsocket 创建Websocket配置

func (*HTTPWebsocketDAO) DisableHTTPWebsocket

func (this *HTTPWebsocketDAO) DisableHTTPWebsocket(tx *dbs.Tx, websocketId int64) error

DisableHTTPWebsocket 禁用条目

func (*HTTPWebsocketDAO) EnableHTTPWebsocket

func (this *HTTPWebsocketDAO) EnableHTTPWebsocket(tx *dbs.Tx, id int64) error

EnableHTTPWebsocket 启用条目

func (*HTTPWebsocketDAO) FindEnabledHTTPWebsocket

func (this *HTTPWebsocketDAO) FindEnabledHTTPWebsocket(tx *dbs.Tx, id int64) (*HTTPWebsocket, error)

FindEnabledHTTPWebsocket 查找启用中的条目

func (*HTTPWebsocketDAO) NotifyUpdate

func (this *HTTPWebsocketDAO) NotifyUpdate(tx *dbs.Tx, websocketId int64) error

NotifyUpdate 通知更新

func (*HTTPWebsocketDAO) UpdateWebsocket

func (this *HTTPWebsocketDAO) UpdateWebsocket(tx *dbs.Tx, websocketId int64, handshakeTimeoutJSON []byte, allowAllOrigins bool, allowedOrigins []string, requestSameOrigin bool, requestOrigin string) error

UpdateWebsocket 修改Websocket配置

type HTTPWebsocketOperator

type HTTPWebsocketOperator struct {
	Id                interface{} // ID
	AdminId           interface{} // 管理员ID
	UserId            interface{} // 用户ID
	CreatedAt         interface{} // 创建时间
	State             interface{} // 状态
	IsOn              interface{} // 是否启用
	HandshakeTimeout  interface{} // 握手超时时间
	AllowAllOrigins   interface{} // 是否支持所有源
	AllowedOrigins    interface{} // 支持的源域名列表
	RequestSameOrigin interface{} // 是否请求一样的Origin
	RequestOrigin     interface{} // 请求Origin
}

func NewHTTPWebsocketOperator

func NewHTTPWebsocketOperator() *HTTPWebsocketOperator

type IPItem

type IPItem struct {
	Id                            uint64 `field:"id"`                            // ID
	ListId                        uint32 `field:"listId"`                        // 所属名单ID
	Type                          string `field:"type"`                          // 类型
	IpFrom                        string `field:"ipFrom"`                        // 开始IP
	IpTo                          string `field:"ipTo"`                          // 结束IP
	IpFromLong                    uint64 `field:"ipFromLong"`                    // 开始IP整型
	IpToLong                      uint64 `field:"ipToLong"`                      // 结束IP整型
	Version                       uint64 `field:"version"`                       // 版本
	CreatedAt                     uint64 `field:"createdAt"`                     // 创建时间
	UpdatedAt                     uint64 `field:"updatedAt"`                     // 修改时间
	Reason                        string `field:"reason"`                        // 加入说明
	EventLevel                    string `field:"eventLevel"`                    // 事件级别
	State                         uint8  `field:"state"`                         // 状态
	ExpiredAt                     uint64 `field:"expiredAt"`                     // 过期时间
	ServerId                      uint32 `field:"serverId"`                      // 有效范围服务ID
	NodeId                        uint32 `field:"nodeId"`                        // 有效范围节点ID
	SourceNodeId                  uint32 `field:"sourceNodeId"`                  // 来源节点ID
	SourceServerId                uint32 `field:"sourceServerId"`                // 来源服务ID
	SourceHTTPFirewallPolicyId    uint32 `field:"sourceHTTPFirewallPolicyId"`    // 来源策略ID
	SourceHTTPFirewallRuleGroupId uint32 `field:"sourceHTTPFirewallRuleGroupId"` // 来源规则集分组ID
	SourceHTTPFirewallRuleSetId   uint32 `field:"sourceHTTPFirewallRuleSetId"`   // 来源规则集ID
	IsRead                        bool   `field:"isRead"`                        // 是否已读
}

IPItem IP

type IPItemDAO

type IPItemDAO dbs.DAO
var SharedIPItemDAO *IPItemDAO

func NewIPItemDAO

func NewIPItemDAO() *IPItemDAO

func (*IPItemDAO) CleanExpiredIPItems

func (this *IPItemDAO) CleanExpiredIPItems(tx *dbs.Tx) error

CleanExpiredIPItems 清除过期数据

func (*IPItemDAO) CountAllEnabledIPItems

func (this *IPItemDAO) CountAllEnabledIPItems(tx *dbs.Tx, ip string, listId int64, unread bool, eventLevel string, listType string) (int64, error)

CountAllEnabledIPItems 计算数量

func (*IPItemDAO) CountIPItemsWithListId

func (this *IPItemDAO) CountIPItemsWithListId(tx *dbs.Tx, listId int64, ipFrom string, ipTo string, keyword string, eventLevel string) (int64, error)

CountIPItemsWithListId 计算IP数量

func (*IPItemDAO) CreateIPItem

func (this *IPItemDAO) CreateIPItem(tx *dbs.Tx,
	listId int64,
	ipFrom string,
	ipTo string,
	expiredAt int64,
	reason string,
	itemType IPItemType,
	eventLevel string,
	nodeId int64,
	serverId int64,
	sourceNodeId int64,
	sourceServerId int64,
	sourceHTTPFirewallPolicyId int64,
	sourceHTTPFirewallRuleGroupId int64,
	sourceHTTPFirewallRuleSetId int64) (int64, error)

CreateIPItem 创建IP

func (*IPItemDAO) DeleteOldItem

func (this *IPItemDAO) DeleteOldItem(tx *dbs.Tx, listId int64, ipFrom string, ipTo string) error

DeleteOldItem 根据IP删除以前的旧记录

func (*IPItemDAO) DisableIPItem

func (this *IPItemDAO) DisableIPItem(tx *dbs.Tx, id int64) error

DisableIPItem 禁用条目

func (*IPItemDAO) DisableIPItemsWithIP

func (this *IPItemDAO) DisableIPItemsWithIP(tx *dbs.Tx, ipFrom string, ipTo string, userId int64, listId int64) error

DisableIPItemsWithIP 禁用某个IP相关条目

func (*IPItemDAO) DisableIPItemsWithListId

func (this *IPItemDAO) DisableIPItemsWithListId(tx *dbs.Tx, listId int64) error

DisableIPItemsWithListId 禁用某个IP名单内的所有IP

func (*IPItemDAO) EnableIPItem

func (this *IPItemDAO) EnableIPItem(tx *dbs.Tx, id int64) error

EnableIPItem 启用条目

func (*IPItemDAO) ExistsEnabledItem

func (this *IPItemDAO) ExistsEnabledItem(tx *dbs.Tx, itemId int64) (bool, error)

ExistsEnabledItem 检查IP是否存在

func (*IPItemDAO) FindEnabledIPItem

func (this *IPItemDAO) FindEnabledIPItem(tx *dbs.Tx, id int64) (*IPItem, error)

FindEnabledIPItem 查找启用中的条目

func (*IPItemDAO) FindEnabledItemContainsIP

func (this *IPItemDAO) FindEnabledItemContainsIP(tx *dbs.Tx, listId int64, ip uint64) (*IPItem, error)

FindEnabledItemContainsIP 查找包含某个IP的Item

func (*IPItemDAO) FindEnabledItemsWithIP

func (this *IPItemDAO) FindEnabledItemsWithIP(tx *dbs.Tx, ip string) (result []*IPItem, err error)

FindEnabledItemsWithIP 根据IP查找Item

func (*IPItemDAO) FindItemListId

func (this *IPItemDAO) FindItemListId(tx *dbs.Tx, itemId int64) (int64, error)

FindItemListId 查找IPItem对应的列表ID

func (*IPItemDAO) ListAllEnabledIPItems

func (this *IPItemDAO) ListAllEnabledIPItems(tx *dbs.Tx, ip string, listId int64, unread bool, eventLevel string, listType string, offset int64, size int64) (result []*IPItem, err error)

ListAllEnabledIPItems 搜索所有IP

func (*IPItemDAO) ListIPItemsAfterVersion

func (this *IPItemDAO) ListIPItemsAfterVersion(tx *dbs.Tx, version int64, size int64) (result []*IPItem, err error)

ListIPItemsAfterVersion 根据版本号查找IP列表

func (*IPItemDAO) ListIPItemsWithListId

func (this *IPItemDAO) ListIPItemsWithListId(tx *dbs.Tx, listId int64, keyword string, ipFrom string, ipTo string, eventLevel string, offset int64, size int64) (result []*IPItem, err error)

ListIPItemsWithListId 查找IP列表

func (*IPItemDAO) NotifyUpdate

func (this *IPItemDAO) NotifyUpdate(tx *dbs.Tx, itemId int64) error

NotifyUpdate 通知更新

func (*IPItemDAO) UpdateIPItem

func (this *IPItemDAO) UpdateIPItem(tx *dbs.Tx, itemId int64, ipFrom string, ipTo string, expiredAt int64, reason string, itemType IPItemType, eventLevel string) error

UpdateIPItem 修改IP

func (*IPItemDAO) UpdateItemsRead

func (this *IPItemDAO) UpdateItemsRead(tx *dbs.Tx) error

UpdateItemsRead 设置所有未已读

type IPItemOperator

type IPItemOperator struct {
	Id                            interface{} // ID
	ListId                        interface{} // 所属名单ID
	Type                          interface{} // 类型
	IpFrom                        interface{} // 开始IP
	IpTo                          interface{} // 结束IP
	IpFromLong                    interface{} // 开始IP整型
	IpToLong                      interface{} // 结束IP整型
	Version                       interface{} // 版本
	CreatedAt                     interface{} // 创建时间
	UpdatedAt                     interface{} // 修改时间
	Reason                        interface{} // 加入说明
	EventLevel                    interface{} // 事件级别
	State                         interface{} // 状态
	ExpiredAt                     interface{} // 过期时间
	ServerId                      interface{} // 有效范围服务ID
	NodeId                        interface{} // 有效范围节点ID
	SourceNodeId                  interface{} // 来源节点ID
	SourceServerId                interface{} // 来源服务ID
	SourceHTTPFirewallPolicyId    interface{} // 来源策略ID
	SourceHTTPFirewallRuleGroupId interface{} // 来源规则集分组ID
	SourceHTTPFirewallRuleSetId   interface{} // 来源规则集ID
	IsRead                        interface{} // 是否已读
}

func NewIPItemOperator

func NewIPItemOperator() *IPItemOperator

type IPItemType

type IPItemType = string
const (
	IPItemTypeIPv4 IPItemType = "ipv4" // IPv4
	IPItemTypeIPv6 IPItemType = "ipv6" // IPv6
	IPItemTypeAll  IPItemType = "all"  // 所有IP
)

type IPLibrary

type IPLibrary struct {
	Id        uint32 `field:"id"`        // ID
	AdminId   uint32 `field:"adminId"`   // 管理员ID
	FileId    uint32 `field:"fileId"`    // 文件ID
	Type      string `field:"type"`      // 类型
	Name      string `field:"name"`      // 名称
	IsPublic  bool   `field:"isPublic"`  // 是否公用
	State     uint8  `field:"state"`     // 状态
	CreatedAt uint64 `field:"createdAt"` // 创建时间
}

IPLibrary IP库

type IPLibraryArtifact added in v0.5.2

type IPLibraryArtifact struct {
	Id            uint32   `field:"id"`            // ID
	Name          string   `field:"name"`          // 名称
	FileId        uint64   `field:"fileId"`        // 文件ID
	LibraryFileId uint32   `field:"libraryFileId"` // IP库文件ID
	CreatedAt     uint64   `field:"createdAt"`     // 创建时间
	Meta          dbs.JSON `field:"meta"`          // 元数据
	IsPublic      bool     `field:"isPublic"`      // 是否为公用
	Code          string   `field:"code"`          // 代号
	State         uint8    `field:"state"`         // 状态
}

IPLibraryArtifact IP库制品

type IPLibraryArtifactDAO added in v0.5.2

type IPLibraryArtifactDAO dbs.DAO
var SharedIPLibraryArtifactDAO *IPLibraryArtifactDAO

func NewIPLibraryArtifactDAO added in v0.5.2

func NewIPLibraryArtifactDAO() *IPLibraryArtifactDAO

func (*IPLibraryArtifactDAO) CreateArtifact added in v0.5.2

func (this *IPLibraryArtifactDAO) CreateArtifact(tx *dbs.Tx, name string, fileId int64, libraryFileId int64, meta *iplibrary.Meta) (int64, error)

CreateArtifact 创建制品

func (*IPLibraryArtifactDAO) DisableIPLibraryArtifact added in v0.5.2

func (this *IPLibraryArtifactDAO) DisableIPLibraryArtifact(tx *dbs.Tx, id int64) error

DisableIPLibraryArtifact 禁用条目

func (*IPLibraryArtifactDAO) EnableIPLibraryArtifact added in v0.5.2

func (this *IPLibraryArtifactDAO) EnableIPLibraryArtifact(tx *dbs.Tx, id int64) error

EnableIPLibraryArtifact 启用条目

func (*IPLibraryArtifactDAO) FindAllArtifacts added in v0.5.2

func (this *IPLibraryArtifactDAO) FindAllArtifacts(tx *dbs.Tx) (result []*IPLibraryArtifact, err error)

FindAllArtifacts 查找制品列表

func (*IPLibraryArtifactDAO) FindEnabledIPLibraryArtifact added in v0.5.2

func (this *IPLibraryArtifactDAO) FindEnabledIPLibraryArtifact(tx *dbs.Tx, id int64) (*IPLibraryArtifact, error)

FindEnabledIPLibraryArtifact 查找启用中的条目

func (*IPLibraryArtifactDAO) FindPublicArtifact added in v0.5.2

func (this *IPLibraryArtifactDAO) FindPublicArtifact(tx *dbs.Tx) (*IPLibraryArtifact, error)

FindPublicArtifact 查找当前使用的制品

func (*IPLibraryArtifactDAO) UpdateArtifactPublic added in v0.5.2

func (this *IPLibraryArtifactDAO) UpdateArtifactPublic(tx *dbs.Tx, artifactId int64, isPublic bool) error

UpdateArtifactPublic 使用某个制品

type IPLibraryArtifactOperator added in v0.5.2

type IPLibraryArtifactOperator struct {
	Id            any // ID
	Name          any // 名称
	FileId        any // 文件ID
	LibraryFileId any // IP库文件ID
	CreatedAt     any // 创建时间
	Meta          any // 元数据
	IsPublic      any // 是否为公用
	Code          any // 代号
	State         any // 状态
}

func NewIPLibraryArtifactOperator added in v0.5.2

func NewIPLibraryArtifactOperator() *IPLibraryArtifactOperator

type IPLibraryDAO

type IPLibraryDAO dbs.DAO
var SharedIPLibraryDAO *IPLibraryDAO

func NewIPLibraryDAO

func NewIPLibraryDAO() *IPLibraryDAO

func (*IPLibraryDAO) CreateIPLibrary

func (this *IPLibraryDAO) CreateIPLibrary(tx *dbs.Tx, libraryType string, fileId int64) (int64, error)

CreateIPLibrary 创建新的IP库

func (*IPLibraryDAO) DisableIPLibrary

func (this *IPLibraryDAO) DisableIPLibrary(tx *dbs.Tx, id int64) error

DisableIPLibrary 禁用条目

func (*IPLibraryDAO) EnableIPLibrary

func (this *IPLibraryDAO) EnableIPLibrary(tx *dbs.Tx, id int64) error

EnableIPLibrary 启用条目

func (*IPLibraryDAO) FindAllEnabledIPLibrariesWithType

func (this *IPLibraryDAO) FindAllEnabledIPLibrariesWithType(tx *dbs.Tx, libraryType string) (result []*IPLibrary, err error)

FindAllEnabledIPLibrariesWithType 查找某个类型的IP库列表

func (*IPLibraryDAO) FindEnabledIPLibrary

func (this *IPLibraryDAO) FindEnabledIPLibrary(tx *dbs.Tx, id int64) (*IPLibrary, error)

FindEnabledIPLibrary 查找启用中的条目

func (*IPLibraryDAO) FindLatestIPLibraryWithType

func (this *IPLibraryDAO) FindLatestIPLibraryWithType(tx *dbs.Tx, libraryType string) (*IPLibrary, error)

FindLatestIPLibraryWithType 查找某个类型的最新的IP库

type IPLibraryFile added in v0.5.0

type IPLibraryFile struct {
	Id              uint64   `field:"id"`              // ID
	Name            string   `field:"name"`            // IP库名称
	FileId          uint64   `field:"fileId"`          // 原始文件ID
	Template        string   `field:"template"`        // 模板
	EmptyValues     dbs.JSON `field:"emptyValues"`     // 空值列表
	GeneratedFileId uint64   `field:"generatedFileId"` // 生成的文件ID
	GeneratedAt     uint64   `field:"generatedAt"`     // 生成时间
	IsFinished      bool     `field:"isFinished"`      // 是否已经完成
	Countries       dbs.JSON `field:"countries"`       // 国家/地区
	Provinces       dbs.JSON `field:"provinces"`       // 省份
	Cities          dbs.JSON `field:"cities"`          // 城市
	Towns           dbs.JSON `field:"towns"`           // 区县
	Providers       dbs.JSON `field:"providers"`       // ISP服务商
	Code            string   `field:"code"`            // 文件代号
	CreatedAt       uint64   `field:"createdAt"`       // 上传时间
	State           uint8    `field:"state"`           // 状态
}

IPLibraryFile IP库上传的文件

func (*IPLibraryFile) DecodeCities added in v0.5.0

func (this *IPLibraryFile) DecodeCities() [][3]string

func (*IPLibraryFile) DecodeCountries added in v0.5.0

func (this *IPLibraryFile) DecodeCountries() []string

func (*IPLibraryFile) DecodeEmptyValues added in v0.5.0

func (this *IPLibraryFile) DecodeEmptyValues() []string

func (*IPLibraryFile) DecodeProviders added in v0.5.0

func (this *IPLibraryFile) DecodeProviders() []string

func (*IPLibraryFile) DecodeProvinces added in v0.5.0

func (this *IPLibraryFile) DecodeProvinces() [][2]string

func (*IPLibraryFile) DecodeTowns added in v0.5.0

func (this *IPLibraryFile) DecodeTowns() [][4]string

type IPLibraryFileDAO added in v0.5.0

type IPLibraryFileDAO dbs.DAO
var SharedIPLibraryFileDAO *IPLibraryFileDAO

func NewIPLibraryFileDAO added in v0.5.0

func NewIPLibraryFileDAO() *IPLibraryFileDAO

func (*IPLibraryFileDAO) CreateLibraryFile added in v0.5.0

func (this *IPLibraryFileDAO) CreateLibraryFile(tx *dbs.Tx, name string, template string, emptyValues []string, fileId int64, countries []string, provinces [][2]string, cities [][3]string, towns [][4]string, providers []string) (int64, error)

CreateLibraryFile 创建文件

func (*IPLibraryFileDAO) DisableIPLibraryFile added in v0.5.0

func (this *IPLibraryFileDAO) DisableIPLibraryFile(tx *dbs.Tx, id int64) error

DisableIPLibraryFile 禁用条目

func (*IPLibraryFileDAO) EnableIPLibraryFile added in v0.5.0

func (this *IPLibraryFileDAO) EnableIPLibraryFile(tx *dbs.Tx, id uint64) error

EnableIPLibraryFile 启用条目

func (*IPLibraryFileDAO) FindAllFinishedLibraryFiles added in v0.5.2

func (this *IPLibraryFileDAO) FindAllFinishedLibraryFiles(tx *dbs.Tx) (result []*IPLibraryFile, err error)

FindAllFinishedLibraryFiles 查找所有已完成的文件

func (*IPLibraryFileDAO) FindAllUnfinishedLibraryFiles added in v0.5.0

func (this *IPLibraryFileDAO) FindAllUnfinishedLibraryFiles(tx *dbs.Tx) (result []*IPLibraryFile, err error)

FindAllUnfinishedLibraryFiles 查找所有未完成的文件

func (*IPLibraryFileDAO) FindEnabledIPLibraryFile added in v0.5.0

func (this *IPLibraryFileDAO) FindEnabledIPLibraryFile(tx *dbs.Tx, id int64) (*IPLibraryFile, error)

FindEnabledIPLibraryFile 查找启用中的条目

func (*IPLibraryFileDAO) FindLibraryFileCities added in v0.5.0

func (this *IPLibraryFileDAO) FindLibraryFileCities(tx *dbs.Tx, fileId int64) ([][3]string, error)

FindLibraryFileCities 获取IP库中的城市

func (*IPLibraryFileDAO) FindLibraryFileCountries added in v0.5.0

func (this *IPLibraryFileDAO) FindLibraryFileCountries(tx *dbs.Tx, fileId int64) ([]string, error)

FindLibraryFileCountries 获取IP库中的国家/地区

func (*IPLibraryFileDAO) FindLibraryFileProviders added in v0.5.0

func (this *IPLibraryFileDAO) FindLibraryFileProviders(tx *dbs.Tx, fileId int64) ([]string, error)

FindLibraryFileProviders 获取IP库中的ISP运营商

func (*IPLibraryFileDAO) FindLibraryFileProvinces added in v0.5.0

func (this *IPLibraryFileDAO) FindLibraryFileProvinces(tx *dbs.Tx, fileId int64) ([][2]string, error)

FindLibraryFileProvinces 获取IP库中的省份

func (*IPLibraryFileDAO) FindLibraryFileTowns added in v0.5.0

func (this *IPLibraryFileDAO) FindLibraryFileTowns(tx *dbs.Tx, fileId int64) ([][4]string, error)

FindLibraryFileTowns 获取IP库中的区县

func (*IPLibraryFileDAO) GenerateIPLibrary added in v0.5.0

func (this *IPLibraryFileDAO) GenerateIPLibrary(tx *dbs.Tx, libraryFileId int64) error

func (*IPLibraryFileDAO) UpdateLibraryFileIsFinished added in v0.5.0

func (this *IPLibraryFileDAO) UpdateLibraryFileIsFinished(tx *dbs.Tx, fileId int64) error

UpdateLibraryFileIsFinished 设置文件为已完成

type IPLibraryFileOperator added in v0.5.0

type IPLibraryFileOperator struct {
	Id              any // ID
	Name            any // IP库名称
	FileId          any // 原始文件ID
	Template        any // 模板
	EmptyValues     any // 空值列表
	GeneratedFileId any // 生成的文件ID
	GeneratedAt     any // 生成时间
	IsFinished      any // 是否已经完成
	Countries       any // 国家/地区
	Provinces       any // 省份
	Cities          any // 城市
	Towns           any // 区县
	Providers       any // ISP服务商
	Code            any // 文件代号
	CreatedAt       any // 上传时间
	State           any // 状态
}

func NewIPLibraryFileOperator added in v0.5.0

func NewIPLibraryFileOperator() *IPLibraryFileOperator

type IPLibraryOperator

type IPLibraryOperator struct {
	Id        any // ID
	AdminId   any // 管理员ID
	FileId    any // 文件ID
	Type      any // 类型
	Name      any // 名称
	IsPublic  any // 是否公用
	State     any // 状态
	CreatedAt any // 创建时间
}

func NewIPLibraryOperator

func NewIPLibraryOperator() *IPLibraryOperator

type IPList

type IPList struct {
	Id          uint32   `field:"id"`          // ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	Type        string   `field:"type"`        // 类型
	AdminId     uint32   `field:"adminId"`     // 用户ID
	UserId      uint32   `field:"userId"`      // 用户ID
	ServerId    uint64   `field:"serverId"`    // 服务ID
	Name        string   `field:"name"`        // 列表名
	Code        string   `field:"code"`        // 代号
	State       uint8    `field:"state"`       // 状态
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	Timeout     dbs.JSON `field:"timeout"`     // 默认超时时间
	Actions     dbs.JSON `field:"actions"`     // IP触发的动作
	Description string   `field:"description"` // 描述
	IsPublic    bool     `field:"isPublic"`    // 是否公用
	IsGlobal    bool     `field:"isGlobal"`    // 是否全局
}

IPList IP名单

type IPListDAO

type IPListDAO dbs.DAO
var SharedIPListDAO *IPListDAO

func NewIPListDAO

func NewIPListDAO() *IPListDAO

func (*IPListDAO) CheckUserIPList

func (this *IPListDAO) CheckUserIPList(tx *dbs.Tx, userId int64, listId int64) error

CheckUserIPList 检查用户权限

func (*IPListDAO) CountAllEnabledIPLists

func (this *IPListDAO) CountAllEnabledIPLists(tx *dbs.Tx, listType string, isPublic bool, keyword string) (int64, error)

CountAllEnabledIPLists 计算名单数量

func (*IPListDAO) CreateIPList

func (this *IPListDAO) CreateIPList(tx *dbs.Tx, userId int64, serverId int64, listType ipconfigs.IPListType, name string, code string, timeoutJSON []byte, description string, isPublic bool, isGlobal bool) (int64, error)

CreateIPList 创建名单

func (*IPListDAO) DisableIPList

func (this *IPListDAO) DisableIPList(tx *dbs.Tx, id int64) error

DisableIPList 禁用条目

func (*IPListDAO) EnableIPList

func (this *IPListDAO) EnableIPList(tx *dbs.Tx, id int64) error

EnableIPList 启用条目

func (*IPListDAO) ExistsEnabledIPList

func (this *IPListDAO) ExistsEnabledIPList(tx *dbs.Tx, listId int64) (bool, error)

ExistsEnabledIPList 检查IP名单是否存在

func (*IPListDAO) FindEnabledIPList

func (this *IPListDAO) FindEnabledIPList(tx *dbs.Tx, id int64, cacheMap *utils.CacheMap) (*IPList, error)

FindEnabledIPList 查找启用中的条目

func (*IPListDAO) FindIPListCacheable

func (this *IPListDAO) FindIPListCacheable(tx *dbs.Tx, listId int64) (*IPList, error)

FindIPListCacheable 获取名单

func (*IPListDAO) FindIPListName

func (this *IPListDAO) FindIPListName(tx *dbs.Tx, id int64) (string, error)

FindIPListName 根据主键查找名称

func (*IPListDAO) IncreaseVersion

func (this *IPListDAO) IncreaseVersion(tx *dbs.Tx) (int64, error)

IncreaseVersion 增加版本

func (*IPListDAO) ListEnabledIPLists

func (this *IPListDAO) ListEnabledIPLists(tx *dbs.Tx, listType string, isPublic bool, keyword string, offset int64, size int64) (result []*IPList, err error)

ListEnabledIPLists 列出单页名单

func (*IPListDAO) NotifyUpdate

func (this *IPListDAO) NotifyUpdate(tx *dbs.Tx, listId int64, taskType NodeTaskType) error

NotifyUpdate 通知更新

func (*IPListDAO) UpdateIPList

func (this *IPListDAO) UpdateIPList(tx *dbs.Tx, listId int64, name string, code string, timeoutJSON []byte, description string) error

UpdateIPList 修改名单

type IPListOperator

type IPListOperator struct {
	Id          interface{} // ID
	IsOn        interface{} // 是否启用
	Type        interface{} // 类型
	AdminId     interface{} // 用户ID
	UserId      interface{} // 用户ID
	ServerId    interface{} // 服务ID
	Name        interface{} // 列表名
	Code        interface{} // 代号
	State       interface{} // 状态
	CreatedAt   interface{} // 创建时间
	Timeout     interface{} // 默认超时时间
	Actions     interface{} // IP触发的动作
	Description interface{} // 描述
	IsPublic    interface{} // 是否公用
	IsGlobal    interface{} // 是否全局
}

func NewIPListOperator

func NewIPListOperator() *IPListOperator

type LatestItem

type LatestItem struct {
	Id        uint64 `field:"id"`        // ID
	ItemType  string `field:"itemType"`  // Item类型
	ItemId    uint64 `field:"itemId"`    // itemID
	Count     uint64 `field:"count"`     // 数量
	UpdatedAt uint64 `field:"updatedAt"` // 更新时间
}

LatestItem 最近的条目统计

type LatestItemDAO

type LatestItemDAO dbs.DAO
var SharedLatestItemDAO *LatestItemDAO

func NewLatestItemDAO

func NewLatestItemDAO() *LatestItemDAO

func (*LatestItemDAO) IncreaseItemCount

func (this *LatestItemDAO) IncreaseItemCount(tx *dbs.Tx, itemType LatestItemType, itemId int64) error

IncreaseItemCount 增加数量

type LatestItemOperator

type LatestItemOperator struct {
	Id        interface{} // ID
	ItemType  interface{} // Item类型
	ItemId    interface{} // itemID
	Count     interface{} // 数量
	UpdatedAt interface{} // 更新时间
}

func NewLatestItemOperator

func NewLatestItemOperator() *LatestItemOperator

type LatestItemType

type LatestItemType = string
const (
	LatestItemTypeCluster LatestItemType = "cluster"
	LatestItemTypeServer  LatestItemType = "server"
)

type Log

type Log struct {
	Id          uint32 `field:"id"`          // ID
	Level       string `field:"level"`       // 级别
	Description string `field:"description"` // 描述
	CreatedAt   uint64 `field:"createdAt"`   // 创建时间
	Action      string `field:"action"`      // 动作
	UserId      uint32 `field:"userId"`      // 用户ID
	AdminId     uint32 `field:"adminId"`     // 管理员ID
	ProviderId  uint32 `field:"providerId"`  // 供应商ID
	Ip          string `field:"ip"`          // IP地址
	Type        string `field:"type"`        // 类型:admin, user
	Day         string `field:"day"`         // 日期
	BillId      uint32 `field:"billId"`      // 账单ID
}

操作日志

type LogDAO

type LogDAO dbs.DAO
var SharedLogDAO *LogDAO

func NewLogDAO

func NewLogDAO() *LogDAO

func (*LogDAO) CountLogs

func (this *LogDAO) CountLogs(tx *dbs.Tx, dayFrom string, dayTo string, keyword string, userType string) (int64, error)

CountLogs 计算所有日志数量

func (*LogDAO) CreateLog

func (this *LogDAO) CreateLog(tx *dbs.Tx, adminType string, adminId int64, level string, description string, action string, ip string) error

CreateLog 创建管理员日志

func (*LogDAO) DeleteAllLogsPermanently

func (this *LogDAO) DeleteAllLogsPermanently(tx *dbs.Tx) error

DeleteAllLogsPermanently 物理删除所有日志

func (*LogDAO) DeleteLogPermanently

func (this *LogDAO) DeleteLogPermanently(tx *dbs.Tx, logId int64) error

DeleteLogPermanently 物理删除日志

func (*LogDAO) DeleteLogsPermanentlyBeforeDays

func (this *LogDAO) DeleteLogsPermanentlyBeforeDays(tx *dbs.Tx, days int) error

DeleteLogsPermanentlyBeforeDays 物理删除某些天之前的日志

func (*LogDAO) ListLogs

func (this *LogDAO) ListLogs(tx *dbs.Tx, offset int64, size int64, dayFrom string, dayTo string, keyword string, userType string) (result []*Log, err error)

ListLogs 列出单页日志

func (*LogDAO) SumLogsSize

func (this *LogDAO) SumLogsSize() (int64, error)

SumLogsSize 计算当前日志容量大小

type LogOperator

type LogOperator struct {
	Id          interface{} // ID
	Level       interface{} // 级别
	Description interface{} // 描述
	CreatedAt   interface{} // 创建时间
	Action      interface{} // 动作
	UserId      interface{} // 用户ID
	AdminId     interface{} // 管理员ID
	ProviderId  interface{} // 供应商ID
	Ip          interface{} // IP地址
	Type        interface{} // 类型:admin, user
	Day         interface{} // 日期
	BillId      interface{} // 账单ID
}

func NewLogOperator

func NewLogOperator() *LogOperator

type Login

type Login struct {
	Id      uint32   `field:"id"`      // ID
	AdminId uint32   `field:"adminId"` // 管理员ID
	UserId  uint32   `field:"userId"`  // 用户ID
	IsOn    bool     `field:"isOn"`    // 是否启用
	Type    string   `field:"type"`    // 认证方式
	Params  dbs.JSON `field:"params"`  // 参数
	State   uint8    `field:"state"`   // 状态
}

Login 第三方登录认证

type LoginDAO

type LoginDAO dbs.DAO
var SharedLoginDAO *LoginDAO

func NewLoginDAO

func NewLoginDAO() *LoginDAO

func (*LoginDAO) CheckLoginIsOn

func (this *LoginDAO) CheckLoginIsOn(tx *dbs.Tx, adminId int64, userId int64, loginType LoginType) (bool, error)

CheckLoginIsOn 检查某个认证是否启用

func (*LoginDAO) CreateLogin

func (this *LoginDAO) CreateLogin(tx *dbs.Tx, Id int64, loginType LoginType, params maps.Map) (int64, error)

CreateLogin 创建认证

func (*LoginDAO) DisableLogin

func (this *LoginDAO) DisableLogin(tx *dbs.Tx, id int64) error

DisableLogin 禁用条目

func (*LoginDAO) DisableLoginWithType added in v0.4.10

func (this *LoginDAO) DisableLoginWithType(tx *dbs.Tx, adminId int64, userId int64, loginType LoginType) error

DisableLoginWithType 禁用相关认证

func (*LoginDAO) EnableLogin

func (this *LoginDAO) EnableLogin(tx *dbs.Tx, id int64) error

EnableLogin 启用条目

func (*LoginDAO) FindEnabledLogin

func (this *LoginDAO) FindEnabledLogin(tx *dbs.Tx, id int64) (*Login, error)

FindEnabledLogin 查找启用中的条目

func (*LoginDAO) FindEnabledLoginWithType added in v0.4.10

func (this *LoginDAO) FindEnabledLoginWithType(tx *dbs.Tx, adminId int64, userId int64, loginType LoginType) (*Login, error)

FindEnabledLoginWithType 查找管理员和用户相关的认证

func (*LoginDAO) UpdateLogin

func (this *LoginDAO) UpdateLogin(tx *dbs.Tx, adminId int64, userId int64, loginType LoginType, params maps.Map, isOn bool) error

UpdateLogin 修改认证

type LoginOperator

type LoginOperator struct {
	Id      interface{} // ID
	AdminId interface{} // 管理员ID
	UserId  interface{} // 用户ID
	IsOn    interface{} // 是否启用
	Type    interface{} // 认证方式
	Params  interface{} // 参数
	State   interface{} // 状态
}

func NewLoginOperator

func NewLoginOperator() *LoginOperator

type LoginType

type LoginType = string
const (
	LoginTypeOTP LoginType = "otp"
)

type Message

type Message struct {
	Id        uint64   `field:"id"`        // ID
	AdminId   uint32   `field:"adminId"`   // 管理员ID
	UserId    uint32   `field:"userId"`    // 用户ID
	Role      string   `field:"role"`      // 角色
	ClusterId uint32   `field:"clusterId"` // 集群ID
	NodeId    uint32   `field:"nodeId"`    // 节点ID
	Level     string   `field:"level"`     // 级别
	Subject   string   `field:"subject"`   // 标题
	Body      string   `field:"body"`      // 内容
	Type      string   `field:"type"`      // 消息类型
	Params    dbs.JSON `field:"params"`    // 额外的参数
	IsRead    bool     `field:"isRead"`    // 是否已读
	State     uint8    `field:"state"`     // 状态
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	Day       string   `field:"day"`       // 日期YYYYMMDD
	Hash      string   `field:"hash"`      // 消息内容的Hash
}

Message 消息通知

type MessageDAO

type MessageDAO dbs.DAO
var SharedMessageDAO *MessageDAO

func NewMessageDAO

func NewMessageDAO() *MessageDAO

func (*MessageDAO) CheckMessageUser

func (this *MessageDAO) CheckMessageUser(tx *dbs.Tx, messageId int64, adminId int64, userId int64) (bool, error)

CheckMessageUser 检查消息权限

func (*MessageDAO) CountUnreadMessages

func (this *MessageDAO) CountUnreadMessages(tx *dbs.Tx, adminId int64, userId int64) (int64, error)

CountUnreadMessages 计算未读消息数量

func (*MessageDAO) CreateClusterMessage

func (this *MessageDAO) CreateClusterMessage(tx *dbs.Tx, role string, clusterId int64, messageType MessageType, level string, subject string, body string, paramsJSON []byte) error

CreateClusterMessage 创建集群消息

func (*MessageDAO) CreateMessage

func (this *MessageDAO) CreateMessage(tx *dbs.Tx, adminId int64, userId int64, messageType MessageType, level string, subject string, body string, paramsJSON []byte) error

CreateMessage 创建普通消息

func (*MessageDAO) CreateNodeMessage

func (this *MessageDAO) CreateNodeMessage(tx *dbs.Tx, role string, clusterId int64, nodeId int64, messageType MessageType, level string, subject string, body string, paramsJSON []byte, force bool) error

CreateNodeMessage 创建节点消息

func (*MessageDAO) DeleteMessagesBeforeDay

func (this *MessageDAO) DeleteMessagesBeforeDay(tx *dbs.Tx, dayTime time.Time) error

DeleteMessagesBeforeDay 删除某天之前的消息

func (*MessageDAO) DisableMessage

func (this *MessageDAO) DisableMessage(tx *dbs.Tx, id int64) error

DisableMessage 禁用条目

func (*MessageDAO) EnableMessage

func (this *MessageDAO) EnableMessage(tx *dbs.Tx, id int64) error

EnableMessage 启用条目

func (*MessageDAO) FindEnabledMessage

func (this *MessageDAO) FindEnabledMessage(tx *dbs.Tx, id int64) (*Message, error)

FindEnabledMessage 查找启用中的条目

func (*MessageDAO) ListUnreadMessages

func (this *MessageDAO) ListUnreadMessages(tx *dbs.Tx, adminId int64, userId int64, offset int64, size int64) (result []*Message, err error)

ListUnreadMessages 列出单页未读消息

func (*MessageDAO) UpdateAllMessagesRead

func (this *MessageDAO) UpdateAllMessagesRead(tx *dbs.Tx, adminId int64, userId int64) error

UpdateAllMessagesRead 设置所有消息为已读

func (*MessageDAO) UpdateMessageRead

func (this *MessageDAO) UpdateMessageRead(tx *dbs.Tx, messageId int64, b bool) error

UpdateMessageRead 设置消息已读状态

func (*MessageDAO) UpdateMessagesRead

func (this *MessageDAO) UpdateMessagesRead(tx *dbs.Tx, messageIds []int64, b bool) error

UpdateMessagesRead 设置一组消息为已读状态

type MessageMedia

type MessageMedia struct {
	Id              uint32 `field:"id"`              // ID
	Name            string `field:"name"`            // 名称
	Type            string `field:"type"`            // 类型
	Description     string `field:"description"`     // 描述
	UserDescription string `field:"userDescription"` // 用户描述
	IsOn            bool   `field:"isOn"`            // 是否启用
	Order           uint32 `field:"order"`           // 排序
	State           uint8  `field:"state"`           // 状态
}

MessageMedia 消息媒介

type MessageMediaDAO

type MessageMediaDAO dbs.DAO
var SharedMessageMediaDAO *MessageMediaDAO

func NewMessageMediaDAO

func NewMessageMediaDAO() *MessageMediaDAO

func (*MessageMediaDAO) DisableMessageMedia

func (this *MessageMediaDAO) DisableMessageMedia(tx *dbs.Tx, id int64) error

禁用条目

func (*MessageMediaDAO) EnableMessageMedia

func (this *MessageMediaDAO) EnableMessageMedia(tx *dbs.Tx, id int64) error

启用条目

func (*MessageMediaDAO) FindAllEnabledMessageMedias

func (this *MessageMediaDAO) FindAllEnabledMessageMedias(tx *dbs.Tx) (result []*MessageMedia, err error)

查询所有可用媒介

func (*MessageMediaDAO) FindEnabledMediaWithType

func (this *MessageMediaDAO) FindEnabledMediaWithType(tx *dbs.Tx, mediaType string) (*MessageMedia, error)

根据类型查找媒介

func (*MessageMediaDAO) FindEnabledMessageMedia

func (this *MessageMediaDAO) FindEnabledMessageMedia(tx *dbs.Tx, id int64) (*MessageMedia, error)

查找启用中的条目

func (*MessageMediaDAO) FindMessageMediaName

func (this *MessageMediaDAO) FindMessageMediaName(tx *dbs.Tx, id int64) (string, error)

根据主键查找名称

func (*MessageMediaDAO) UpdateMessageMedias

func (this *MessageMediaDAO) UpdateMessageMedias(tx *dbs.Tx, mediaMaps []maps.Map) error

设置当前所有可用的媒介

type MessageMediaInstance

type MessageMediaInstance struct {
	Id          uint32   `field:"id"`          // ID
	Name        string   `field:"name"`        // 名称
	IsOn        bool     `field:"isOn"`        // 是否启用
	MediaType   string   `field:"mediaType"`   // 媒介类型
	Params      dbs.JSON `field:"params"`      // 媒介参数
	Description string   `field:"description"` // 备注
	Rate        dbs.JSON `field:"rate"`        // 发送频率
	State       uint8    `field:"state"`       // 状态
	HashLife    int32    `field:"hashLife"`    // HASH有效期(秒)
}

MessageMediaInstance 消息媒介接收人

type MessageMediaInstanceDAO

type MessageMediaInstanceDAO dbs.DAO
var SharedMessageMediaInstanceDAO *MessageMediaInstanceDAO

func NewMessageMediaInstanceDAO

func NewMessageMediaInstanceDAO() *MessageMediaInstanceDAO

func (*MessageMediaInstanceDAO) CountAllEnabledMediaInstances

func (this *MessageMediaInstanceDAO) CountAllEnabledMediaInstances(tx *dbs.Tx, mediaType string, keyword string) (int64, error)

CountAllEnabledMediaInstances 计算接收人数量

func (*MessageMediaInstanceDAO) CreateMediaInstance

func (this *MessageMediaInstanceDAO) CreateMediaInstance(tx *dbs.Tx, name string, mediaType string, params maps.Map, description string, rateJSON []byte, hashLifeSeconds int32) (int64, error)

CreateMediaInstance 创建媒介实例

func (*MessageMediaInstanceDAO) DisableMessageMediaInstance

func (this *MessageMediaInstanceDAO) DisableMessageMediaInstance(tx *dbs.Tx, id int64) error

DisableMessageMediaInstance 禁用条目

func (*MessageMediaInstanceDAO) EnableMessageMediaInstance

func (this *MessageMediaInstanceDAO) EnableMessageMediaInstance(tx *dbs.Tx, id int64) error

EnableMessageMediaInstance 启用条目

func (*MessageMediaInstanceDAO) FindEnabledMessageMediaInstance

func (this *MessageMediaInstanceDAO) FindEnabledMessageMediaInstance(tx *dbs.Tx, instanceId int64, cacheMap *utils.CacheMap) (*MessageMediaInstance, error)

FindEnabledMessageMediaInstance 查找启用中的条目

func (*MessageMediaInstanceDAO) FindInstanceHashLifeSeconds

func (this *MessageMediaInstanceDAO) FindInstanceHashLifeSeconds(tx *dbs.Tx, instanceId int64) (int32, error)

FindInstanceHashLifeSeconds 获取单个实例的HashLife

func (*MessageMediaInstanceDAO) ListAllEnabledMediaInstances

func (this *MessageMediaInstanceDAO) ListAllEnabledMediaInstances(tx *dbs.Tx, mediaType string, keyword string, offset int64, size int64) (result []*MessageMediaInstance, err error)

ListAllEnabledMediaInstances 列出单页接收人

func (*MessageMediaInstanceDAO) UpdateMediaInstance

func (this *MessageMediaInstanceDAO) UpdateMediaInstance(tx *dbs.Tx, instanceId int64, name string, mediaType string, params maps.Map, description string, rateJSON []byte, hashLifeSeconds int32, isOn bool) error

UpdateMediaInstance 修改媒介实例

type MessageMediaInstanceOperator

type MessageMediaInstanceOperator struct {
	Id          interface{} // ID
	Name        interface{} // 名称
	IsOn        interface{} // 是否启用
	MediaType   interface{} // 媒介类型
	Params      interface{} // 媒介参数
	Description interface{} // 备注
	Rate        interface{} // 发送频率
	State       interface{} // 状态
	HashLife    interface{} // HASH有效期(秒)
}

func NewMessageMediaInstanceOperator

func NewMessageMediaInstanceOperator() *MessageMediaInstanceOperator

type MessageMediaOperator

type MessageMediaOperator struct {
	Id              interface{} // ID
	Name            interface{} // 名称
	Type            interface{} // 类型
	Description     interface{} // 描述
	UserDescription interface{} // 用户描述
	IsOn            interface{} // 是否启用
	Order           interface{} // 排序
	State           interface{} // 状态
}

func NewMessageMediaOperator

func NewMessageMediaOperator() *MessageMediaOperator

type MessageOperator

type MessageOperator struct {
	Id        interface{} // ID
	AdminId   interface{} // 管理员ID
	UserId    interface{} // 用户ID
	Role      interface{} // 角色
	ClusterId interface{} // 集群ID
	NodeId    interface{} // 节点ID
	Level     interface{} // 级别
	Subject   interface{} // 标题
	Body      interface{} // 内容
	Type      interface{} // 消息类型
	Params    interface{} // 额外的参数
	IsRead    interface{} // 是否已读
	State     interface{} // 状态
	CreatedAt interface{} // 创建时间
	Day       interface{} // 日期YYYYMMDD
	Hash      interface{} // 消息内容的Hash
}

func NewMessageOperator

func NewMessageOperator() *MessageOperator

type MessageReceiver

type MessageReceiver struct {
	Id               uint32   `field:"id"`               // ID
	Role             string   `field:"role"`             // 节点角色
	ClusterId        uint32   `field:"clusterId"`        // 集群ID
	NodeId           uint32   `field:"nodeId"`           // 节点ID
	ServerId         uint32   `field:"serverId"`         // 服务ID
	Type             string   `field:"type"`             // 类型
	Params           dbs.JSON `field:"params"`           // 参数
	RecipientId      uint32   `field:"recipientId"`      // 接收人ID
	RecipientGroupId uint32   `field:"recipientGroupId"` // 接收人分组ID
	State            uint8    `field:"state"`            // 状态
}

MessageReceiver 消息通知接收人

type MessageReceiverDAO

type MessageReceiverDAO dbs.DAO
var SharedMessageReceiverDAO *MessageReceiverDAO

func NewMessageReceiverDAO

func NewMessageReceiverDAO() *MessageReceiverDAO

func (*MessageReceiverDAO) CountAllEnabledReceivers

func (this *MessageReceiverDAO) CountAllEnabledReceivers(tx *dbs.Tx, role string, clusterId int64, nodeId int64, serverId int64, messageType string) (int64, error)

CountAllEnabledReceivers 计算接收人数量

func (*MessageReceiverDAO) CreateReceiver

func (this *MessageReceiverDAO) CreateReceiver(tx *dbs.Tx, role string, clusterId int64, nodeId int64, serverId int64, messageType MessageType, params maps.Map, recipientId int64, recipientGroupId int64) (int64, error)

CreateReceiver 创建接收人

func (*MessageReceiverDAO) DisableMessageReceiver

func (this *MessageReceiverDAO) DisableMessageReceiver(tx *dbs.Tx, id int64) error

DisableMessageReceiver 禁用条目

func (*MessageReceiverDAO) DisableReceivers

func (this *MessageReceiverDAO) DisableReceivers(tx *dbs.Tx, clusterId int64, nodeId int64, serverId int64) error

DisableReceivers 禁用一组接收人

func (*MessageReceiverDAO) EnableMessageReceiver

func (this *MessageReceiverDAO) EnableMessageReceiver(tx *dbs.Tx, id int64) error

EnableMessageReceiver 启用条目

func (*MessageReceiverDAO) FindAllEnabledReceivers

func (this *MessageReceiverDAO) FindAllEnabledReceivers(tx *dbs.Tx, role string, clusterId int64, nodeId int64, serverId int64, messageType string) (result []*MessageReceiver, err error)

FindAllEnabledReceivers 查询接收人

func (*MessageReceiverDAO) FindEnabledBestFitReceivers

func (this *MessageReceiverDAO) FindEnabledBestFitReceivers(tx *dbs.Tx, role string, clusterId int64, nodeId int64, serverId int64, messageType string) (result []*MessageReceiver, err error)

FindEnabledBestFitReceivers 查询最适合的接收人

func (*MessageReceiverDAO) FindEnabledMessageReceiver

func (this *MessageReceiverDAO) FindEnabledMessageReceiver(tx *dbs.Tx, id int64) (*MessageReceiver, error)

FindEnabledMessageReceiver 查找启用中的条目

type MessageReceiverOperator

type MessageReceiverOperator struct {
	Id               interface{} // ID
	Role             interface{} // 节点角色
	ClusterId        interface{} // 集群ID
	NodeId           interface{} // 节点ID
	ServerId         interface{} // 服务ID
	Type             interface{} // 类型
	Params           interface{} // 参数
	RecipientId      interface{} // 接收人ID
	RecipientGroupId interface{} // 接收人分组ID
	State            interface{} // 状态
}

func NewMessageReceiverOperator

func NewMessageReceiverOperator() *MessageReceiverOperator

type MessageRecipient

type MessageRecipient struct {
	Id          uint32   `field:"id"`          // ID
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	InstanceId  uint32   `field:"instanceId"`  // 实例ID
	User        string   `field:"user"`        // 接收人信息
	GroupIds    dbs.JSON `field:"groupIds"`    // 分组ID
	State       uint8    `field:"state"`       // 状态
	TimeFrom    string   `field:"timeFrom"`    // 开始时间
	TimeTo      string   `field:"timeTo"`      // 结束时间
	Description string   `field:"description"` // 备注
}

MessageRecipient 消息媒介接收人

func (*MessageRecipient) DecodeGroupIds

func (this *MessageRecipient) DecodeGroupIds() []int64

DecodeGroupIds 解析分组ID

type MessageRecipientDAO

type MessageRecipientDAO dbs.DAO
var SharedMessageRecipientDAO *MessageRecipientDAO

func NewMessageRecipientDAO

func NewMessageRecipientDAO() *MessageRecipientDAO

func (*MessageRecipientDAO) CountAllEnabledRecipients

func (this *MessageRecipientDAO) CountAllEnabledRecipients(tx *dbs.Tx, adminId int64, groupId int64, mediaType string, keyword string) (int64, error)

CountAllEnabledRecipients 计算接收人数量

func (*MessageRecipientDAO) CreateRecipient

func (this *MessageRecipientDAO) CreateRecipient(tx *dbs.Tx, adminId int64, instanceId int64, user string, groupIds []int64, description string, timeFrom string, timeTo string) (int64, error)

CreateRecipient 创建接收人

func (*MessageRecipientDAO) DisableMessageRecipient

func (this *MessageRecipientDAO) DisableMessageRecipient(tx *dbs.Tx, id int64) error

DisableMessageRecipient 禁用条目

func (*MessageRecipientDAO) EnableMessageRecipient

func (this *MessageRecipientDAO) EnableMessageRecipient(tx *dbs.Tx, id int64) error

EnableMessageRecipient 启用条目

func (*MessageRecipientDAO) FindAllEnabledAndOnRecipientIdsWithGroup

func (this *MessageRecipientDAO) FindAllEnabledAndOnRecipientIdsWithGroup(tx *dbs.Tx, groupId int64) ([]int64, error)

FindAllEnabledAndOnRecipientIdsWithGroup 查找某个分组下的所有可用接收人ID

func (*MessageRecipientDAO) FindEnabledMessageRecipient

func (this *MessageRecipientDAO) FindEnabledMessageRecipient(tx *dbs.Tx, recipientId int64, cacheMap *utils.CacheMap,
) (*MessageRecipient, error)

FindEnabledMessageRecipient 查找启用中的条目

func (*MessageRecipientDAO) FindRecipientInstanceId

func (this *MessageRecipientDAO) FindRecipientInstanceId(tx *dbs.Tx, recipientId int64) (int64, error)

FindRecipientInstanceId 查找接收人的媒介

func (*MessageRecipientDAO) ListAllEnabledRecipients

func (this *MessageRecipientDAO) ListAllEnabledRecipients(tx *dbs.Tx, adminId int64, groupId int64, mediaType string, keyword string, offset int64, size int64) (result []*MessageRecipient, err error)

ListAllEnabledRecipients 列出单页接收人

func (*MessageRecipientDAO) UpdateRecipient

func (this *MessageRecipientDAO) UpdateRecipient(tx *dbs.Tx, recipientId int64, adminId int64, instanceId int64, user string, groupIds []int64, description string, timeFrom string, timeTo string, isOn bool) error

UpdateRecipient 修改接收人

type MessageRecipientGroup

type MessageRecipientGroup struct {
	Id    uint32 `field:"id"`    // ID
	Name  string `field:"name"`  // 分组名
	Order uint32 `field:"order"` // 排序
	IsOn  bool   `field:"isOn"`  // 是否启用
	State uint8  `field:"state"` // 状态
}

MessageRecipientGroup 消息接收人分组

type MessageRecipientGroupDAO

type MessageRecipientGroupDAO dbs.DAO
var SharedMessageRecipientGroupDAO *MessageRecipientGroupDAO

func NewMessageRecipientGroupDAO

func NewMessageRecipientGroupDAO() *MessageRecipientGroupDAO

func (*MessageRecipientGroupDAO) CreateGroup

func (this *MessageRecipientGroupDAO) CreateGroup(tx *dbs.Tx, name string) (int64, error)

创建分组

func (*MessageRecipientGroupDAO) DisableMessageRecipientGroup

func (this *MessageRecipientGroupDAO) DisableMessageRecipientGroup(tx *dbs.Tx, id int64) error

禁用条目

func (*MessageRecipientGroupDAO) EnableMessageRecipientGroup

func (this *MessageRecipientGroupDAO) EnableMessageRecipientGroup(tx *dbs.Tx, id int64) error

启用条目

func (*MessageRecipientGroupDAO) FindAllEnabledGroups

func (this *MessageRecipientGroupDAO) FindAllEnabledGroups(tx *dbs.Tx) (result []*MessageRecipientGroup, err error)

查找所有分组

func (*MessageRecipientGroupDAO) FindEnabledMessageRecipientGroup

func (this *MessageRecipientGroupDAO) FindEnabledMessageRecipientGroup(tx *dbs.Tx, id int64) (*MessageRecipientGroup, error)

查找启用中的条目

func (*MessageRecipientGroupDAO) FindMessageRecipientGroupName

func (this *MessageRecipientGroupDAO) FindMessageRecipientGroupName(tx *dbs.Tx, id int64) (string, error)

根据主键查找名称

func (*MessageRecipientGroupDAO) UpdateGroup

func (this *MessageRecipientGroupDAO) UpdateGroup(tx *dbs.Tx, groupId int64, name string, isOn bool) error

修改分组

type MessageRecipientGroupOperator

type MessageRecipientGroupOperator struct {
	Id    interface{} // ID
	Name  interface{} // 分组名
	Order interface{} // 排序
	IsOn  interface{} // 是否启用
	State interface{} // 状态
}

func NewMessageRecipientGroupOperator

func NewMessageRecipientGroupOperator() *MessageRecipientGroupOperator

type MessageRecipientOperator

type MessageRecipientOperator struct {
	Id          interface{} // ID
	AdminId     interface{} // 管理员ID
	IsOn        interface{} // 是否启用
	InstanceId  interface{} // 实例ID
	User        interface{} // 接收人信息
	GroupIds    interface{} // 分组ID
	State       interface{} // 状态
	TimeFrom    interface{} // 开始时间
	TimeTo      interface{} // 结束时间
	Description interface{} // 备注
}

func NewMessageRecipientOperator

func NewMessageRecipientOperator() *MessageRecipientOperator

type MessageTask

type MessageTask struct {
	Id          uint64   `field:"id"`          // ID
	RecipientId uint32   `field:"recipientId"` // 接收人ID
	Hash        string   `field:"hash"`        // SUM标识
	InstanceId  uint32   `field:"instanceId"`  // 媒介实例ID
	User        string   `field:"user"`        // 接收用户标识
	Subject     string   `field:"subject"`     // 标题
	Body        string   `field:"body"`        // 内容
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	Status      uint8    `field:"status"`      // 发送状态
	SentAt      uint64   `field:"sentAt"`      // 最后一次发送时间
	State       uint8    `field:"state"`       // 状态
	Result      dbs.JSON `field:"result"`      // 结果
	Day         string   `field:"day"`         // YYYYMMDD
	IsPrimary   bool     `field:"isPrimary"`   // 是否优先
}

MessageTask 消息发送相关任务

type MessageTaskDAO

type MessageTaskDAO dbs.DAO
var SharedMessageTaskDAO *MessageTaskDAO

func NewMessageTaskDAO

func NewMessageTaskDAO() *MessageTaskDAO

func (*MessageTaskDAO) CleanExpiredMessageTasks

func (this *MessageTaskDAO) CleanExpiredMessageTasks(tx *dbs.Tx, days int) error

CleanExpiredMessageTasks 清理

func (*MessageTaskDAO) CountMessageTasksWithStatus

func (this *MessageTaskDAO) CountMessageTasksWithStatus(tx *dbs.Tx, status MessageTaskStatus) (int64, error)

CountMessageTasksWithStatus 根据状态计算任务数量

func (*MessageTaskDAO) CreateMessageTask

func (this *MessageTaskDAO) CreateMessageTask(tx *dbs.Tx, recipientId int64, instanceId int64, user string, subject string, body string, isPrimary bool) (int64, error)

CreateMessageTask 创建任务

func (*MessageTaskDAO) CreateMessageTasks

func (this *MessageTaskDAO) CreateMessageTasks(tx *dbs.Tx, role nodeconfigs.NodeRole, clusterId int64, nodeId int64, serverId int64, messageType MessageType, subject string, body string) error

CreateMessageTasks 从集群、节点或者服务中创建任务

func (*MessageTaskDAO) DisableMessageTask

func (this *MessageTaskDAO) DisableMessageTask(tx *dbs.Tx, id int64) error

DisableMessageTask 禁用条目

func (*MessageTaskDAO) EnableMessageTask

func (this *MessageTaskDAO) EnableMessageTask(tx *dbs.Tx, id int64) error

EnableMessageTask 启用条目

func (*MessageTaskDAO) FindEnabledMessageTask

func (this *MessageTaskDAO) FindEnabledMessageTask(tx *dbs.Tx, id int64) (*MessageTask, error)

FindEnabledMessageTask 查找启用中的条目

func (*MessageTaskDAO) FindSendingMessageTasks

func (this *MessageTaskDAO) FindSendingMessageTasks(tx *dbs.Tx, size int64) (result []*MessageTask, err error)

FindSendingMessageTasks 查找需要发送的任务

func (*MessageTaskDAO) ListMessageTasksWithStatus

func (this *MessageTaskDAO) ListMessageTasksWithStatus(tx *dbs.Tx, status MessageTaskStatus, offset int64, size int64) (result []*MessageTask, err error)

ListMessageTasksWithStatus 根据状态列出单页任务

func (*MessageTaskDAO) UpdateMessageTaskStatus

func (this *MessageTaskDAO) UpdateMessageTaskStatus(tx *dbs.Tx, taskId int64, status MessageTaskStatus, result []byte) error

UpdateMessageTaskStatus 设置发送的状态

type MessageTaskLog

type MessageTaskLog struct {
	Id        uint64 `field:"id"`        // ID
	TaskId    uint64 `field:"taskId"`    // 任务ID
	CreatedAt uint64 `field:"createdAt"` // 创建时间
	IsOk      bool   `field:"isOk"`      // 是否成功
	Error     string `field:"error"`     // 错误信息
	Response  string `field:"response"`  // 响应信息
	Day       string `field:"day"`       // YYYYMMDD
}

MessageTaskLog 消息发送日志

type MessageTaskLogDAO

type MessageTaskLogDAO dbs.DAO
var SharedMessageTaskLogDAO *MessageTaskLogDAO

func NewMessageTaskLogDAO

func NewMessageTaskLogDAO() *MessageTaskLogDAO

func (*MessageTaskLogDAO) CleanExpiredLogs

func (this *MessageTaskLogDAO) CleanExpiredLogs(tx *dbs.Tx, days int) error

CleanExpiredLogs 清理

func (*MessageTaskLogDAO) CountLogs

func (this *MessageTaskLogDAO) CountLogs(tx *dbs.Tx) (int64, error)

CountLogs 计算日志数量

func (*MessageTaskLogDAO) CreateLog

func (this *MessageTaskLogDAO) CreateLog(tx *dbs.Tx, taskId int64, isOk bool, errMsg string, response string) error

CreateLog 创建日志

func (*MessageTaskLogDAO) ListLogs

func (this *MessageTaskLogDAO) ListLogs(tx *dbs.Tx, offset int64, size int64) (result []*MessageTaskLog, err error)

ListLogs 列出单页日志

type MessageTaskLogOperator

type MessageTaskLogOperator struct {
	Id        interface{} // ID
	TaskId    interface{} // 任务ID
	CreatedAt interface{} // 创建时间
	IsOk      interface{} // 是否成功
	Error     interface{} // 错误信息
	Response  interface{} // 响应信息
	Day       interface{} // YYYYMMDD
}

func NewMessageTaskLogOperator

func NewMessageTaskLogOperator() *MessageTaskLogOperator

type MessageTaskOperator

type MessageTaskOperator struct {
	Id          interface{} // ID
	RecipientId interface{} // 接收人ID
	Hash        interface{} // SUM标识
	InstanceId  interface{} // 媒介实例ID
	User        interface{} // 接收用户标识
	Subject     interface{} // 标题
	Body        interface{} // 内容
	CreatedAt   interface{} // 创建时间
	Status      interface{} // 发送状态
	SentAt      interface{} // 最后一次发送时间
	State       interface{} // 状态
	Result      interface{} // 结果
	Day         interface{} // YYYYMMDD
	IsPrimary   interface{} // 是否优先
}

func NewMessageTaskOperator

func NewMessageTaskOperator() *MessageTaskOperator

type MessageTaskStatus

type MessageTaskStatus = int
const (
	MessageTaskStateEnabled  = 1 // 已启用
	MessageTaskStateDisabled = 0 // 已禁用

	MessageTaskStatusNone    MessageTaskStatus = 0 // 普通状态
	MessageTaskStatusSending MessageTaskStatus = 1 // 发送中
	MessageTaskStatusSuccess MessageTaskStatus = 2 // 发送成功
	MessageTaskStatusFailed  MessageTaskStatus = 3 // 发送失败
)

type MessageType

type MessageType = string
const (
	MessageTypeHealthCheckFailed          MessageType = "HealthCheckFailed"          // 节点健康检查失败
	MessageTypeHealthCheckNodeUp          MessageType = "HealthCheckNodeUp"          // 因健康检查节点上线
	MessageTypeHealthCheckNodeDown        MessageType = "HealthCheckNodeDown"        // 因健康检查节点下线
	MessageTypeNodeInactive               MessageType = "NodeInactive"               // 边缘节点不活跃
	MessageTypeNodeActive                 MessageType = "NodeActive"                 // 边缘节点活跃
	MessageTypeClusterDNSSyncFailed       MessageType = "ClusterDNSSyncFailed"       // DNS同步失败
	MessageTypeSSLCertExpiring            MessageType = "SSLCertExpiring"            // SSL证书即将过期
	MessageTypeSSLCertACMETaskFailed      MessageType = "SSLCertACMETaskFailed"      // SSL证书任务执行失败
	MessageTypeSSLCertACMETaskSuccess     MessageType = "SSLCertACMETaskSuccess"     // SSL证书任务执行成功
	MessageTypeLogCapacityOverflow        MessageType = "LogCapacityOverflow"        // 日志超出最大限制
	MessageTypeServerNamesAuditingSuccess MessageType = "ServerNamesAuditingSuccess" // 服务域名审核成功(用户)
	MessageTypeServerNamesAuditingFailed  MessageType = "ServerNamesAuditingFailed"  // 服务域名审核失败(用户)
	MessageTypeServerNamesRequireAuditing MessageType = "serverNamesRequireAuditing" // 服务域名需要审核(管理员)
	MessageTypeThresholdSatisfied         MessageType = "ThresholdSatisfied"         // 满足阈值
	MessageTypeFirewallEvent              MessageType = "FirewallEvent"              // 防火墙事件
	MessageTypeIPAddrUp                   MessageType = "IPAddrUp"                   // IP地址上线
	MessageTypeIPAddrDown                 MessageType = "IPAddrDown"                 // IP地址下线

	MessageTypeNSNodeInactive MessageType = "NSNodeInactive" // NS节点不活跃
	MessageTypeNSNodeActive   MessageType = "NSNodeActive"   // NS节点活跃

	MessageTypeReportNodeInactive MessageType = "ReportNodeInactive" // 区域监控节点节点不活跃
	MessageTypeReportNodeActive   MessageType = "ReportNodeActive"   // 区域监控节点活跃
	MessageTypeConnectivity       MessageType = "Connectivity"
)

type MetricChart

type MetricChart struct {
	Id              uint32   `field:"id"`              // ID
	ItemId          uint32   `field:"itemId"`          // 指标ID
	Name            string   `field:"name"`            // 名称
	Code            string   `field:"code"`            // 代号
	Type            string   `field:"type"`            // 图形类型
	WidthDiv        int32    `field:"widthDiv"`        // 宽度划分
	Params          dbs.JSON `field:"params"`          // 图形参数
	Order           uint32   `field:"order"`           // 排序
	IsOn            bool     `field:"isOn"`            // 是否启用
	State           uint8    `field:"state"`           // 状态
	MaxItems        uint32   `field:"maxItems"`        // 最多条目
	IgnoreEmptyKeys uint8    `field:"ignoreEmptyKeys"` // 忽略空的键值
	IgnoredKeys     dbs.JSON `field:"ignoredKeys"`     // 忽略键值
}

MetricChart 指标图表

func (*MetricChart) DecodeIgnoredKeys

func (this *MetricChart) DecodeIgnoredKeys() []string

type MetricChartDAO

type MetricChartDAO dbs.DAO
var SharedMetricChartDAO *MetricChartDAO

func NewMetricChartDAO

func NewMetricChartDAO() *MetricChartDAO

func (*MetricChartDAO) CountEnabledCharts

func (this *MetricChartDAO) CountEnabledCharts(tx *dbs.Tx, itemId int64) (int64, error)

CountEnabledCharts 计算图表数量

func (*MetricChartDAO) CreateChart

func (this *MetricChartDAO) CreateChart(tx *dbs.Tx, itemId int64, name string, chartType string, widthDiv int32, maxItems int32, params maps.Map, ignoreEmptyKeys bool, ignoredKeys []string) (int64, error)

CreateChart 创建图表

func (*MetricChartDAO) DisableMetricChart

func (this *MetricChartDAO) DisableMetricChart(tx *dbs.Tx, chartId int64) error

DisableMetricChart 禁用条目

func (*MetricChartDAO) EnableMetricChart

func (this *MetricChartDAO) EnableMetricChart(tx *dbs.Tx, chartId int64) error

EnableMetricChart 启用条目

func (*MetricChartDAO) FindAllEnabledCharts

func (this *MetricChartDAO) FindAllEnabledCharts(tx *dbs.Tx, itemId int64) (result []*MetricChart, err error)

FindAllEnabledCharts 查找所有图表

func (*MetricChartDAO) FindEnabledMetricChart

func (this *MetricChartDAO) FindEnabledMetricChart(tx *dbs.Tx, chartId int64) (*MetricChart, error)

FindEnabledMetricChart 查找启用中的条目

func (*MetricChartDAO) FindMetricChartName

func (this *MetricChartDAO) FindMetricChartName(tx *dbs.Tx, chartId int64) (string, error)

FindMetricChartName 根据主键查找名称

func (*MetricChartDAO) ListEnabledCharts

func (this *MetricChartDAO) ListEnabledCharts(tx *dbs.Tx, itemId int64, offset int64, size int64) (result []*MetricChart, err error)

ListEnabledCharts 列出单页图表

func (*MetricChartDAO) UpdateChart

func (this *MetricChartDAO) UpdateChart(tx *dbs.Tx, chartId int64, name string, chartType string, widthDiv int32, maxItems int32, params maps.Map, ignoreEmptyKeys bool, ignoredKeys []string, isOn bool) error

UpdateChart 修改图表

type MetricChartOperator

type MetricChartOperator struct {
	Id              interface{} // ID
	ItemId          interface{} // 指标ID
	Name            interface{} // 名称
	Code            interface{} // 代号
	Type            interface{} // 图形类型
	WidthDiv        interface{} // 宽度划分
	Params          interface{} // 图形参数
	Order           interface{} // 排序
	IsOn            interface{} // 是否启用
	State           interface{} // 状态
	MaxItems        interface{} // 最多条目
	IgnoreEmptyKeys interface{} // 忽略空的键值
	IgnoredKeys     interface{} // 忽略键值
}

func NewMetricChartOperator

func NewMetricChartOperator() *MetricChartOperator

type MetricItem

type MetricItem struct {
	Id            uint64   `field:"id"`            // ID
	IsOn          bool     `field:"isOn"`          // 是否启用
	Code          string   `field:"code"`          // 代号(用来区分是否内置)
	Category      string   `field:"category"`      // 类型,比如http, tcp等
	AdminId       uint32   `field:"adminId"`       // 管理员ID
	UserId        uint32   `field:"userId"`        // 用户ID
	Name          string   `field:"name"`          // 指标名称
	Keys          dbs.JSON `field:"keys"`          // 统计的Key
	Period        uint32   `field:"period"`        // 周期
	PeriodUnit    string   `field:"periodUnit"`    // 周期单位
	ExpiresPeriod uint32   `field:"expiresPeriod"` // 过期周期
	Value         string   `field:"value"`         // 值运算
	State         uint8    `field:"state"`         // 状态
	Version       uint32   `field:"version"`       // 版本号
	IsPublic      bool     `field:"isPublic"`      // 是否为公用
	LastTime      string   `field:"lastTime"`      // 最新时间
}

MetricItem 指标定义

func (*MetricItem) DecodeKeys

func (this *MetricItem) DecodeKeys() []string

DecodeKeys 解析Key

type MetricItemDAO

type MetricItemDAO dbs.DAO
var SharedMetricItemDAO *MetricItemDAO

func NewMetricItemDAO

func NewMetricItemDAO() *MetricItemDAO

func (*MetricItemDAO) ComposeItemConfig

func (this *MetricItemDAO) ComposeItemConfig(tx *dbs.Tx, itemId int64) (*serverconfigs.MetricItemConfig, error)

ComposeItemConfig 组合指标配置

func (*MetricItemDAO) ComposeItemConfigWithItem

func (this *MetricItemDAO) ComposeItemConfigWithItem(item *MetricItem) *serverconfigs.MetricItemConfig

ComposeItemConfigWithItem 根据Item信息组合指标

func (*MetricItemDAO) CountEnabledItems

func (this *MetricItemDAO) CountEnabledItems(tx *dbs.Tx, category serverconfigs.MetricItemCategory) (int64, error)

CountEnabledItems 计算指标的数量

func (*MetricItemDAO) CreateItem

func (this *MetricItemDAO) CreateItem(tx *dbs.Tx, code string, category string, name string, keys []string, period int32, periodUnit string, expiresPeriod int32, value string, isPublic bool) (int64, error)

CreateItem 创建指标

func (*MetricItemDAO) DisableMetricItem

func (this *MetricItemDAO) DisableMetricItem(tx *dbs.Tx, itemId int64) error

DisableMetricItem 禁用条目

func (*MetricItemDAO) EnableMetricItem

func (this *MetricItemDAO) EnableMetricItem(tx *dbs.Tx, id int64) error

EnableMetricItem 启用条目

func (*MetricItemDAO) FindAllPublicItems

func (this *MetricItemDAO) FindAllPublicItems(tx *dbs.Tx, category string, cacheMap *utils.CacheMap) (result []*MetricItem, err error)

FindAllPublicItems 取得公用的指标

func (*MetricItemDAO) FindEnabledMetricItem

func (this *MetricItemDAO) FindEnabledMetricItem(tx *dbs.Tx, id int64) (*MetricItem, error)

FindEnabledMetricItem 查找启用中的条目

func (*MetricItemDAO) FindItemVersion

func (this *MetricItemDAO) FindItemVersion(tx *dbs.Tx, itemId int64) (int32, error)

FindItemVersion 获取指标的版本号

func (*MetricItemDAO) FindMetricItemName

func (this *MetricItemDAO) FindMetricItemName(tx *dbs.Tx, id int64) (string, error)

FindMetricItemName 根据主键查找名称

func (*MetricItemDAO) FindMetricLastTime

func (this *MetricItemDAO) FindMetricLastTime(tx *dbs.Tx, itemId int64) (string, error)

FindMetricLastTime 读取指标最新数据的时间

func (*MetricItemDAO) ListEnabledItems

func (this *MetricItemDAO) ListEnabledItems(tx *dbs.Tx, category serverconfigs.MetricItemCategory, offset int64, size int64) (result []*MetricItem, err error)

ListEnabledItems 列出单页指标

func (*MetricItemDAO) NotifyUpdate

func (this *MetricItemDAO) NotifyUpdate(tx *dbs.Tx, itemId int64, isPublic bool) error

NotifyUpdate 通知更新

func (*MetricItemDAO) UpdateItem

func (this *MetricItemDAO) UpdateItem(tx *dbs.Tx, itemId int64, name string, keys []string, period int32, periodUnit string, expiresPeriod int32, value string, isOn bool, isPublic bool) error

UpdateItem 修改\指标

func (*MetricItemDAO) UpdateMetricLastTime

func (this *MetricItemDAO) UpdateMetricLastTime(tx *dbs.Tx, itemId int64, lastTime string) error

UpdateMetricLastTime 更新指标最新数据的时间

type MetricItemOperator

type MetricItemOperator struct {
	Id            interface{} // ID
	IsOn          interface{} // 是否启用
	Code          interface{} // 代号(用来区分是否内置)
	Category      interface{} // 类型,比如http, tcp等
	AdminId       interface{} // 管理员ID
	UserId        interface{} // 用户ID
	Name          interface{} // 指标名称
	Keys          interface{} // 统计的Key
	Period        interface{} // 周期
	PeriodUnit    interface{} // 周期单位
	ExpiresPeriod interface{} // 过期周期
	Value         interface{} // 值运算
	State         interface{} // 状态
	Version       interface{} // 版本号
	IsPublic      interface{} // 是否为公用
	LastTime      interface{} // 最新时间
}

func NewMetricItemOperator

func NewMetricItemOperator() *MetricItemOperator

type MetricStat

type MetricStat struct {
	Id         uint64   `field:"id"`         // ID
	Hash       string   `field:"hash"`       // Hash值
	ClusterId  uint32   `field:"clusterId"`  // 集群ID
	NodeId     uint32   `field:"nodeId"`     // 节点ID
	ServerId   uint32   `field:"serverId"`   // 服务ID
	ItemId     uint64   `field:"itemId"`     // 指标
	Keys       dbs.JSON `field:"keys"`       // 键值
	Value      float64  `field:"value"`      // 数值
	Time       string   `field:"time"`       // 分钟值YYYYMMDDHHII
	Version    uint32   `field:"version"`    // 版本号
	CreatedDay string   `field:"createdDay"` // YYYYMMDD
}

MetricStat 指标统计数据

func (*MetricStat) DecodeKeys

func (this *MetricStat) DecodeKeys() []string

DecodeKeys 解析Key

type MetricStatDAO

type MetricStatDAO dbs.DAO
var SharedMetricStatDAO *MetricStatDAO

func NewMetricStatDAO

func NewMetricStatDAO() *MetricStatDAO

func (*MetricStatDAO) Clean

func (this *MetricStatDAO) Clean(tx *dbs.Tx) error

Clean 清理数据

func (*MetricStatDAO) CountItemStats

func (this *MetricStatDAO) CountItemStats(tx *dbs.Tx, itemId int64, version int32) (int64, error)

CountItemStats 计算统计数据数量

func (*MetricStatDAO) CreateStat

func (this *MetricStatDAO) CreateStat(tx *dbs.Tx, hash string, clusterId int64, nodeId int64, serverId int64, itemId int64, keys []string, value float64, time string, version int32) error

CreateStat 创建统计数据

func (*MetricStatDAO) DeleteItemStats

func (this *MetricStatDAO) DeleteItemStats(tx *dbs.Tx, itemId int64) error

DeleteItemStats 删除某个指标相关的统计数据

func (*MetricStatDAO) DeleteNodeItemStats

func (this *MetricStatDAO) DeleteNodeItemStats(tx *dbs.Tx, nodeId int64, serverId int64, itemId int64, time string) error

DeleteNodeItemStats 删除某个节点的统计数据

func (*MetricStatDAO) DeleteOldVersionItemStats

func (this *MetricStatDAO) DeleteOldVersionItemStats(tx *dbs.Tx, itemId int64, version int32) error

DeleteOldVersionItemStats 删除以前版本的统计数据

func (*MetricStatDAO) FindItemStatsAtLastTime

func (this *MetricStatDAO) FindItemStatsAtLastTime(tx *dbs.Tx, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindItemStatsAtLastTime 取得所有集群最近一次计时前 N 个数据 适合每条数据中包含不同的Key的场景

func (*MetricStatDAO) FindItemStatsWithClusterIdAndLastTime

func (this *MetricStatDAO) FindItemStatsWithClusterIdAndLastTime(tx *dbs.Tx, clusterId int64, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindItemStatsWithClusterIdAndLastTime 取得集群最近一次计时前 N 个数据 适合每条数据中包含不同的Key的场景

func (*MetricStatDAO) FindItemStatsWithNodeIdAndLastTime

func (this *MetricStatDAO) FindItemStatsWithNodeIdAndLastTime(tx *dbs.Tx, nodeId int64, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindItemStatsWithNodeIdAndLastTime 取得节点最近一次计时前 N 个数据 适合每条数据中包含不同的Key的场景

func (*MetricStatDAO) FindItemStatsWithServerIdAndLastTime

func (this *MetricStatDAO) FindItemStatsWithServerIdAndLastTime(tx *dbs.Tx, serverId int64, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindItemStatsWithServerIdAndLastTime 取得服务最近一次计时前 N 个数据 适合每条数据中包含不同的Key的场景

func (*MetricStatDAO) FindLatestItemStats

func (this *MetricStatDAO) FindLatestItemStats(tx *dbs.Tx, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindLatestItemStats 取得所有集群上最近 N 个时间的数据 适合同个Key在不同时间段的变化场景

func (*MetricStatDAO) FindLatestItemStatsWithClusterId

func (this *MetricStatDAO) FindLatestItemStatsWithClusterId(tx *dbs.Tx, clusterId int64, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindLatestItemStatsWithClusterId 取得集群最近 N 个时间的数据 适合同个Key在不同时间段的变化场景

func (*MetricStatDAO) FindLatestItemStatsWithNodeId

func (this *MetricStatDAO) FindLatestItemStatsWithNodeId(tx *dbs.Tx, nodeId int64, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindLatestItemStatsWithNodeId 取得节点最近 N 个时间的数据 适合同个Key在不同时间段的变化场景

func (*MetricStatDAO) FindLatestItemStatsWithServerId

func (this *MetricStatDAO) FindLatestItemStatsWithServerId(tx *dbs.Tx, serverId int64, itemId int64, ignoreEmptyKeys bool, ignoreKeys []string, version int32, size int64) (result []*MetricStat, err error)

FindLatestItemStatsWithServerId 取得服务最近 N 个时间的数据 适合同个Key在不同时间段的变化场景

func (*MetricStatDAO) ListItemStats

func (this *MetricStatDAO) ListItemStats(tx *dbs.Tx, itemId int64, version int32, offset int64, size int64) (result []*MetricStat, err error)

ListItemStats 列出单页统计数据

type MetricStatOperator

type MetricStatOperator struct {
	Id         interface{} // ID
	Hash       interface{} // Hash值
	ClusterId  interface{} // 集群ID
	NodeId     interface{} // 节点ID
	ServerId   interface{} // 服务ID
	ItemId     interface{} // 指标
	Keys       interface{} // 键值
	Value      interface{} // 数值
	Time       interface{} // 分钟值YYYYMMDDHHII
	Version    interface{} // 版本号
	CreatedDay interface{} // YYYYMMDD
}

func NewMetricStatOperator

func NewMetricStatOperator() *MetricStatOperator

type MetricSumStat

type MetricSumStat struct {
	Id         uint64  `field:"id"`         // ID
	ClusterId  uint32  `field:"clusterId"`  // 集群ID
	NodeId     uint32  `field:"nodeId"`     // 节点ID
	ServerId   uint32  `field:"serverId"`   // 服务ID
	ItemId     uint64  `field:"itemId"`     // 指标
	Count      uint64  `field:"count"`      // 数量
	Total      float64 `field:"total"`      // 总和
	Time       string  `field:"time"`       // 分钟值YYYYMMDDHHII
	Version    uint32  `field:"version"`    // 版本号
	CreatedDay string  `field:"createdDay"` // 创建日期YYYYMMDD
}

MetricSumStat 指标统计总和数据

type MetricSumStatDAO

type MetricSumStatDAO dbs.DAO
var SharedMetricSumStatDAO *MetricSumStatDAO

func NewMetricSumStatDAO

func NewMetricSumStatDAO() *MetricSumStatDAO

func (*MetricSumStatDAO) Clean

func (this *MetricSumStatDAO) Clean(tx *dbs.Tx) error

Clean 清理数据

func (*MetricSumStatDAO) DeleteItemStats

func (this *MetricSumStatDAO) DeleteItemStats(tx *dbs.Tx, itemId int64) error

DeleteItemStats 删除某个指标相关的统计数据

func (*MetricSumStatDAO) FindClusterSum

func (this *MetricSumStatDAO) FindClusterSum(tx *dbs.Tx, clusterId int64, time string, itemId int64, version int32) (count int64, total float32, err error)

FindClusterSum 查找集群上的统计数据

func (*MetricSumStatDAO) FindNodeServerSum

func (this *MetricSumStatDAO) FindNodeServerSum(tx *dbs.Tx, nodeId int64, serverId int64, time string, itemId int64, version int32) (count int64, total float32, err error)

FindNodeServerSum 查找某个服务在某个节点上的统计数据

func (*MetricSumStatDAO) FindNodeSum

func (this *MetricSumStatDAO) FindNodeSum(tx *dbs.Tx, nodeId int64, time string, itemId int64, version int32) (count int64, total float32, err error)

FindNodeSum 查找节点上的统计数据

func (*MetricSumStatDAO) FindServerSum

func (this *MetricSumStatDAO) FindServerSum(tx *dbs.Tx, serverId int64, time string, itemId int64, version int32) (count int64, total float32, err error)

FindServerSum 查找某个服务的统计数据

func (*MetricSumStatDAO) FindSumAtTime

func (this *MetricSumStatDAO) FindSumAtTime(tx *dbs.Tx, time string, itemId int64, version int32) (count int64, total float32, err error)

FindSumAtTime 查找某个时间的统计数据

func (*MetricSumStatDAO) UpdateSum

func (this *MetricSumStatDAO) UpdateSum(tx *dbs.Tx, clusterId int64, nodeId int64, serverId int64, time string, itemId int64, version int32, count int64, total float32) error

UpdateSum 更新统计数据

type MetricSumStatOperator

type MetricSumStatOperator struct {
	Id         interface{} // ID
	ClusterId  interface{} // 集群ID
	NodeId     interface{} // 节点ID
	ServerId   interface{} // 服务ID
	ItemId     interface{} // 指标
	Count      interface{} // 数量
	Total      interface{} // 总和
	Time       interface{} // 分钟值YYYYMMDDHHII
	Version    interface{} // 版本号
	CreatedDay interface{} // 创建日期YYYYMMDD
}

func NewMetricSumStatOperator

func NewMetricSumStatOperator() *MetricSumStatOperator

type MonitorNode

type MonitorNode struct {
	Id          uint32   `field:"id"`          // ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	UniqueId    string   `field:"uniqueId"`    // 唯一ID
	Secret      string   `field:"secret"`      // 密钥
	Name        string   `field:"name"`        // 名称
	Description string   `field:"description"` // 描述
	Order       uint32   `field:"order"`       // 排序
	State       uint8    `field:"state"`       // 状态
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	Weight      uint32   `field:"weight"`      // 权重
	Status      dbs.JSON `field:"status"`      // 运行状态
}

MonitorNode 监控节点

type MonitorNodeDAO

type MonitorNodeDAO dbs.DAO
var SharedMonitorNodeDAO *MonitorNodeDAO

func NewMonitorNodeDAO

func NewMonitorNodeDAO() *MonitorNodeDAO

func (*MonitorNodeDAO) CountAllEnabledMonitorNodes

func (this *MonitorNodeDAO) CountAllEnabledMonitorNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledMonitorNodes 计算监控节点数量

func (*MonitorNodeDAO) CountAllLowerVersionNodes

func (this *MonitorNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有节点中低于某个版本的节点数量

func (*MonitorNodeDAO) CreateMonitorNode

func (this *MonitorNodeDAO) CreateMonitorNode(tx *dbs.Tx, name string, description string, isOn bool) (nodeId int64, err error)

CreateMonitorNode 创建监控节点

func (*MonitorNodeDAO) DisableMonitorNode

func (this *MonitorNodeDAO) DisableMonitorNode(tx *dbs.Tx, nodeId int64) error

DisableMonitorNode 禁用条目

func (*MonitorNodeDAO) EnableMonitorNode

func (this *MonitorNodeDAO) EnableMonitorNode(tx *dbs.Tx, id int64) error

EnableMonitorNode 启用条目

func (*MonitorNodeDAO) FindAllEnabledMonitorNodes

func (this *MonitorNodeDAO) FindAllEnabledMonitorNodes(tx *dbs.Tx) (result []*MonitorNode, err error)

FindAllEnabledMonitorNodes 列出所有可用监控节点

func (*MonitorNodeDAO) FindEnabledMonitorNode

func (this *MonitorNodeDAO) FindEnabledMonitorNode(tx *dbs.Tx, id int64) (*MonitorNode, error)

FindEnabledMonitorNode 查找启用中的条目

func (*MonitorNodeDAO) FindEnabledMonitorNodeIdWithUniqueId

func (this *MonitorNodeDAO) FindEnabledMonitorNodeIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledMonitorNodeIdWithUniqueId 根据唯一ID获取节点ID

func (*MonitorNodeDAO) FindEnabledMonitorNodeWithUniqueId

func (this *MonitorNodeDAO) FindEnabledMonitorNodeWithUniqueId(tx *dbs.Tx, uniqueId string) (*MonitorNode, error)

FindEnabledMonitorNodeWithUniqueId 根据唯一ID获取节点信息

func (*MonitorNodeDAO) FindMonitorNodeName

func (this *MonitorNodeDAO) FindMonitorNodeName(tx *dbs.Tx, id int64) (string, error)

FindMonitorNodeName 根据主键查找名称

func (*MonitorNodeDAO) GenUniqueId

func (this *MonitorNodeDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*MonitorNodeDAO) ListEnabledMonitorNodes

func (this *MonitorNodeDAO) ListEnabledMonitorNodes(tx *dbs.Tx, offset int64, size int64) (result []*MonitorNode, err error)

ListEnabledMonitorNodes 列出单页的监控节点

func (*MonitorNodeDAO) UpdateMonitorNode

func (this *MonitorNodeDAO) UpdateMonitorNode(tx *dbs.Tx, nodeId int64, name string, description string, isOn bool) error

UpdateMonitorNode 修改监控节点

func (*MonitorNodeDAO) UpdateNodeStatus

func (this *MonitorNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, statusJSON []byte) error

UpdateNodeStatus 更改节点状态

type MonitorNodeOperator

type MonitorNodeOperator struct {
	Id          interface{} // ID
	IsOn        interface{} // 是否启用
	UniqueId    interface{} // 唯一ID
	Secret      interface{} // 密钥
	Name        interface{} // 名称
	Description interface{} // 描述
	Order       interface{} // 排序
	State       interface{} // 状态
	CreatedAt   interface{} // 创建时间
	AdminId     interface{} // 管理员ID
	Weight      interface{} // 权重
	Status      interface{} // 运行状态
}

func NewMonitorNodeOperator

func NewMonitorNodeOperator() *MonitorNodeOperator

type NSAccessLog

type NSAccessLog struct {
	Id         uint64   `field:"id"`         // ID
	NodeId     uint32   `field:"nodeId"`     // 节点ID
	DomainId   uint32   `field:"domainId"`   // 域名ID
	RecordId   uint32   `field:"recordId"`   // 记录ID
	Content    dbs.JSON `field:"content"`    // 访问数据
	RequestId  string   `field:"requestId"`  // 请求ID
	CreatedAt  uint64   `field:"createdAt"`  // 创建时间
	RemoteAddr string   `field:"remoteAddr"` // IP
}

NSAccessLog 域名服务访问日志

func (*NSAccessLog) ToPB

func (this *NSAccessLog) ToPB() (*pb.NSAccessLog, error)

ToPB 转换成PB对象

type NSAccessLogOperator

type NSAccessLogOperator struct {
	Id         interface{} // ID
	NodeId     interface{} // 节点ID
	DomainId   interface{} // 域名ID
	RecordId   interface{} // 记录ID
	Content    interface{} // 访问数据
	RequestId  interface{} // 请求ID
	CreatedAt  interface{} // 创建时间
	RemoteAddr interface{} // IP
}

func NewNSAccessLogOperator

func NewNSAccessLogOperator() *NSAccessLogOperator

type NSCluster

type NSCluster struct {
	Id              uint32   `field:"id"`              // ID
	IsOn            bool     `field:"isOn"`            // 是否启用
	Name            string   `field:"name"`            // 集群名
	InstallDir      string   `field:"installDir"`      // 安装目录
	State           uint8    `field:"state"`           // 状态
	AccessLog       dbs.JSON `field:"accessLog"`       // 访问日志配置
	GrantId         uint32   `field:"grantId"`         // 授权ID
	Recursion       dbs.JSON `field:"recursion"`       // 递归DNS设置
	Tcp             dbs.JSON `field:"tcp"`             // TCP设置
	Tls             dbs.JSON `field:"tls"`             // TLS设置
	Udp             dbs.JSON `field:"udp"`             // UDP设置
	DdosProtection  dbs.JSON `field:"ddosProtection"`  // DDoS防护设置
	Hosts           dbs.JSON `field:"hosts"`           // DNS主机地址
	Soa             dbs.JSON `field:"soa"`             // SOA配置
	AutoRemoteStart bool     `field:"autoRemoteStart"` // 自动远程启动
	TimeZone        string   `field:"timeZone"`        // 时区
	Answer          dbs.JSON `field:"answer"`          // 应答设置
	SoaSerial       uint64   `field:"soaSerial"`       // SOA序列号
	Email           string   `field:"email"`           // 管理员邮箱
}

NSCluster 域名服务器集群

func (*NSCluster) DecodeDDoSProtection added in v0.5.2

func (this *NSCluster) DecodeDDoSProtection() *ddosconfigs.ProtectionConfig

DecodeDDoSProtection 解析DDOS Protection设置

func (*NSCluster) HasDDoSProtection added in v0.5.2

func (this *NSCluster) HasDDoSProtection() bool

HasDDoSProtection 检查是否有DDOS设置

type NSClusterDAO

type NSClusterDAO dbs.DAO
var SharedNSClusterDAO *NSClusterDAO

func NewNSClusterDAO

func NewNSClusterDAO() *NSClusterDAO

func (*NSClusterDAO) CountAllClustersWithSSLPolicyIds added in v0.5.0

func (this *NSClusterDAO) CountAllClustersWithSSLPolicyIds(tx *dbs.Tx, sslPolicyIds []int64) (count int64, err error)

CountAllClustersWithSSLPolicyIds 计算使用SSL策略的所有NS集群数量

func (*NSClusterDAO) CountAllEnabledClusters

func (this *NSClusterDAO) CountAllEnabledClusters(tx *dbs.Tx) (int64, error)

CountAllEnabledClusters 计算可用集群数量

func (*NSClusterDAO) DisableNSCluster

func (this *NSClusterDAO) DisableNSCluster(tx *dbs.Tx, clusterId int64) error

DisableNSCluster 禁用条目

func (*NSClusterDAO) EnableNSCluster

func (this *NSClusterDAO) EnableNSCluster(tx *dbs.Tx, id int64) error

EnableNSCluster 启用条目

func (*NSClusterDAO) FindAllEnabledClusterIds

func (this *NSClusterDAO) FindAllEnabledClusterIds(tx *dbs.Tx) ([]int64, error)

FindAllEnabledClusterIds 获取所有集群IDs

func (*NSClusterDAO) FindAllEnabledClusters

func (this *NSClusterDAO) FindAllEnabledClusters(tx *dbs.Tx) (result []*NSCluster, err error)

FindAllEnabledClusters 列出所有集群

func (*NSClusterDAO) FindClusterGrantId

func (this *NSClusterDAO) FindClusterGrantId(tx *dbs.Tx, clusterId int64) (int64, error)

FindClusterGrantId 查找集群的认证ID

func (*NSClusterDAO) FindEnabledNSCluster

func (this *NSClusterDAO) FindEnabledNSCluster(tx *dbs.Tx, id int64) (*NSCluster, error)

FindEnabledNSCluster 查找启用中的条目

func (*NSClusterDAO) FindEnabledNSClusterName

func (this *NSClusterDAO) FindEnabledNSClusterName(tx *dbs.Tx, id int64) (string, error)

FindEnabledNSClusterName 查找启用中的条目名称

func (*NSClusterDAO) ListEnabledClusters

func (this *NSClusterDAO) ListEnabledClusters(tx *dbs.Tx, offset int64, size int64) (result []*NSCluster, err error)

ListEnabledClusters 列出单页集群

func (*NSClusterDAO) NotifyUpdate

func (this *NSClusterDAO) NotifyUpdate(tx *dbs.Tx, clusterId int64) error

NotifyUpdate 通知更改

type NSClusterOperator

type NSClusterOperator struct {
	Id              any // ID
	IsOn            any // 是否启用
	Name            any // 集群名
	InstallDir      any // 安装目录
	State           any // 状态
	AccessLog       any // 访问日志配置
	GrantId         any // 授权ID
	Recursion       any // 递归DNS设置
	Tcp             any // TCP设置
	Tls             any // TLS设置
	Udp             any // UDP设置
	DdosProtection  any // DDoS防护设置
	Hosts           any // DNS主机地址
	Soa             any // SOA配置
	AutoRemoteStart any // 自动远程启动
	TimeZone        any // 时区
	Answer          any // 应答设置
	SoaSerial       any // SOA序列号
	Email           any // 管理员邮箱
}

func NewNSClusterOperator

func NewNSClusterOperator() *NSClusterOperator

type NSNode

type NSNode struct {
	Id                 uint32   `field:"id"`                 // ID
	AdminId            uint32   `field:"adminId"`            // 管理员ID
	ClusterId          uint32   `field:"clusterId"`          // 集群ID
	Name               string   `field:"name"`               // 节点名称
	IsOn               bool     `field:"isOn"`               // 是否启用
	Status             dbs.JSON `field:"status"`             // 运行状态
	UniqueId           string   `field:"uniqueId"`           // 节点ID
	Secret             string   `field:"secret"`             // 密钥
	IsUp               bool     `field:"isUp"`               // 是否运行
	IsInstalled        bool     `field:"isInstalled"`        // 是否已安装
	InstallStatus      dbs.JSON `field:"installStatus"`      // 安装状态
	InstallDir         string   `field:"installDir"`         // 安装目录
	State              uint8    `field:"state"`              // 状态
	IsActive           bool     `field:"isActive"`           // 是否活跃
	StatusIsNotified   uint8    `field:"statusIsNotified"`   // 活跃状态已经通知
	InactiveNotifiedAt uint64   `field:"inactiveNotifiedAt"` // 离线通知时间
	ConnectedAPINodes  dbs.JSON `field:"connectedAPINodes"`  // 当前连接的API节点
	DdosProtection     dbs.JSON `field:"ddosProtection"`     // DDoS防护设置
}

NSNode 域名服务器节点

func (*NSNode) DecodeConnectedAPINodes added in v0.5.2

func (this *NSNode) DecodeConnectedAPINodes() []int64

DecodeConnectedAPINodes 解析连接的API节点列表

func (*NSNode) DecodeDDoSProtection added in v0.5.2

func (this *NSNode) DecodeDDoSProtection() *ddosconfigs.ProtectionConfig

DecodeDDoSProtection 解析DDoS Protection设置

func (*NSNode) DecodeInstallStatus

func (this *NSNode) DecodeInstallStatus() (*NodeInstallStatus, error)

DecodeInstallStatus 安装状态

func (*NSNode) DecodeStatus

func (this *NSNode) DecodeStatus() (*nodeconfigs.NodeStatus, error)

DecodeStatus 节点状态

func (*NSNode) HasDDoSProtection added in v0.5.2

func (this *NSNode) HasDDoSProtection() bool

HasDDoSProtection 检查是否有DDOS设置

type NSNodeDAO

type NSNodeDAO dbs.DAO
var SharedNSNodeDAO *NSNodeDAO

func NewNSNodeDAO

func NewNSNodeDAO() *NSNodeDAO

func (*NSNodeDAO) CountAllLowerVersionNodes

func (this *NSNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有节点中低于某个版本的节点数量

func (*NSNodeDAO) CountAllLowerVersionNodesWithClusterId

func (this *NSNodeDAO) CountAllLowerVersionNodesWithClusterId(tx *dbs.Tx, clusterId int64, os string, arch string, version string) (int64, error)

CountAllLowerVersionNodesWithClusterId 计算单个集群中所有低于某个版本的节点数量

func (*NSNodeDAO) DisableNSNode

func (this *NSNodeDAO) DisableNSNode(tx *dbs.Tx, nodeId int64) error

DisableNSNode 禁用条目

func (*NSNodeDAO) EnableNSNode

func (this *NSNodeDAO) EnableNSNode(tx *dbs.Tx, id int64) error

EnableNSNode 启用条目

func (*NSNodeDAO) FindEnabledNSNode

func (this *NSNodeDAO) FindEnabledNSNode(tx *dbs.Tx, id int64) (*NSNode, error)

FindEnabledNSNode 查找启用中的条目

func (*NSNodeDAO) FindEnabledNSNodeName

func (this *NSNodeDAO) FindEnabledNSNodeName(tx *dbs.Tx, nodeId int64) (string, error)

FindEnabledNSNodeName 查找节点名称

func (*NSNodeDAO) FindEnabledNodeIdWithUniqueId

func (this *NSNodeDAO) FindEnabledNodeIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledNodeIdWithUniqueId 根据唯一ID获取节点ID

func (*NSNodeDAO) FindNodeClusterId

func (this *NSNodeDAO) FindNodeClusterId(tx *dbs.Tx, nodeId int64) (int64, error)

FindNodeClusterId 获取节点的集群ID

func (*NSNodeDAO) GenUniqueId

func (this *NSNodeDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*NSNodeDAO) NotifyDNSUpdate

func (this *NSNodeDAO) NotifyDNSUpdate(tx *dbs.Tx, nodeId int64) error

NotifyDNSUpdate 通知DNS更新

func (*NSNodeDAO) NotifyUpdate

func (this *NSNodeDAO) NotifyUpdate(tx *dbs.Tx, nodeId int64) error

NotifyUpdate 通知更新

func (*NSNodeDAO) UpdateNodeIsInstalled

func (this *NSNodeDAO) UpdateNodeIsInstalled(tx *dbs.Tx, nodeId int64, isInstalled bool) error

UpdateNodeIsInstalled 设置节点安装状态

func (*NSNodeDAO) UpdateNodeStatus

func (this *NSNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, nodeStatus *nodeconfigs.NodeStatus) error

UpdateNodeStatus 更改节点状态

type NSNodeOperator

type NSNodeOperator struct {
	Id                 any // ID
	AdminId            any // 管理员ID
	ClusterId          any // 集群ID
	Name               any // 节点名称
	IsOn               any // 是否启用
	Status             any // 运行状态
	UniqueId           any // 节点ID
	Secret             any // 密钥
	IsUp               any // 是否运行
	IsInstalled        any // 是否已安装
	InstallStatus      any // 安装状态
	InstallDir         any // 安装目录
	State              any // 状态
	IsActive           any // 是否活跃
	StatusIsNotified   any // 活跃状态已经通知
	InactiveNotifiedAt any // 离线通知时间
	ConnectedAPINodes  any // 当前连接的API节点
	DdosProtection     any // DDoS防护设置
}

func NewNSNodeOperator

func NewNSNodeOperator() *NSNodeOperator

type Node

type Node struct {
	Id                     uint32   `field:"id"`                     // ID
	AdminId                uint32   `field:"adminId"`                // 管理员ID
	UserId                 uint32   `field:"userId"`                 // 用户ID
	Level                  uint8    `field:"level"`                  // 级别
	LnAddrs                dbs.JSON `field:"lnAddrs"`                // Ln级别访问地址
	IsOn                   bool     `field:"isOn"`                   // 是否启用
	IsUp                   bool     `field:"isUp"`                   // 是否在线
	CountUp                uint32   `field:"countUp"`                // 连续在线次数
	CountDown              uint32   `field:"countDown"`              // 连续下线次数
	IsActive               bool     `field:"isActive"`               // 是否活跃
	InactiveNotifiedAt     uint64   `field:"inactiveNotifiedAt"`     // 离线通知时间
	UniqueId               string   `field:"uniqueId"`               // 节点ID
	Secret                 string   `field:"secret"`                 // 密钥
	Name                   string   `field:"name"`                   // 节点名
	Code                   string   `field:"code"`                   // 代号
	ClusterId              uint32   `field:"clusterId"`              // 主集群ID
	SecondaryClusterIds    dbs.JSON `field:"secondaryClusterIds"`    // 从集群ID
	RegionId               uint32   `field:"regionId"`               // 区域ID
	GroupId                uint32   `field:"groupId"`                // 分组ID
	CreatedAt              uint64   `field:"createdAt"`              // 创建时间
	Status                 dbs.JSON `field:"status"`                 // 最新的状态
	Version                uint32   `field:"version"`                // 当前版本号
	LatestVersion          uint32   `field:"latestVersion"`          // 最后版本号
	InstallDir             string   `field:"installDir"`             // 安装目录
	IsInstalled            bool     `field:"isInstalled"`            // 是否已安装
	InstallStatus          dbs.JSON `field:"installStatus"`          // 安装状态
	State                  uint8    `field:"state"`                  // 状态
	ConnectedAPINodes      dbs.JSON `field:"connectedAPINodes"`      // 当前连接的API节点
	MaxCPU                 uint32   `field:"maxCPU"`                 // 可以使用的最多CPU
	MaxThreads             uint32   `field:"maxThreads"`             // 最大线程数
	DdosProtection         dbs.JSON `field:"ddosProtection"`         // DDOS配置
	DnsRoutes              dbs.JSON `field:"dnsRoutes"`              // DNS线路设置
	MaxCacheDiskCapacity   dbs.JSON `field:"maxCacheDiskCapacity"`   // 硬盘缓存容量
	MaxCacheMemoryCapacity dbs.JSON `field:"maxCacheMemoryCapacity"` // 内存缓存容量
	CacheDiskDir           string   `field:"cacheDiskDir"`           // 缓存目录
	DnsResolver            dbs.JSON `field:"dnsResolver"`            // DNS解析器
}

Node 节点

func (*Node) AllClusterIds

func (this *Node) AllClusterIds() []int64

AllClusterIds 获取所属集群IDs

func (*Node) DNSRouteCodes

func (this *Node) DNSRouteCodes() map[int64][]string

DNSRouteCodes 所有的DNS线路

func (*Node) DNSRouteCodesForDomainId

func (this *Node) DNSRouteCodesForDomainId(dnsDomainId int64) ([]string, error)

DNSRouteCodesForDomainId DNS线路

func (*Node) DecodeConnectedAPINodeIds

func (this *Node) DecodeConnectedAPINodeIds() ([]int64, error)

DecodeConnectedAPINodeIds 连接的API

func (*Node) DecodeDDoSProtection

func (this *Node) DecodeDDoSProtection() *ddosconfigs.ProtectionConfig

DecodeDDoSProtection 解析DDoS Protection设置

func (*Node) DecodeDNSResolver

func (this *Node) DecodeDNSResolver() *nodeconfigs.DNSResolverConfig

DecodeDNSResolver 解析DNS解析主机配置

func (*Node) DecodeInstallStatus

func (this *Node) DecodeInstallStatus() (*NodeInstallStatus, error)

DecodeInstallStatus 安装状态

func (*Node) DecodeLnAddrs added in v0.5.2

func (this *Node) DecodeLnAddrs() []string

func (*Node) DecodeMaxCacheDiskCapacity

func (this *Node) DecodeMaxCacheDiskCapacity() *shared.SizeCapacity

func (*Node) DecodeMaxCacheMemoryCapacity

func (this *Node) DecodeMaxCacheMemoryCapacity() *shared.SizeCapacity

func (*Node) DecodeSecondaryClusterIds

func (this *Node) DecodeSecondaryClusterIds() []int64

DecodeSecondaryClusterIds 从集群IDs

func (*Node) DecodeStatus

func (this *Node) DecodeStatus() (*nodeconfigs.NodeStatus, error)

DecodeStatus 节点状态

func (*Node) HasDDoSProtection

func (this *Node) HasDDoSProtection() bool

HasDDoSProtection 检查是否有DDOS设置

type NodeCluster

type NodeCluster struct {
	Id                   uint32   `field:"id"`                   // ID
	AdminId              uint32   `field:"adminId"`              // 管理员ID
	UserId               uint32   `field:"userId"`               // 用户ID
	IsOn                 bool     `field:"isOn"`                 // 是否启用
	Name                 string   `field:"name"`                 // 名称
	UseAllAPINodes       uint8    `field:"useAllAPINodes"`       // 是否使用所有API节点
	ApiNodes             dbs.JSON `field:"apiNodes"`             // 使用的API节点
	InstallDir           string   `field:"installDir"`           // 安装目录
	Order                uint32   `field:"order"`                // 排序
	CreatedAt            uint64   `field:"createdAt"`            // 创建时间
	GrantId              uint32   `field:"grantId"`              // 默认认证方式
	State                uint8    `field:"state"`                // 状态
	AutoRegister         uint8    `field:"autoRegister"`         // 是否开启自动注册
	UniqueId             string   `field:"uniqueId"`             // 唯一ID
	Secret               string   `field:"secret"`               // 密钥
	HealthCheck          dbs.JSON `field:"healthCheck"`          // 健康检查
	DnsName              string   `field:"dnsName"`              // DNS名称
	DnsDomainId          uint32   `field:"dnsDomainId"`          // 域名ID
	Dns                  dbs.JSON `field:"dns"`                  // DNS配置
	Toa                  dbs.JSON `field:"toa"`                  // TOA配置
	CachePolicyId        uint32   `field:"cachePolicyId"`        // 缓存策略ID
	HttpFirewallPolicyId uint32   `field:"httpFirewallPolicyId"` // WAF策略ID
	AccessLog            dbs.JSON `field:"accessLog"`            // 访问日志设置
	SystemServices       dbs.JSON `field:"systemServices"`       // 系统服务设置
	TimeZone             string   `field:"timeZone"`             // 时区
	NodeMaxThreads       uint32   `field:"nodeMaxThreads"`       // 节点最大线程数
	DdosProtection       dbs.JSON `field:"ddosProtection"`       // DDoS防护设置
	AutoOpenPorts        uint8    `field:"autoOpenPorts"`        // 是否自动尝试开放端口
	IsPinned             bool     `field:"isPinned"`             // 是否置顶
	Webp                 dbs.JSON `field:"webp"`                 // WebP设置
	Uam                  dbs.JSON `field:"uam"`                  // UAM设置
	Clock                dbs.JSON `field:"clock"`                // 时钟配置
	GlobalServerConfig   dbs.JSON `field:"globalServerConfig"`   // 全局服务配置
	AutoRemoteStart      bool     `field:"autoRemoteStart"`      // 自动远程启动
	AutoInstallNftables  bool     `field:"autoInstallNftables"`  // 自动安装nftables
}

NodeCluster 节点集群

func (*NodeCluster) DecodeClock added in v0.5.3

func (this *NodeCluster) DecodeClock() *nodeconfigs.ClockConfig

DecodeClock 解析时钟配置

func (*NodeCluster) DecodeDDoSProtection

func (this *NodeCluster) DecodeDDoSProtection() *ddosconfigs.ProtectionConfig

DecodeDDoSProtection 解析DDOS Protection设置

func (*NodeCluster) DecodeDNSConfig

func (this *NodeCluster) DecodeDNSConfig() (*dnsconfigs.ClusterDNSConfig, error)

DecodeDNSConfig 解析DNS配置

func (*NodeCluster) DecodeGlobalServerConfig added in v0.5.3

func (this *NodeCluster) DecodeGlobalServerConfig() *serverconfigs.GlobalServerConfig

DecodeGlobalServerConfig 解析全局服务配置

func (*NodeCluster) HasDDoSProtection

func (this *NodeCluster) HasDDoSProtection() bool

HasDDoSProtection 检查是否有DDOS设置

type NodeClusterDAO

type NodeClusterDAO dbs.DAO
var SharedNodeClusterDAO *NodeClusterDAO

func NewNodeClusterDAO

func NewNodeClusterDAO() *NodeClusterDAO

func (*NodeClusterDAO) CheckNodeClusterIsOn

func (this *NodeClusterDAO) CheckNodeClusterIsOn(tx *dbs.Tx, clusterId int64) (bool, error)

CheckNodeClusterIsOn 获取集群是否正在启用状态

func (*NodeClusterDAO) CountAllEnabledClusters

func (this *NodeClusterDAO) CountAllEnabledClusters(tx *dbs.Tx, keyword string) (int64, error)

CountAllEnabledClusters 计算所有集群数量

func (*NodeClusterDAO) CountAllEnabledClustersWithDNSDomainId

func (this *NodeClusterDAO) CountAllEnabledClustersWithDNSDomainId(tx *dbs.Tx, dnsDomainId int64) (int64, error)

CountAllEnabledClustersWithDNSDomainId 计算使用某个DNS域名的集群数量

func (*NodeClusterDAO) CountAllEnabledClustersWithDNSProviderId

func (this *NodeClusterDAO) CountAllEnabledClustersWithDNSProviderId(tx *dbs.Tx, dnsProviderId int64) (int64, error)

CountAllEnabledClustersWithDNSProviderId 计算使用某个DNS服务商的集群数量

func (*NodeClusterDAO) CountAllEnabledClustersWithGrantId

func (this *NodeClusterDAO) CountAllEnabledClustersWithGrantId(tx *dbs.Tx, grantId int64) (int64, error)

CountAllEnabledClustersWithGrantId 计算使用某个认证的集群数量

func (*NodeClusterDAO) CountAllEnabledNodeClustersWithHTTPCachePolicyId

func (this *NodeClusterDAO) CountAllEnabledNodeClustersWithHTTPCachePolicyId(tx *dbs.Tx, httpCachePolicyId int64) (int64, error)

CountAllEnabledNodeClustersWithHTTPCachePolicyId 计算使用某个缓存策略的集群数量

func (*NodeClusterDAO) CountAllEnabledNodeClustersWithHTTPFirewallPolicyId

func (this *NodeClusterDAO) CountAllEnabledNodeClustersWithHTTPFirewallPolicyId(tx *dbs.Tx, httpFirewallPolicyId int64) (int64, error)

CountAllEnabledNodeClustersWithHTTPFirewallPolicyId 计算使用某个WAF策略的集群数量

func (*NodeClusterDAO) CreateCluster

func (this *NodeClusterDAO) CreateCluster(tx *dbs.Tx, adminId int64, name string, grantId int64, installDir string, dnsDomainId int64, dnsName string, dnsTTL int32, cachePolicyId int64, httpFirewallPolicyId int64, systemServices map[string]maps.Map, globalServerConfig *serverconfigs.GlobalServerConfig, autoInstallNftables bool) (clusterId int64, err error)

CreateCluster 创建集群

func (*NodeClusterDAO) DisableNodeCluster

func (this *NodeClusterDAO) DisableNodeCluster(tx *dbs.Tx, clusterId int64) error

DisableNodeCluster 禁用条目

func (*NodeClusterDAO) EnableNodeCluster

func (this *NodeClusterDAO) EnableNodeCluster(tx *dbs.Tx, id int64) error

EnableNodeCluster 启用条目

func (*NodeClusterDAO) ExistClusterDNSName

func (this *NodeClusterDAO) ExistClusterDNSName(tx *dbs.Tx, dnsName string, excludeClusterId int64) (bool, error)

ExistClusterDNSName 检查某个子域名是否可用

func (*NodeClusterDAO) ExistsEnabledCluster

func (this *NodeClusterDAO) ExistsEnabledCluster(tx *dbs.Tx, clusterId int64) (bool, error)

ExistsEnabledCluster 检查集群是否存在

func (*NodeClusterDAO) FindAllAPINodeAddrsWithCluster

func (this *NodeClusterDAO) FindAllAPINodeAddrsWithCluster(tx *dbs.Tx, clusterId int64) (result []string, err error)

FindAllAPINodeAddrsWithCluster 查找所有API节点地址

func (*NodeClusterDAO) FindAllEnableClusterIds

func (this *NodeClusterDAO) FindAllEnableClusterIds(tx *dbs.Tx) (result []int64, err error)

FindAllEnableClusterIds 查找所有可用的集群Ids

func (*NodeClusterDAO) FindAllEnableClusters

func (this *NodeClusterDAO) FindAllEnableClusters(tx *dbs.Tx) (result []*NodeCluster, err error)

FindAllEnableClusters 查找所有可用的集群

func (*NodeClusterDAO) FindAllEnabledClusterIdsWithDNSDomainId

func (this *NodeClusterDAO) FindAllEnabledClusterIdsWithDNSDomainId(tx *dbs.Tx, dnsDomainId int64) ([]int64, error)

FindAllEnabledClusterIdsWithDNSDomainId 查询使用某个DNS域名的集群ID列表

func (*NodeClusterDAO) FindAllEnabledClustersHaveDNSDomain

func (this *NodeClusterDAO) FindAllEnabledClustersHaveDNSDomain(tx *dbs.Tx) (result []*NodeCluster, err error)

FindAllEnabledClustersHaveDNSDomain 查询已经设置了域名的集群

func (*NodeClusterDAO) FindAllEnabledClustersWithDNSDomainId

func (this *NodeClusterDAO) FindAllEnabledClustersWithDNSDomainId(tx *dbs.Tx, dnsDomainId int64) (result []*NodeCluster, err error)

FindAllEnabledClustersWithDNSDomainId 查询使用某个DNS域名的所有集群域名

func (*NodeClusterDAO) FindAllEnabledClustersWithDNSProviderId

func (this *NodeClusterDAO) FindAllEnabledClustersWithDNSProviderId(tx *dbs.Tx, dnsProviderId int64) (result []*NodeCluster, err error)

FindAllEnabledClustersWithDNSProviderId 获取所有使用某个DNS服务商的集群

func (*NodeClusterDAO) FindAllEnabledClustersWithGrantId

func (this *NodeClusterDAO) FindAllEnabledClustersWithGrantId(tx *dbs.Tx, grantId int64) (result []*NodeCluster, err error)

FindAllEnabledClustersWithGrantId 获取使用某个认证的所有集群

func (*NodeClusterDAO) FindAllEnabledNodeClusterIds

func (this *NodeClusterDAO) FindAllEnabledNodeClusterIds(tx *dbs.Tx) ([]int64, error)

FindAllEnabledNodeClusterIds 查找所有可用的集群

func (*NodeClusterDAO) FindAllEnabledNodeClusterIdsWithCachePolicyId

func (this *NodeClusterDAO) FindAllEnabledNodeClusterIdsWithCachePolicyId(tx *dbs.Tx, cachePolicyId int64) (result []int64, err error)

FindAllEnabledNodeClusterIdsWithCachePolicyId 查找使用缓存策略的所有集群Ids

func (*NodeClusterDAO) FindAllEnabledNodeClusterIdsWithHTTPFirewallPolicyId

func (this *NodeClusterDAO) FindAllEnabledNodeClusterIdsWithHTTPFirewallPolicyId(tx *dbs.Tx, httpFirewallPolicyId int64) (result []int64, err error)

FindAllEnabledNodeClusterIdsWithHTTPFirewallPolicyId 查找使用WAF策略的所有集群Ids

func (*NodeClusterDAO) FindAllEnabledNodeClustersWithHTTPCachePolicyId

func (this *NodeClusterDAO) FindAllEnabledNodeClustersWithHTTPCachePolicyId(tx *dbs.Tx, httpCachePolicyId int64) (result []*NodeCluster, err error)

FindAllEnabledNodeClustersWithHTTPCachePolicyId 查找使用缓存策略的所有集群

func (*NodeClusterDAO) FindAllEnabledNodeClustersWithHTTPFirewallPolicyId

func (this *NodeClusterDAO) FindAllEnabledNodeClustersWithHTTPFirewallPolicyId(tx *dbs.Tx, httpFirewallPolicyId int64) (result []*NodeCluster, err error)

FindAllEnabledNodeClustersWithHTTPFirewallPolicyId 查找使用WAF策略的所有集群

func (*NodeClusterDAO) FindClusterAdminId

func (this *NodeClusterDAO) FindClusterAdminId(tx *dbs.Tx, clusterId int64) (int64, error)

FindClusterAdminId 查找集群所属管理员

func (*NodeClusterDAO) FindClusterBasicInfo

func (this *NodeClusterDAO) FindClusterBasicInfo(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (*NodeCluster, error)

FindClusterBasicInfo 查找集群基础信息

func (*NodeClusterDAO) FindClusterDDoSProtection

func (this *NodeClusterDAO) FindClusterDDoSProtection(tx *dbs.Tx, clusterId int64) (*ddosconfigs.ProtectionConfig, error)

FindClusterDDoSProtection 获取集群的DDoS设置

func (*NodeClusterDAO) FindClusterDNSInfo

func (this *NodeClusterDAO) FindClusterDNSInfo(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (*NodeCluster, error)

FindClusterDNSInfo 查找DNS信息

func (*NodeClusterDAO) FindClusterGlobalServerConfig added in v0.5.3

func (this *NodeClusterDAO) FindClusterGlobalServerConfig(tx *dbs.Tx, clusterId int64) (*serverconfigs.GlobalServerConfig, error)

FindClusterGlobalServerConfig 查询全局服务配置

func (*NodeClusterDAO) FindClusterGrantId

func (this *NodeClusterDAO) FindClusterGrantId(tx *dbs.Tx, clusterId int64) (int64, error)

FindClusterGrantId 查找集群的认证ID

func (*NodeClusterDAO) FindClusterHTTPCachePolicyId

func (this *NodeClusterDAO) FindClusterHTTPCachePolicyId(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (int64, error)

FindClusterHTTPCachePolicyId 获取集群的缓存策略ID

func (*NodeClusterDAO) FindClusterHTTPFirewallPolicyId

func (this *NodeClusterDAO) FindClusterHTTPFirewallPolicyId(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (int64, error)

FindClusterHTTPFirewallPolicyId 获取集群的WAF策略ID

func (*NodeClusterDAO) FindClusterHealthCheckConfig

func (this *NodeClusterDAO) FindClusterHealthCheckConfig(tx *dbs.Tx, clusterId int64) (*serverconfigs.HealthCheckConfig, error)

FindClusterHealthCheckConfig 查找健康检查设置

func (*NodeClusterDAO) FindClusterTOAConfig

func (this *NodeClusterDAO) FindClusterTOAConfig(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (*nodeconfigs.TOAConfig, error)

FindClusterTOAConfig 查找集群的TOA设置

func (*NodeClusterDAO) FindClusterUAMPolicy added in v0.4.9

func (this *NodeClusterDAO) FindClusterUAMPolicy(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (*nodeconfigs.UAMPolicy, error)

FindClusterUAMPolicy 查询设置

func (*NodeClusterDAO) FindClusterWebPPolicy

func (this *NodeClusterDAO) FindClusterWebPPolicy(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (*nodeconfigs.WebPImagePolicy, error)

FindClusterWebPPolicy 查询WebP设置

func (*NodeClusterDAO) FindEnabledClusterIdWithUniqueId

func (this *NodeClusterDAO) FindEnabledClusterIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledClusterIdWithUniqueId 根据UniqueId获取ID TODO 增加缓存

func (*NodeClusterDAO) FindEnabledNodeCluster

func (this *NodeClusterDAO) FindEnabledNodeCluster(tx *dbs.Tx, id int64) (*NodeCluster, error)

FindEnabledNodeCluster 查找集群

func (*NodeClusterDAO) FindEnabledNodeClustersWithIds

func (this *NodeClusterDAO) FindEnabledNodeClustersWithIds(tx *dbs.Tx, clusterIds []int64) (result []*NodeCluster, err error)

FindEnabledNodeClustersWithIds 查找一组集群

func (*NodeClusterDAO) FindLatestNodeClusters

func (this *NodeClusterDAO) FindLatestNodeClusters(tx *dbs.Tx, size int64) (result []*NodeCluster, err error)

FindLatestNodeClusters 查询最近访问的集群

func (*NodeClusterDAO) FindNodeClusterName

func (this *NodeClusterDAO) FindNodeClusterName(tx *dbs.Tx, clusterId int64) (string, error)

FindNodeClusterName 根据主键查找名称

func (*NodeClusterDAO) FindNodeClusterSystemServiceParams

func (this *NodeClusterDAO) FindNodeClusterSystemServiceParams(tx *dbs.Tx, clusterId int64, serviceType nodeconfigs.SystemServiceType) (params maps.Map, err error)

FindNodeClusterSystemServiceParams 查找集群的系统服务设置

func (*NodeClusterDAO) FindNodeClusterSystemServices

func (this *NodeClusterDAO) FindNodeClusterSystemServices(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (services map[string]maps.Map, err error)

FindNodeClusterSystemServices 查找集群的所有服务设置

func (*NodeClusterDAO) GenUniqueId

func (this *NodeClusterDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*NodeClusterDAO) ListEnabledClusters

func (this *NodeClusterDAO) ListEnabledClusters(tx *dbs.Tx, keyword string, offset, size int64) (result []*NodeCluster, err error)

ListEnabledClusters 列出单页集群

func (*NodeClusterDAO) NotifyDNSUpdate

func (this *NodeClusterDAO) NotifyDNSUpdate(tx *dbs.Tx, clusterId int64) error

NotifyDNSUpdate 通知DNS更新 TODO 更新新的DNS解析记录的同时,需要删除老的DNS解析记录

func (*NodeClusterDAO) NotifyUpdate

func (this *NodeClusterDAO) NotifyUpdate(tx *dbs.Tx, clusterId int64) error

NotifyUpdate 通知更新

func (*NodeClusterDAO) UpdateCluster

func (this *NodeClusterDAO) UpdateCluster(tx *dbs.Tx, clusterId int64, name string, grantId int64, installDir string, timezone string, nodeMaxThreads int32, autoOpenPorts bool, clockConfig *nodeconfigs.ClockConfig, autoRemoteStart bool, autoInstallTables bool) error

UpdateCluster 修改集群

func (*NodeClusterDAO) UpdateClusterDDoSProtection

func (this *NodeClusterDAO) UpdateClusterDDoSProtection(tx *dbs.Tx, clusterId int64, ddosProtection *ddosconfigs.ProtectionConfig) error

UpdateClusterDDoSProtection 设置集群的DDoS设置

func (*NodeClusterDAO) UpdateClusterDNS

func (this *NodeClusterDAO) UpdateClusterDNS(tx *dbs.Tx, clusterId int64, dnsName string, dnsDomainId int64, nodesAutoSync bool, serversAutoSync bool, cnameRecords []string, ttl int32, cnameAsDomain bool, includingLnNodes bool) error

UpdateClusterDNS 修改集群DNS相关信息

func (*NodeClusterDAO) UpdateClusterGlobalServerConfig added in v0.5.3

func (this *NodeClusterDAO) UpdateClusterGlobalServerConfig(tx *dbs.Tx, clusterId int64, config *serverconfigs.GlobalServerConfig) error

UpdateClusterGlobalServerConfig 修改全局服务配置

func (*NodeClusterDAO) UpdateClusterHealthCheck

func (this *NodeClusterDAO) UpdateClusterHealthCheck(tx *dbs.Tx, clusterId int64, healthCheckJSON []byte) error

UpdateClusterHealthCheck 修改健康检查设置

func (*NodeClusterDAO) UpdateClusterIsPinned

func (this *NodeClusterDAO) UpdateClusterIsPinned(tx *dbs.Tx, clusterId int64, isPinned bool) error

UpdateClusterIsPinned 设置集群是否置顶

func (*NodeClusterDAO) UpdateClusterTOA

func (this *NodeClusterDAO) UpdateClusterTOA(tx *dbs.Tx, clusterId int64, toaJSON []byte) error

UpdateClusterTOA 修改集群的TOA设置

func (*NodeClusterDAO) UpdateClusterUAMPolicy added in v0.4.9

func (this *NodeClusterDAO) UpdateClusterUAMPolicy(tx *dbs.Tx, clusterId int64, uamPolicy *nodeconfigs.UAMPolicy) error

UpdateClusterUAMPolicy 修改UAM设置

func (*NodeClusterDAO) UpdateClusterWebPPolicy

func (this *NodeClusterDAO) UpdateClusterWebPPolicy(tx *dbs.Tx, clusterId int64, webpPolicy *nodeconfigs.WebPImagePolicy) error

UpdateClusterWebPPolicy 修改WebP设置

func (*NodeClusterDAO) UpdateNodeClusterHTTPCachePolicyId

func (this *NodeClusterDAO) UpdateNodeClusterHTTPCachePolicyId(tx *dbs.Tx, clusterId int64, httpCachePolicyId int64) error

UpdateNodeClusterHTTPCachePolicyId 设置集群的缓存策略

func (*NodeClusterDAO) UpdateNodeClusterHTTPFirewallPolicyId

func (this *NodeClusterDAO) UpdateNodeClusterHTTPFirewallPolicyId(tx *dbs.Tx, clusterId int64, httpFirewallPolicyId int64) error

UpdateNodeClusterHTTPFirewallPolicyId 设置集群的WAF策略

func (*NodeClusterDAO) UpdateNodeClusterSystemService

func (this *NodeClusterDAO) UpdateNodeClusterSystemService(tx *dbs.Tx, clusterId int64, serviceType nodeconfigs.SystemServiceType, params maps.Map) error

UpdateNodeClusterSystemService 修改集群的系统服务设置

type NodeClusterFirewallAction

type NodeClusterFirewallAction struct {
	Id         uint32   `field:"id"`         // ID
	AdminId    uint32   `field:"adminId"`    // 管理员ID
	ClusterId  uint32   `field:"clusterId"`  // 集群ID
	Name       string   `field:"name"`       // 名称
	EventLevel string   `field:"eventLevel"` // 级别
	Type       string   `field:"type"`       // 动作类型
	Params     dbs.JSON `field:"params"`     // 参数
	State      uint8    `field:"state"`      // 状态
}

防火墙动作

func (*NodeClusterFirewallAction) DecodeParams

func (this *NodeClusterFirewallAction) DecodeParams() (maps.Map, error)

DecodeParams 解析参数

type NodeClusterFirewallActionDAO

type NodeClusterFirewallActionDAO dbs.DAO
var SharedNodeClusterFirewallActionDAO *NodeClusterFirewallActionDAO

func NewNodeClusterFirewallActionDAO

func NewNodeClusterFirewallActionDAO() *NodeClusterFirewallActionDAO

func (*NodeClusterFirewallActionDAO) ComposeFirewallActionConfig

func (this *NodeClusterFirewallActionDAO) ComposeFirewallActionConfig(tx *dbs.Tx, action *NodeClusterFirewallAction) (*firewallconfigs.FirewallActionConfig, error)

ComposeFirewallActionConfig 组合配置

func (*NodeClusterFirewallActionDAO) CountAllEnabledFirewallActions

func (this *NodeClusterFirewallActionDAO) CountAllEnabledFirewallActions(tx *dbs.Tx, clusterId int64) (int64, error)

CountAllEnabledFirewallActions 计算动作数量

func (*NodeClusterFirewallActionDAO) CreateFirewallAction

func (this *NodeClusterFirewallActionDAO) CreateFirewallAction(tx *dbs.Tx, adminId int64, clusterId int64, name string, eventLevel, actionType firewallconfigs.FirewallActionType, params maps.Map) (int64, error)

CreateFirewallAction 创建动作

func (*NodeClusterFirewallActionDAO) DisableFirewallAction

func (this *NodeClusterFirewallActionDAO) DisableFirewallAction(tx *dbs.Tx, actionId int64) error

DisableFirewallAction 禁用条目

func (*NodeClusterFirewallActionDAO) EnableFirewallAction

func (this *NodeClusterFirewallActionDAO) EnableFirewallAction(tx *dbs.Tx, id uint32) error

EnableFirewallAction 启用条目

func (*NodeClusterFirewallActionDAO) FindAllEnabledFirewallActions

func (this *NodeClusterFirewallActionDAO) FindAllEnabledFirewallActions(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (result []*NodeClusterFirewallAction, err error)

FindAllEnabledFirewallActions 查找所有集群的动作

func (*NodeClusterFirewallActionDAO) FindEnabledFirewallAction

func (this *NodeClusterFirewallActionDAO) FindEnabledFirewallAction(tx *dbs.Tx, actionId int64) (*NodeClusterFirewallAction, error)

FindEnabledFirewallAction 查找启用中的条目

func (*NodeClusterFirewallActionDAO) FindFirewallActionName

func (this *NodeClusterFirewallActionDAO) FindFirewallActionName(tx *dbs.Tx, id uint32) (string, error)

FindFirewallActionName 根据主键查找名称

func (*NodeClusterFirewallActionDAO) NotifyUpdate

func (this *NodeClusterFirewallActionDAO) NotifyUpdate(tx *dbs.Tx, actionId int64) error

NotifyUpdate 通知更新

func (*NodeClusterFirewallActionDAO) UpdateFirewallAction

func (this *NodeClusterFirewallActionDAO) UpdateFirewallAction(tx *dbs.Tx, actionId int64, name string, eventLevel string, actionType firewallconfigs.FirewallActionType, params maps.Map) error

UpdateFirewallAction 修改动作

type NodeClusterFirewallActionOperator

type NodeClusterFirewallActionOperator struct {
	Id         interface{} // ID
	AdminId    interface{} // 管理员ID
	ClusterId  interface{} // 集群ID
	Name       interface{} // 名称
	EventLevel interface{} // 级别
	Type       interface{} // 动作类型
	Params     interface{} // 参数
	State      interface{} // 状态
}

func NewNodeClusterFirewallActionOperator

func NewNodeClusterFirewallActionOperator() *NodeClusterFirewallActionOperator

type NodeClusterMetricItem

type NodeClusterMetricItem struct {
	Id        uint32 `field:"id"`        // ID
	IsOn      bool   `field:"isOn"`      // 是否启用
	ClusterId uint32 `field:"clusterId"` // 集群ID
	ItemId    uint64 `field:"itemId"`    // 指标ID
	State     uint8  `field:"state"`     // 是否启用
}

NodeClusterMetricItem 集群使用的指标

type NodeClusterMetricItemDAO

type NodeClusterMetricItemDAO dbs.DAO
var SharedNodeClusterMetricItemDAO *NodeClusterMetricItemDAO

func NewNodeClusterMetricItemDAO

func NewNodeClusterMetricItemDAO() *NodeClusterMetricItemDAO

func (*NodeClusterMetricItemDAO) CountAllClusterItems

func (this *NodeClusterMetricItemDAO) CountAllClusterItems(tx *dbs.Tx, clusterId int64) (int64, error)

CountAllClusterItems 计算集群中指标数量

func (*NodeClusterMetricItemDAO) DisableClusterItem

func (this *NodeClusterMetricItemDAO) DisableClusterItem(tx *dbs.Tx, clusterId int64, itemId int64) error

DisableClusterItem 禁用某个集群的指标

func (*NodeClusterMetricItemDAO) DisableNodeClusterMetricItem

func (this *NodeClusterMetricItemDAO) DisableNodeClusterMetricItem(tx *dbs.Tx, id uint32) error

DisableNodeClusterMetricItem 禁用条目

func (*NodeClusterMetricItemDAO) EnableClusterItem

func (this *NodeClusterMetricItemDAO) EnableClusterItem(tx *dbs.Tx, clusterId int64, itemId int64) error

EnableClusterItem 启用某个集群的指标

func (*NodeClusterMetricItemDAO) EnableNodeClusterMetricItem

func (this *NodeClusterMetricItemDAO) EnableNodeClusterMetricItem(tx *dbs.Tx, id uint32) error

EnableNodeClusterMetricItem 启用条目

func (*NodeClusterMetricItemDAO) ExistsClusterItem

func (this *NodeClusterMetricItemDAO) ExistsClusterItem(tx *dbs.Tx, clusterId int64, itemId int64) (bool, error)

ExistsClusterItem 是否存在

func (*NodeClusterMetricItemDAO) FindAllClusterIdsWithItemId

func (this *NodeClusterMetricItemDAO) FindAllClusterIdsWithItemId(tx *dbs.Tx, itemId int64) (clusterIds []int64, err error)

FindAllClusterIdsWithItemId 查找使用某个指标的所有集群IDs

func (*NodeClusterMetricItemDAO) FindAllClusterItemIds

func (this *NodeClusterMetricItemDAO) FindAllClusterItemIds(tx *dbs.Tx, clusterId int64, cacheMap *utils.CacheMap) (result []int64, err error)

FindAllClusterItemIds 查找某个集群的指标Ids

func (*NodeClusterMetricItemDAO) FindAllClusterItems

func (this *NodeClusterMetricItemDAO) FindAllClusterItems(tx *dbs.Tx, clusterId int64, category string) (result []*NodeClusterMetricItem, err error)

FindAllClusterItems 查找某个集群的指标 category 不填写即表示获取所有指标

func (*NodeClusterMetricItemDAO) FindEnabledNodeClusterMetricItem

func (this *NodeClusterMetricItemDAO) FindEnabledNodeClusterMetricItem(tx *dbs.Tx, id uint32) (*NodeClusterMetricItem, error)

FindEnabledNodeClusterMetricItem 查找启用中的条目

func (*NodeClusterMetricItemDAO) NotifyUpdate

func (this *NodeClusterMetricItemDAO) NotifyUpdate(tx *dbs.Tx, clusterId int64) error

NotifyUpdate 通知更新

type NodeClusterMetricItemOperator

type NodeClusterMetricItemOperator struct {
	Id        interface{} // ID
	IsOn      interface{} // 是否启用
	ClusterId interface{} // 集群ID
	ItemId    interface{} // 指标ID
	State     interface{} // 是否启用
}

func NewNodeClusterMetricItemOperator

func NewNodeClusterMetricItemOperator() *NodeClusterMetricItemOperator

type NodeClusterOperator

type NodeClusterOperator struct {
	Id                   any // ID
	AdminId              any // 管理员ID
	UserId               any // 用户ID
	IsOn                 any // 是否启用
	Name                 any // 名称
	UseAllAPINodes       any // 是否使用所有API节点
	ApiNodes             any // 使用的API节点
	InstallDir           any // 安装目录
	Order                any // 排序
	CreatedAt            any // 创建时间
	GrantId              any // 默认认证方式
	State                any // 状态
	AutoRegister         any // 是否开启自动注册
	UniqueId             any // 唯一ID
	Secret               any // 密钥
	HealthCheck          any // 健康检查
	DnsName              any // DNS名称
	DnsDomainId          any // 域名ID
	Dns                  any // DNS配置
	Toa                  any // TOA配置
	CachePolicyId        any // 缓存策略ID
	HttpFirewallPolicyId any // WAF策略ID
	AccessLog            any // 访问日志设置
	SystemServices       any // 系统服务设置
	TimeZone             any // 时区
	NodeMaxThreads       any // 节点最大线程数
	DdosProtection       any // DDoS防护设置
	AutoOpenPorts        any // 是否自动尝试开放端口
	IsPinned             any // 是否置顶
	Webp                 any // WebP设置
	Uam                  any // UAM设置
	Clock                any // 时钟配置
	GlobalServerConfig   any // 全局服务配置
	AutoRemoteStart      any // 自动远程启动
	AutoInstallNftables  any // 自动安装nftables
}

func NewNodeClusterOperator

func NewNodeClusterOperator() *NodeClusterOperator

type NodeDAO

type NodeDAO dbs.DAO
var SharedNodeDAO *NodeDAO

func NewNodeDAO

func NewNodeDAO() *NodeDAO

func (*NodeDAO) CheckNodesLimit added in v0.5.3

func (this *NodeDAO) CheckNodesLimit(tx *dbs.Tx) error

func (*NodeDAO) ComposeNodeConfig

func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64, cacheMap *utils.CacheMap) (*nodeconfigs.NodeConfig, error)

ComposeNodeConfig 组合配置 TODO 提升运行速度

func (*NodeDAO) CountAllEnabledNodes

func (this *NodeDAO) CountAllEnabledNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledNodes 计算所有节点数量

func (*NodeDAO) CountAllEnabledNodesDNSWithClusterId

func (this *NodeDAO) CountAllEnabledNodesDNSWithClusterId(tx *dbs.Tx, clusterId int64) (result int64, err error)

CountAllEnabledNodesDNSWithClusterId 计算一个集群的节点DNS数量

func (*NodeDAO) CountAllEnabledNodesMatch

func (this *NodeDAO) CountAllEnabledNodesMatch(tx *dbs.Tx,
	clusterId int64,
	installState configutils.BoolState,
	activeState configutils.BoolState,
	keyword string,
	groupId int64,
	regionId int64,
	level int32,
	includeSecondaryNodes bool) (int64, error)

CountAllEnabledNodesMatch 计算节点数量

func (*NodeDAO) CountAllEnabledNodesWithGrantId

func (this *NodeDAO) CountAllEnabledNodesWithGrantId(tx *dbs.Tx, grantId int64) (int64, error)

CountAllEnabledNodesWithGrantId 计算使用某个认证的节点数量

func (*NodeDAO) CountAllEnabledNodesWithGroupId

func (this *NodeDAO) CountAllEnabledNodesWithGroupId(tx *dbs.Tx, groupId int64) (int64, error)

CountAllEnabledNodesWithGroupId 查找某个节点分组下的所有节点数量

func (*NodeDAO) CountAllEnabledNodesWithRegionId

func (this *NodeDAO) CountAllEnabledNodesWithRegionId(tx *dbs.Tx, regionId int64) (int64, error)

CountAllEnabledNodesWithRegionId 查找某个节点区域下的所有节点数量

func (*NodeDAO) CountAllEnabledOfflineNodes

func (this *NodeDAO) CountAllEnabledOfflineNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledOfflineNodes 计算所有离线节点数量

func (*NodeDAO) CountAllLowerVersionNodes

func (this *NodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有集群中低于某个版本的节点数量

func (*NodeDAO) CountAllLowerVersionNodesWithClusterId

func (this *NodeDAO) CountAllLowerVersionNodesWithClusterId(tx *dbs.Tx, clusterId int64, os string, arch string, version string) (int64, error)

CountAllLowerVersionNodesWithClusterId 计算单个集群中所有低于某个版本的节点数量

func (*NodeDAO) CountAllNotInstalledNodesWithClusterId

func (this *NodeDAO) CountAllNotInstalledNodesWithClusterId(tx *dbs.Tx, clusterId int64) (int64, error)

CountAllNotInstalledNodesWithClusterId 计算未安装的节点数量

func (*NodeDAO) CreateNode

func (this *NodeDAO) CreateNode(tx *dbs.Tx, adminId int64, name string, clusterId int64, groupId int64, regionId int64) (nodeId int64, err error)

CreateNode 创建节点

func (*NodeDAO) DeleteNodeFromCluster

func (this *NodeDAO) DeleteNodeFromCluster(tx *dbs.Tx, nodeId int64, clusterId int64) error

DeleteNodeFromCluster 从集群中删除节点

func (*NodeDAO) DisableNode

func (this *NodeDAO) DisableNode(tx *dbs.Tx, nodeId int64) (err error)

DisableNode 禁用条目

func (*NodeDAO) EnableNode

func (this *NodeDAO) EnableNode(tx *dbs.Tx, id uint32) (rowsAffected int64, err error)

EnableNode 启用条目

func (*NodeDAO) FindAllEnabledNodeIdsWithClusterId

func (this *NodeDAO) FindAllEnabledNodeIdsWithClusterId(tx *dbs.Tx, clusterId int64) (result []int64, err error)

FindAllEnabledNodeIdsWithClusterId 获取一个集群的所有节点Ids

func (*NodeDAO) FindAllEnabledNodesDNSWithClusterId

func (this *NodeDAO) FindAllEnabledNodesDNSWithClusterId(tx *dbs.Tx, clusterId int64, includeSecondaryNodes bool, includingLnNodes bool) (result []*Node, err error)

FindAllEnabledNodesDNSWithClusterId 获取一个集群的节点DNS信息

func (*NodeDAO) FindAllEnabledNodesWithClusterId

func (this *NodeDAO) FindAllEnabledNodesWithClusterId(tx *dbs.Tx, clusterId int64, includeSecondary bool) (result []*Node, err error)

FindAllEnabledNodesWithClusterId 获取一个集群的所有节点

func (*NodeDAO) FindAllEnabledNodesWithGrantId

func (this *NodeDAO) FindAllEnabledNodesWithGrantId(tx *dbs.Tx, grantId int64) (result []*Node, err error)

FindAllEnabledNodesWithGrantId 查找使用某个认证的所有节点

func (*NodeDAO) FindAllInactiveNodesWithClusterId

func (this *NodeDAO) FindAllInactiveNodesWithClusterId(tx *dbs.Tx, clusterId int64) (result []*Node, err error)

FindAllInactiveNodesWithClusterId 取得一个集群离线的节点

func (*NodeDAO) FindAllLowerVersionNodesWithClusterId

func (this *NodeDAO) FindAllLowerVersionNodesWithClusterId(tx *dbs.Tx, clusterId int64, os string, arch string, version string) (result []*Node, err error)

FindAllLowerVersionNodesWithClusterId 查找单个集群中所有低于某个版本的节点

func (*NodeDAO) FindAllNodeIdsMatch

func (this *NodeDAO) FindAllNodeIdsMatch(tx *dbs.Tx, clusterId int64, includeSecondaryNodes bool, isOn configutils.BoolState) (result []int64, err error)

FindAllNodeIdsMatch 匹配节点并返回节点ID

func (*NodeDAO) FindAllNotInstalledNodesWithClusterId

func (this *NodeDAO) FindAllNotInstalledNodesWithClusterId(tx *dbs.Tx, clusterId int64) (result []*Node, err error)

FindAllNotInstalledNodesWithClusterId 查找所有未安装的节点

func (*NodeDAO) FindEnabledAndOnNodeClusterIds

func (this *NodeDAO) FindEnabledAndOnNodeClusterIds(tx *dbs.Tx, nodeId int64) (result []int64, err error)

FindEnabledAndOnNodeClusterIds 获取节点所属所有可用而且启用的集群ID

func (*NodeDAO) FindEnabledAndOnNodeIdsWithClusterId

func (this *NodeDAO) FindEnabledAndOnNodeIdsWithClusterId(tx *dbs.Tx, clusterId int64, includeSecondary bool) ([]int64, error)

FindEnabledAndOnNodeIdsWithClusterId 查找某个集群下的所有启用的节点IDs

func (*NodeDAO) FindEnabledBasicNode

func (this *NodeDAO) FindEnabledBasicNode(tx *dbs.Tx, nodeId int64) (*Node, error)

FindEnabledBasicNode 获取节点的基本信息

func (*NodeDAO) FindEnabledNode

func (this *NodeDAO) FindEnabledNode(tx *dbs.Tx, id int64) (*Node, error)

FindEnabledNode 查找启用中的条目

func (*NodeDAO) FindEnabledNodeClusterIds

func (this *NodeDAO) FindEnabledNodeClusterIds(tx *dbs.Tx, nodeId int64) (result []int64, err error)

FindEnabledNodeClusterIds 获取节点所属所有可用的集群ID

func (*NodeDAO) FindEnabledNodeDNS

func (this *NodeDAO) FindEnabledNodeDNS(tx *dbs.Tx, nodeId int64) (*Node, error)

FindEnabledNodeDNS 获取单个节点的DNS信息

func (*NodeDAO) FindEnabledNodeIdWithUniqueId

func (this *NodeDAO) FindEnabledNodeIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledNodeIdWithUniqueId 根据UniqueId获取ID

func (*NodeDAO) FindEnabledNodeIdWithUniqueIdCacheable

func (this *NodeDAO) FindEnabledNodeIdWithUniqueIdCacheable(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledNodeIdWithUniqueIdCacheable 根据UniqueId获取ID,并可以使用缓存

func (*NodeDAO) FindEnabledNodeIdsWithClusterId

func (this *NodeDAO) FindEnabledNodeIdsWithClusterId(tx *dbs.Tx, clusterId int64) ([]int64, error)

FindEnabledNodeIdsWithClusterId 查找某个集群下的所有节点IDs

func (*NodeDAO) FindEnabledNodeWithUniqueId

func (this *NodeDAO) FindEnabledNodeWithUniqueId(tx *dbs.Tx, uniqueId string) (*Node, error)

FindEnabledNodeWithUniqueId 根据节点ID获取节点

func (*NodeDAO) FindEnabledNodeWithUniqueIdAndSecret

func (this *NodeDAO) FindEnabledNodeWithUniqueIdAndSecret(tx *dbs.Tx, uniqueId string, secret string) (*Node, error)

FindEnabledNodeWithUniqueIdAndSecret 根据节点ID和密钥查询节点

func (*NodeDAO) FindEnabledNodesWithClusterIdAndLevel

func (this *NodeDAO) FindEnabledNodesWithClusterIdAndLevel(tx *dbs.Tx, clusterId int64, level int) (result []*Node, err error)

FindEnabledNodesWithClusterIdAndLevel 查找当前集群下的某个级别的所有节点

func (*NodeDAO) FindEnabledNodesWithGroupIdAndLevel

func (this *NodeDAO) FindEnabledNodesWithGroupIdAndLevel(tx *dbs.Tx, groupId int64, level int) (result []*Node, err error)

FindEnabledNodesWithGroupIdAndLevel 查找当前分组下的某个级别的所有节点

func (*NodeDAO) FindEnabledNodesWithIds

func (this *NodeDAO) FindEnabledNodesWithIds(tx *dbs.Tx, nodeIds []int64) (result []*Node, err error)

FindEnabledNodesWithIds 根据一组ID查找一组节点

func (*NodeDAO) FindNodeActive

func (this *NodeDAO) FindNodeActive(tx *dbs.Tx, nodeId int64) (bool, error)

FindNodeActive 检查节点活跃状态

func (*NodeDAO) FindNodeClusterId

func (this *NodeDAO) FindNodeClusterId(tx *dbs.Tx, nodeId int64) (int64, error)

FindNodeClusterId 获取节点集群ID

func (*NodeDAO) FindNodeDDoSProtection

func (this *NodeDAO) FindNodeDDoSProtection(tx *dbs.Tx, nodeId int64) (*ddosconfigs.ProtectionConfig, error)

FindNodeDDoSProtection 获取节点的DDOS设置

func (*NodeDAO) FindNodeDNSResolver

func (this *NodeDAO) FindNodeDNSResolver(tx *dbs.Tx, nodeId int64) (*nodeconfigs.DNSResolverConfig, error)

FindNodeDNSResolver 查找域名DNS Resolver

func (*NodeDAO) FindNodeInactiveNotifiedAt added in v0.5.0

func (this *NodeDAO) FindNodeInactiveNotifiedAt(tx *dbs.Tx, nodeId int64) (int64, error)

FindNodeInactiveNotifiedAt 读取上次的节点离线通知时间

func (*NodeDAO) FindNodeInstallStatus

func (this *NodeDAO) FindNodeInstallStatus(tx *dbs.Tx, nodeId int64) (*NodeInstallStatus, error)

FindNodeInstallStatus 查询节点的安装状态

func (*NodeDAO) FindNodeLevel

func (this *NodeDAO) FindNodeLevel(tx *dbs.Tx, nodeId int64) (int, error)

FindNodeLevel 获取节点级别

func (*NodeDAO) FindNodeLevelInfo

func (this *NodeDAO) FindNodeLevelInfo(tx *dbs.Tx, nodeId int64) (*Node, error)

FindNodeLevelInfo 获取节点级别相关信息

func (*NodeDAO) FindNodeName

func (this *NodeDAO) FindNodeName(tx *dbs.Tx, id int64) (string, error)

FindNodeName 根据主键查找名称

func (*NodeDAO) FindNodeStatus

func (this *NodeDAO) FindNodeStatus(tx *dbs.Tx, nodeId int64) (*nodeconfigs.NodeStatus, error)

FindNodeStatus 获取节点状态

func (*NodeDAO) FindNodeVersion

func (this *NodeDAO) FindNodeVersion(tx *dbs.Tx, nodeId int64) (int64, error)

FindNodeVersion 查找节点的版本号

func (*NodeDAO) FindParentNodeConfigs

func (this *NodeDAO) FindParentNodeConfigs(tx *dbs.Tx, nodeId int64, groupId int64, clusterIds []int64, level int) (result map[int64][]*nodeconfigs.ParentNodeConfig, err error)

FindParentNodeConfigs 查找父级节点配置

func (*NodeDAO) FindStatelessNodeDNS

func (this *NodeDAO) FindStatelessNodeDNS(tx *dbs.Tx, nodeId int64) (*Node, error)

FindStatelessNodeDNS 获取单个节点的DNS信息,无论什么状态

func (*NodeDAO) GenUniqueId

func (this *NodeDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*NodeDAO) ListEnabledNodesMatch

func (this *NodeDAO) ListEnabledNodesMatch(tx *dbs.Tx,
	clusterId int64,
	installState configutils.BoolState,
	activeState configutils.BoolState,
	keyword string,
	groupId int64,
	regionId int64,
	level int32,
	includeSecondaryNodes bool,
	order string,
	offset int64,
	size int64) (result []*Node, err error)

ListEnabledNodesMatch 列出单页节点

func (*NodeDAO) NotifyDNSUpdate

func (this *NodeDAO) NotifyDNSUpdate(tx *dbs.Tx, nodeId int64) error

NotifyDNSUpdate 通知节点相关DNS更新

func (*NodeDAO) NotifyLevelUpdate

func (this *NodeDAO) NotifyLevelUpdate(tx *dbs.Tx, nodeId int64) error

NotifyLevelUpdate 通知节点级别更新

func (*NodeDAO) NotifyUpdate

func (this *NodeDAO) NotifyUpdate(tx *dbs.Tx, nodeId int64) error

NotifyUpdate 通知节点相关更新

func (*NodeDAO) TransferPrimaryClusterNodes

func (this *NodeDAO) TransferPrimaryClusterNodes(tx *dbs.Tx, primaryClusterId int64) error

TransferPrimaryClusterNodes 自动转移集群下的节点

func (*NodeDAO) UpdateNode

func (this *NodeDAO) UpdateNode(tx *dbs.Tx, nodeId int64, name string, clusterId int64, secondaryClusterIds []int64, groupId int64, regionId int64, isOn bool, level int, lnAddrs []string) error

UpdateNode 修改节点

func (*NodeDAO) UpdateNodeActive

func (this *NodeDAO) UpdateNodeActive(tx *dbs.Tx, nodeId int64, isActive bool) error

UpdateNodeActive 修改节点活跃状态

func (*NodeDAO) UpdateNodeCache

func (this *NodeDAO) UpdateNodeCache(tx *dbs.Tx, nodeId int64, maxCacheDiskCapacityJSON []byte, maxCacheMemoryCapacityJSON []byte, cacheDiskDir string) error

UpdateNodeCache 设置缓存相关

func (*NodeDAO) UpdateNodeConnectedAPINodes

func (this *NodeDAO) UpdateNodeConnectedAPINodes(tx *dbs.Tx, nodeId int64, apiNodeIds []int64) error

UpdateNodeConnectedAPINodes 修改当前连接的API节点

func (*NodeDAO) UpdateNodeDDoSProtection

func (this *NodeDAO) UpdateNodeDDoSProtection(tx *dbs.Tx, nodeId int64, ddosProtection *ddosconfigs.ProtectionConfig) error

UpdateNodeDDoSProtection 设置集群的DDoS设置

func (*NodeDAO) UpdateNodeDNS

func (this *NodeDAO) UpdateNodeDNS(tx *dbs.Tx, nodeId int64, routes map[int64][]string) error

UpdateNodeDNS 修改节点的DNS信息

func (*NodeDAO) UpdateNodeDNSResolver

func (this *NodeDAO) UpdateNodeDNSResolver(tx *dbs.Tx, nodeId int64, dnsResolverConfig *nodeconfigs.DNSResolverConfig) error

UpdateNodeDNSResolver 修改域名DNS Resolver

func (*NodeDAO) UpdateNodeInactiveNotifiedAt added in v0.5.0

func (this *NodeDAO) UpdateNodeInactiveNotifiedAt(tx *dbs.Tx, nodeId int64, inactiveAt int64) error

UpdateNodeInactiveNotifiedAt 修改节点的离线通知时间

func (*NodeDAO) UpdateNodeInstallStatus

func (this *NodeDAO) UpdateNodeInstallStatus(tx *dbs.Tx, nodeId int64, status *NodeInstallStatus) error

UpdateNodeInstallStatus 修改节点的安装状态

func (*NodeDAO) UpdateNodeIsActive

func (this *NodeDAO) UpdateNodeIsActive(tx *dbs.Tx, nodeId int64, isActive bool) error

UpdateNodeIsActive 更改节点在线状态

func (*NodeDAO) UpdateNodeIsInstalled

func (this *NodeDAO) UpdateNodeIsInstalled(tx *dbs.Tx, nodeId int64, isInstalled bool) error

UpdateNodeIsInstalled 设置节点安装状态

func (*NodeDAO) UpdateNodeStatus

func (this *NodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, nodeStatus *nodeconfigs.NodeStatus) error

UpdateNodeStatus 更改节点状态

func (*NodeDAO) UpdateNodeSystem

func (this *NodeDAO) UpdateNodeSystem(tx *dbs.Tx, nodeId int64, maxCPU int32) error

UpdateNodeSystem 设置系统信息

func (*NodeDAO) UpdateNodeUp

func (this *NodeDAO) UpdateNodeUp(tx *dbs.Tx, nodeId int64, isUp bool) error

UpdateNodeUp 设置节点上下线状态

func (*NodeDAO) UpdateNodeUpCount

func (this *NodeDAO) UpdateNodeUpCount(tx *dbs.Tx, nodeId int64, isUp bool, maxUp int, maxDown int) (changed bool, err error)

UpdateNodeUpCount 计算节点上线|下线状态

type NodeGrant

type NodeGrant struct {
	Id          uint32 `field:"id"`          // ID
	AdminId     uint32 `field:"adminId"`     // 管理员ID
	Name        string `field:"name"`        // 名称
	Method      string `field:"method"`      // 登录方式
	Username    string `field:"username"`    // 用户名
	Password    string `field:"password"`    // 密码
	Su          uint8  `field:"su"`          // 是否需要su
	PrivateKey  string `field:"privateKey"`  // 私钥
	Passphrase  string `field:"passphrase"`  // 私钥密码
	Description string `field:"description"` // 备注
	NodeId      uint32 `field:"nodeId"`      // 专有节点
	Role        string `field:"role"`        // 角色
	State       uint8  `field:"state"`       // 状态
	CreatedAt   uint64 `field:"createdAt"`   // 创建时间
}

NodeGrant 节点授权

type NodeGrantDAO

type NodeGrantDAO dbs.DAO
var SharedNodeGrantDAO *NodeGrantDAO

func NewNodeGrantDAO

func NewNodeGrantDAO() *NodeGrantDAO

func (*NodeGrantDAO) CountAllEnabledGrants

func (this *NodeGrantDAO) CountAllEnabledGrants(tx *dbs.Tx, keyword string) (int64, error)

CountAllEnabledGrants 计算所有认证信息数量

func (*NodeGrantDAO) CreateGrant

func (this *NodeGrantDAO) CreateGrant(tx *dbs.Tx, adminId int64, name string, method string, username string, password string, privateKey string, passphrase string, description string, nodeId int64, su bool) (grantId int64, err error)

CreateGrant 创建认证信息

func (*NodeGrantDAO) DisableNodeGrant

func (this *NodeGrantDAO) DisableNodeGrant(tx *dbs.Tx, id int64) (err error)

DisableNodeGrant 禁用条目

func (*NodeGrantDAO) EnableNodeGrant

func (this *NodeGrantDAO) EnableNodeGrant(tx *dbs.Tx, id uint32) (rowsAffected int64, err error)

EnableNodeGrant 启用条目

func (*NodeGrantDAO) FindAllEnabledGrants

func (this *NodeGrantDAO) FindAllEnabledGrants(tx *dbs.Tx) (result []*NodeGrant, err error)

FindAllEnabledGrants 列出所有的认证信息

func (*NodeGrantDAO) FindEnabledNodeGrant

func (this *NodeGrantDAO) FindEnabledNodeGrant(tx *dbs.Tx, id int64) (*NodeGrant, error)

FindEnabledNodeGrant 查找启用中的条目

func (*NodeGrantDAO) FindNodeGrantName

func (this *NodeGrantDAO) FindNodeGrantName(tx *dbs.Tx, id uint32) (string, error)

FindNodeGrantName 根据主键查找名称

func (*NodeGrantDAO) ListEnabledGrants

func (this *NodeGrantDAO) ListEnabledGrants(tx *dbs.Tx, keyword string, offset int64, size int64) (result []*NodeGrant, err error)

ListEnabledGrants 列出单页的认证信息

func (*NodeGrantDAO) UpdateGrant

func (this *NodeGrantDAO) UpdateGrant(tx *dbs.Tx, grantId int64, name string, method string, username string, password string, privateKey string, passphrase string, description string, nodeId int64, su bool) error

UpdateGrant 修改认证信息

type NodeGrantOperator

type NodeGrantOperator struct {
	Id          interface{} // ID
	AdminId     interface{} // 管理员ID
	Name        interface{} // 名称
	Method      interface{} // 登录方式
	Username    interface{} // 用户名
	Password    interface{} // 密码
	Su          interface{} // 是否需要su
	PrivateKey  interface{} // 私钥
	Passphrase  interface{} // 私钥密码
	Description interface{} // 备注
	NodeId      interface{} // 专有节点
	Role        interface{} // 角色
	State       interface{} // 状态
	CreatedAt   interface{} // 创建时间
}

func NewNodeGrantOperator

func NewNodeGrantOperator() *NodeGrantOperator

type NodeGroup

type NodeGroup struct {
	Id        uint32 `field:"id"`        // ID
	Name      string `field:"name"`      // 名称
	ClusterId uint32 `field:"clusterId"` // 集群ID
	Order     uint32 `field:"order"`     // 排序
	CreatedAt uint64 `field:"createdAt"` // 创建时间
	State     uint8  `field:"state"`     // 状态
}

节点分组

type NodeGroupDAO

type NodeGroupDAO dbs.DAO
var SharedNodeGroupDAO *NodeGroupDAO

func NewNodeGroupDAO

func NewNodeGroupDAO() *NodeGroupDAO

func (*NodeGroupDAO) CreateNodeGroup

func (this *NodeGroupDAO) CreateNodeGroup(tx *dbs.Tx, clusterId int64, name string) (int64, error)

创建分组

func (*NodeGroupDAO) DisableNodeGroup

func (this *NodeGroupDAO) DisableNodeGroup(tx *dbs.Tx, id int64) (rowsAffected int64, err error)

禁用条目

func (*NodeGroupDAO) EnableNodeGroup

func (this *NodeGroupDAO) EnableNodeGroup(tx *dbs.Tx, id int64) (rowsAffected int64, err error)

启用条目

func (*NodeGroupDAO) FindAllEnabledGroupsWithClusterId

func (this *NodeGroupDAO) FindAllEnabledGroupsWithClusterId(tx *dbs.Tx, clusterId int64) (result []*NodeGroup, err error)

查询所有分组

func (*NodeGroupDAO) FindEnabledNodeGroup

func (this *NodeGroupDAO) FindEnabledNodeGroup(tx *dbs.Tx, id int64) (*NodeGroup, error)

查找启用中的条目

func (*NodeGroupDAO) FindNodeGroupName

func (this *NodeGroupDAO) FindNodeGroupName(tx *dbs.Tx, id int64) (string, error)

根据主键查找名称

func (*NodeGroupDAO) UpdateGroupOrders

func (this *NodeGroupDAO) UpdateGroupOrders(tx *dbs.Tx, groupIds []int64) error

保存排序

func (*NodeGroupDAO) UpdateNodeGroup

func (this *NodeGroupDAO) UpdateNodeGroup(tx *dbs.Tx, groupId int64, name string) error

修改分组

type NodeGroupOperator

type NodeGroupOperator struct {
	Id        interface{} // ID
	Name      interface{} // 名称
	ClusterId interface{} // 集群ID
	Order     interface{} // 排序
	CreatedAt interface{} // 创建时间
	State     interface{} // 状态
}

func NewNodeGroupOperator

func NewNodeGroupOperator() *NodeGroupOperator

type NodeIPAddress

type NodeIPAddress struct {
	Id                uint32   `field:"id"`                // ID
	NodeId            uint32   `field:"nodeId"`            // 节点ID
	Role              string   `field:"role"`              // 节点角色
	GroupId           uint32   `field:"groupId"`           // 所属分组ID
	Name              string   `field:"name"`              // 名称
	Ip                string   `field:"ip"`                // IP地址
	Description       string   `field:"description"`       // 描述
	State             uint8    `field:"state"`             // 状态
	Order             uint32   `field:"order"`             // 排序
	CanAccess         bool     `field:"canAccess"`         // 是否可以访问
	IsOn              bool     `field:"isOn"`              // 是否启用
	IsUp              bool     `field:"isUp"`              // 是否上线
	IsHealthy         bool     `field:"isHealthy"`         // 是否健康
	Thresholds        dbs.JSON `field:"thresholds"`        // 上线阈值
	Connectivity      dbs.JSON `field:"connectivity"`      // 连通性状态
	BackupIP          string   `field:"backupIP"`          // 备用IP
	BackupThresholdId uint32   `field:"backupThresholdId"` // 触发备用IP的阈值
	CountUp           uint32   `field:"countUp"`           // UP状态次数
	CountDown         uint32   `field:"countDown"`         // DOWN状态次数
}

NodeIPAddress 节点IP地址

func (*NodeIPAddress) DNSIP

func (this *NodeIPAddress) DNSIP() string

DNSIP 获取当前DNS可以使用的IP

func (*NodeIPAddress) DecodeBackupIP

func (this *NodeIPAddress) DecodeBackupIP() string

DecodeBackupIP 获取备用IP

func (*NodeIPAddress) DecodeConnectivity

func (this *NodeIPAddress) DecodeConnectivity() *nodeconfigs.Connectivity

DecodeConnectivity 解析联通数值

type NodeIPAddressDAO

type NodeIPAddressDAO dbs.DAO
var SharedNodeIPAddressDAO *NodeIPAddressDAO

func NewNodeIPAddressDAO

func NewNodeIPAddressDAO() *NodeIPAddressDAO

func (*NodeIPAddressDAO) CountAllAccessibleIPAddressesWithClusterId

func (this *NodeIPAddressDAO) CountAllAccessibleIPAddressesWithClusterId(tx *dbs.Tx, role string, clusterId int64) (count int64, err error)

CountAllAccessibleIPAddressesWithClusterId 计算集群中的可用IP地址数量

func (*NodeIPAddressDAO) CountAllEnabledIPAddresses

func (this *NodeIPAddressDAO) CountAllEnabledIPAddresses(tx *dbs.Tx, role string, nodeClusterId int64, upState configutils.BoolState, keyword string) (int64, error)

CountAllEnabledIPAddresses 计算IP地址数量 TODO 目前支持边缘节点,将来支持NS节点

func (*NodeIPAddressDAO) CreateAddress

func (this *NodeIPAddressDAO) CreateAddress(tx *dbs.Tx, adminId int64, nodeId int64, role nodeconfigs.NodeRole, name string, ip string, canAccess bool, isUp bool, groupId int64) (addressId int64, err error)

CreateAddress 创建IP地址

func (*NodeIPAddressDAO) DisableAddress

func (this *NodeIPAddressDAO) DisableAddress(tx *dbs.Tx, addressId int64) (err error)

DisableAddress 禁用IP地址

func (*NodeIPAddressDAO) DisableAllAddressesWithNodeId

func (this *NodeIPAddressDAO) DisableAllAddressesWithNodeId(tx *dbs.Tx, nodeId int64, role nodeconfigs.NodeRole) error

DisableAllAddressesWithNodeId 禁用节点的所有的IP地址

func (*NodeIPAddressDAO) EnableAddress

func (this *NodeIPAddressDAO) EnableAddress(tx *dbs.Tx, addressId int64) (err error)

EnableAddress 启用条目

func (*NodeIPAddressDAO) FindAddressIsHealthy

func (this *NodeIPAddressDAO) FindAddressIsHealthy(tx *dbs.Tx, addressId int64) (isHealthy bool, err error)

FindAddressIsHealthy 判断IP地址是否健康

func (*NodeIPAddressDAO) FindAddressName

func (this *NodeIPAddressDAO) FindAddressName(tx *dbs.Tx, id int64) (string, error)

FindAddressName 根据主键查找名称

func (*NodeIPAddressDAO) FindAllAccessibleIPAddressesWithClusterId

func (this *NodeIPAddressDAO) FindAllAccessibleIPAddressesWithClusterId(tx *dbs.Tx, role string, clusterId int64, cacheMap *utils.CacheMap) (result []*NodeIPAddress, err error)

FindAllAccessibleIPAddressesWithClusterId 列出所有的正在启用的IP地址

func (*NodeIPAddressDAO) FindAllEnabledAddressesWithNode

func (this *NodeIPAddressDAO) FindAllEnabledAddressesWithNode(tx *dbs.Tx, nodeId int64, role nodeconfigs.NodeRole) (result []*NodeIPAddress, err error)

FindAllEnabledAddressesWithNode 查找节点的所有的IP地址

func (*NodeIPAddressDAO) FindEnabledAddress

func (this *NodeIPAddressDAO) FindEnabledAddress(tx *dbs.Tx, id int64) (*NodeIPAddress, error)

FindEnabledAddress 查找启用中的IP地址

func (*NodeIPAddressDAO) FindFirstNodeAccessIPAddress

func (this *NodeIPAddressDAO) FindFirstNodeAccessIPAddress(tx *dbs.Tx, nodeId int64, mustUp bool, role nodeconfigs.NodeRole) (ip string, addrId int64, err error)

FindFirstNodeAccessIPAddress 查找节点的第一个可访问的IP地址

func (*NodeIPAddressDAO) FindFirstNodeAccessIPAddressId

func (this *NodeIPAddressDAO) FindFirstNodeAccessIPAddressId(tx *dbs.Tx, nodeId int64, mustUp bool, role nodeconfigs.NodeRole) (int64, error)

FindFirstNodeAccessIPAddressId 查找节点的第一个可访问的IP地址ID

func (*NodeIPAddressDAO) FindNodeAccessAndUpIPAddresses

func (this *NodeIPAddressDAO) FindNodeAccessAndUpIPAddresses(tx *dbs.Tx, nodeId int64, role nodeconfigs.NodeRole) (result []*NodeIPAddress, err error)

FindNodeAccessAndUpIPAddresses 查找节点所有的可访问的IP地址

func (*NodeIPAddressDAO) FireThresholds

func (this *NodeIPAddressDAO) FireThresholds(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64) error

FireThresholds 触发阈值

func (*NodeIPAddressDAO) ListAccessibleIPAddressesWithClusterId

func (this *NodeIPAddressDAO) ListAccessibleIPAddressesWithClusterId(tx *dbs.Tx, role string, clusterId int64, offset int64, size int64) (result []*NodeIPAddress, err error)

ListAccessibleIPAddressesWithClusterId 列出单页集群中的可用IP地址

func (*NodeIPAddressDAO) ListEnabledIPAddresses

func (this *NodeIPAddressDAO) ListEnabledIPAddresses(tx *dbs.Tx, role string, nodeClusterId int64, upState configutils.BoolState, keyword string, offset int64, size int64) (result []*NodeIPAddress, err error)

ListEnabledIPAddresses 列出单页的IP地址

func (*NodeIPAddressDAO) NotifyUpdate

func (this *NodeIPAddressDAO) NotifyUpdate(tx *dbs.Tx, addressId int64) error

NotifyUpdate 通知更新

func (*NodeIPAddressDAO) UpdateAddress

func (this *NodeIPAddressDAO) UpdateAddress(tx *dbs.Tx, adminId int64, addressId int64, name string, ip string, canAccess bool, isOn bool, isUp bool) (err error)

UpdateAddress 修改IP地址

func (*NodeIPAddressDAO) UpdateAddressBackupIP

func (this *NodeIPAddressDAO) UpdateAddressBackupIP(tx *dbs.Tx, addressId int64, thresholdId int64, ip string) error

UpdateAddressBackupIP 设置备用IP

func (*NodeIPAddressDAO) UpdateAddressConnectivity

func (this *NodeIPAddressDAO) UpdateAddressConnectivity(tx *dbs.Tx, addrId int64, connectivity *nodeconfigs.Connectivity) error

UpdateAddressConnectivity 设置连通性数据

func (*NodeIPAddressDAO) UpdateAddressHealthCount

func (this *NodeIPAddressDAO) UpdateAddressHealthCount(tx *dbs.Tx, addrId int64, newIsUp bool, maxUp int, maxDown int, autoUpDown bool) (changed bool, err error)

UpdateAddressHealthCount 计算IP健康状态

func (*NodeIPAddressDAO) UpdateAddressIP

func (this *NodeIPAddressDAO) UpdateAddressIP(tx *dbs.Tx, addressId int64, ip string) error

UpdateAddressIP 修改IP地址中的IP

func (*NodeIPAddressDAO) UpdateAddressIsUp

func (this *NodeIPAddressDAO) UpdateAddressIsUp(tx *dbs.Tx, addressId int64, isUp bool) error

UpdateAddressIsUp 设置IP地址在线状态

func (*NodeIPAddressDAO) UpdateAddressNodeId

func (this *NodeIPAddressDAO) UpdateAddressNodeId(tx *dbs.Tx, addressId int64, nodeId int64) error

UpdateAddressNodeId 修改IP地址所属节点

type NodeIPAddressGroup

type NodeIPAddressGroup struct {
	Id    uint32 `field:"id"`    // ID
	Name  string `field:"name"`  // 分组名
	Value string `field:"value"` // IP值
}

NodeIPAddressGroup IP地址分组

type NodeIPAddressGroupDAO

type NodeIPAddressGroupDAO dbs.DAO
var SharedNodeIPAddressGroupDAO *NodeIPAddressGroupDAO

func NewNodeIPAddressGroupDAO

func NewNodeIPAddressGroupDAO() *NodeIPAddressGroupDAO

func (*NodeIPAddressGroupDAO) CreateGroup

func (this *NodeIPAddressGroupDAO) CreateGroup(tx *dbs.Tx, name string, value string) (int64, error)

CreateGroup 创建分组

func (*NodeIPAddressGroupDAO) FindNodeIPAddressGroupName

func (this *NodeIPAddressGroupDAO) FindNodeIPAddressGroupName(tx *dbs.Tx, id uint32) (string, error)

FindNodeIPAddressGroupName 根据主键查找名称

type NodeIPAddressGroupOperator

type NodeIPAddressGroupOperator struct {
	Id    interface{} // ID
	Name  interface{} // 分组名
	Value interface{} // IP值
}

func NewNodeIPAddressGroupOperator

func NewNodeIPAddressGroupOperator() *NodeIPAddressGroupOperator

type NodeIPAddressLog

type NodeIPAddressLog struct {
	Id          uint64 `field:"id"`          // ID
	AddressId   uint64 `field:"addressId"`   // 地址ID
	AdminId     uint32 `field:"adminId"`     // 管理员ID
	Description string `field:"description"` // 描述
	CreatedAt   uint64 `field:"createdAt"`   // 操作时间
	IsUp        bool   `field:"isUp"`        // 是否在线
	IsOn        bool   `field:"isOn"`        // 是否启用
	CanAccess   bool   `field:"canAccess"`   // 是否可访问
	Day         string `field:"day"`         // YYYYMMDD,用来清理
	BackupIP    string `field:"backupIP"`    // 备用IP
}

NodeIPAddressLog IP状态变更日志

type NodeIPAddressLogDAO

type NodeIPAddressLogDAO dbs.DAO
var SharedNodeIPAddressLogDAO *NodeIPAddressLogDAO

func NewNodeIPAddressLogDAO

func NewNodeIPAddressLogDAO() *NodeIPAddressLogDAO

func (*NodeIPAddressLogDAO) CountLogs

func (this *NodeIPAddressLogDAO) CountLogs(tx *dbs.Tx, addrId int64) (int64, error)

CountLogs 计算日志数量

func (*NodeIPAddressLogDAO) CreateLog

func (this *NodeIPAddressLogDAO) CreateLog(tx *dbs.Tx, adminId int64, addrId int64, description string) error

CreateLog 创建日志

func (*NodeIPAddressLogDAO) ListLogs

func (this *NodeIPAddressLogDAO) ListLogs(tx *dbs.Tx, addrId int64, offset int64, size int64) (result []*NodeIPAddressLog, err error)

ListLogs 列出单页日志

type NodeIPAddressLogOperator

type NodeIPAddressLogOperator struct {
	Id          interface{} // ID
	AddressId   interface{} // 地址ID
	AdminId     interface{} // 管理员ID
	Description interface{} // 描述
	CreatedAt   interface{} // 操作时间
	IsUp        interface{} // 是否在线
	IsOn        interface{} // 是否启用
	CanAccess   interface{} // 是否可访问
	Day         interface{} // YYYYMMDD,用来清理
	BackupIP    interface{} // 备用IP
}

func NewNodeIPAddressLogOperator

func NewNodeIPAddressLogOperator() *NodeIPAddressLogOperator

type NodeIPAddressOperator

type NodeIPAddressOperator struct {
	Id                interface{} // ID
	NodeId            interface{} // 节点ID
	Role              interface{} // 节点角色
	GroupId           interface{} // 所属分组ID
	Name              interface{} // 名称
	Ip                interface{} // IP地址
	Description       interface{} // 描述
	State             interface{} // 状态
	Order             interface{} // 排序
	CanAccess         interface{} // 是否可以访问
	IsOn              interface{} // 是否启用
	IsUp              interface{} // 是否上线
	IsHealthy         interface{} // 是否健康
	Thresholds        interface{} // 上线阈值
	Connectivity      interface{} // 连通性状态
	BackupIP          interface{} // 备用IP
	BackupThresholdId interface{} // 触发备用IP的阈值
	CountUp           interface{} // UP状态次数
	CountDown         interface{} // DOWN状态次数
}

func NewNodeIPAddressOperator

func NewNodeIPAddressOperator() *NodeIPAddressOperator

type NodeIPAddressThreshold

type NodeIPAddressThreshold struct {
	Id         uint64   `field:"id"`         // ID
	AddressId  uint64   `field:"addressId"`  // IP地址ID
	Items      dbs.JSON `field:"items"`      // 阈值条目
	Actions    dbs.JSON `field:"actions"`    // 动作
	NotifiedAt uint64   `field:"notifiedAt"` // 上次通知时间
	IsMatched  bool     `field:"isMatched"`  // 上次是否匹配
	State      uint8    `field:"state"`      // 状态
	Order      uint32   `field:"order"`      // 排序
}

NodeIPAddressThreshold IP地址阈值

func (*NodeIPAddressThreshold) DecodeActions

func (this *NodeIPAddressThreshold) DecodeActions() (result []*nodeconfigs.IPAddressThresholdActionConfig)

func (*NodeIPAddressThreshold) DecodeItems

func (this *NodeIPAddressThreshold) DecodeItems() (result []*nodeconfigs.IPAddressThresholdItemConfig)

type NodeIPAddressThresholdDAO

type NodeIPAddressThresholdDAO dbs.DAO
var SharedNodeIPAddressThresholdDAO *NodeIPAddressThresholdDAO

func NewNodeIPAddressThresholdDAO

func NewNodeIPAddressThresholdDAO() *NodeIPAddressThresholdDAO

func (*NodeIPAddressThresholdDAO) CountAllEnabledThresholdsWithAddrId

func (this *NodeIPAddressThresholdDAO) CountAllEnabledThresholdsWithAddrId(tx *dbs.Tx, addrId int64) (int64, error)

CountAllEnabledThresholdsWithAddrId 计算所有阈值数量

func (*NodeIPAddressThresholdDAO) CreateThreshold

func (this *NodeIPAddressThresholdDAO) CreateThreshold(tx *dbs.Tx, addressId int64, items []*nodeconfigs.IPAddressThresholdItemConfig, actions []*nodeconfigs.IPAddressThresholdActionConfig, order int) (int64, error)

CreateThreshold 创建阈值

func (*NodeIPAddressThresholdDAO) DisableAllThresholdsWithAddrId

func (this *NodeIPAddressThresholdDAO) DisableAllThresholdsWithAddrId(tx *dbs.Tx, addrId int64) error

DisableAllThresholdsWithAddrId 禁用所有阈值

func (*NodeIPAddressThresholdDAO) DisableNodeIPAddressThreshold

func (this *NodeIPAddressThresholdDAO) DisableNodeIPAddressThreshold(tx *dbs.Tx, id int64) error

DisableNodeIPAddressThreshold 禁用条目

func (*NodeIPAddressThresholdDAO) EnableNodeIPAddressThreshold

func (this *NodeIPAddressThresholdDAO) EnableNodeIPAddressThreshold(tx *dbs.Tx, id uint64) error

EnableNodeIPAddressThreshold 启用条目

func (*NodeIPAddressThresholdDAO) ExistsEnabledThreshold

func (this *NodeIPAddressThresholdDAO) ExistsEnabledThreshold(tx *dbs.Tx, thresholdId int64) (bool, error)

ExistsEnabledThreshold 检查阈值是否可以使用

func (*NodeIPAddressThresholdDAO) FindAllEnabledThresholdsWithAddrId

func (this *NodeIPAddressThresholdDAO) FindAllEnabledThresholdsWithAddrId(tx *dbs.Tx, addrId int64) (result []*NodeIPAddressThreshold, err error)

FindAllEnabledThresholdsWithAddrId 查找所有阈值

func (*NodeIPAddressThresholdDAO) FindEnabledNodeIPAddressThreshold

func (this *NodeIPAddressThresholdDAO) FindEnabledNodeIPAddressThreshold(tx *dbs.Tx, id uint64) (*NodeIPAddressThreshold, error)

FindEnabledNodeIPAddressThreshold 查找启用中的条目

func (*NodeIPAddressThresholdDAO) FindThresholdNotifiedAt

func (this *NodeIPAddressThresholdDAO) FindThresholdNotifiedAt(tx *dbs.Tx, thresholdId int64) (int64, error)

FindThresholdNotifiedAt 查找上次通知时间

func (*NodeIPAddressThresholdDAO) UpdateThreshold

func (this *NodeIPAddressThresholdDAO) UpdateThreshold(tx *dbs.Tx, thresholdId int64, items []*nodeconfigs.IPAddressThresholdItemConfig, actions []*nodeconfigs.IPAddressThresholdActionConfig, order int) error

UpdateThreshold 修改阈值

func (*NodeIPAddressThresholdDAO) UpdateThresholdIsMatched

func (this *NodeIPAddressThresholdDAO) UpdateThresholdIsMatched(tx *dbs.Tx, thresholdId int64, isMatched bool) error

UpdateThresholdIsMatched 设置是否匹配

func (*NodeIPAddressThresholdDAO) UpdateThresholdNotifiedAt

func (this *NodeIPAddressThresholdDAO) UpdateThresholdNotifiedAt(tx *dbs.Tx, thresholdId int64, timestamp int64) error

UpdateThresholdNotifiedAt 设置上次通知时间

type NodeIPAddressThresholdOperator

type NodeIPAddressThresholdOperator struct {
	Id         interface{} // ID
	AddressId  interface{} // IP地址ID
	Items      interface{} // 阈值条目
	Actions    interface{} // 动作
	NotifiedAt interface{} // 上次通知时间
	IsMatched  interface{} // 上次是否匹配
	State      interface{} // 状态
	Order      interface{} // 排序
}

func NewNodeIPAddressThresholdOperator

func NewNodeIPAddressThresholdOperator() *NodeIPAddressThresholdOperator

type NodeInstallStatus

type NodeInstallStatus struct {
	IsRunning  bool                     `json:"isRunning"`  // 是否在运行
	IsFinished bool                     `json:"isFinished"` // 是否已结束
	IsOk       bool                     `json:"isOk"`       // 是否正确安装
	Error      string                   `json:"error"`      // 错误信息
	ErrorCode  string                   `json:"errorCode"`  // 错误代号
	UpdatedAt  int64                    `json:"updatedAt"`  // 更新时间,安装过程中需要每隔N秒钟更新这个状态,以便于让系统知道安装仍在进行中
	Steps      []*NodeInstallStatusStep `json:"steps"`      // 步骤
}

节点安装状态

func NewNodeInstallStatus

func NewNodeInstallStatus() *NodeInstallStatus

type NodeInstallStatusStep

type NodeInstallStatusStep struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Percent     int    `json:"percent"`
}

type NodeLog

type NodeLog struct {
	Id          uint64   `field:"id"`          // ID
	Role        string   `field:"role"`        // 节点角色
	Type        string   `field:"type"`        // 类型
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	Tag         string   `field:"tag"`         // 标签
	Description string   `field:"description"` // 描述
	Level       string   `field:"level"`       // 级别
	NodeId      uint32   `field:"nodeId"`      // 节点ID
	Day         string   `field:"day"`         // 日期
	ServerId    uint32   `field:"serverId"`    // 服务ID
	OriginId    uint32   `field:"originId"`    // 源站ID
	Hash        string   `field:"hash"`        // 信息内容Hash
	Count       uint32   `field:"count"`       // 重复次数
	IsFixed     bool     `field:"isFixed"`     // 是否已处理
	IsRead      bool     `field:"isRead"`      // 是否已读
	Params      dbs.JSON `field:"params"`      // 参数
}

NodeLog 节点日志

type NodeLogDAO

type NodeLogDAO dbs.DAO
var SharedNodeLogDAO *NodeLogDAO

func NewNodeLogDAO

func NewNodeLogDAO() *NodeLogDAO

func (*NodeLogDAO) CountAllUnreadNodeLogs

func (this *NodeLogDAO) CountAllUnreadNodeLogs(tx *dbs.Tx) (int64, error)

CountAllUnreadNodeLogs 计算未读的日志数量

func (*NodeLogDAO) CountNodeLogs

func (this *NodeLogDAO) CountNodeLogs(tx *dbs.Tx,
	role string,
	nodeClusterId int64,
	nodeId int64,
	serverId int64,
	originId int64,
	allServers bool,
	dayFrom string,
	dayTo string,
	keyword string,
	level string,
	fixedState configutils.BoolState,
	isUnread bool,
	tag string) (int64, error)

CountNodeLogs 计算节点日志数量

func (*NodeLogDAO) CreateLog

func (this *NodeLogDAO) CreateLog(tx *dbs.Tx, nodeRole nodeconfigs.NodeRole, nodeId int64, serverId int64, originId int64, level string, tag string, description string, createdAt int64, logType string, paramsJSON []byte) error

CreateLog 创建日志

func (*NodeLogDAO) DeleteExpiredLogs

func (this *NodeLogDAO) DeleteExpiredLogs(tx *dbs.Tx, days int) error

DeleteExpiredLogs 清除超出一定日期的日志

func (*NodeLogDAO) DeleteExpiredLogsWithLevel

func (this *NodeLogDAO) DeleteExpiredLogsWithLevel(tx *dbs.Tx, level string, days int) error

DeleteExpiredLogsWithLevel 清除超出一定日期的某级别日志

func (*NodeLogDAO) DeleteNodeLogs added in v0.4.9

func (this *NodeLogDAO) DeleteNodeLogs(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64) error

DeleteNodeLogs 删除某个节点上的日志

func (*NodeLogDAO) DeleteNodeLogsWithCluster added in v0.5.0

func (this *NodeLogDAO) DeleteNodeLogsWithCluster(tx *dbs.Tx, role nodeconfigs.NodeRole, clusterId int64) error

DeleteNodeLogsWithCluster 删除某个集群下的所有日志

func (*NodeLogDAO) ListNodeLogs

func (this *NodeLogDAO) ListNodeLogs(tx *dbs.Tx,
	role string,
	nodeClusterId int64,
	nodeId int64,
	serverId int64,
	originId int64,
	allServers bool,
	dayFrom string,
	dayTo string,
	keyword string,
	level string,
	fixedState configutils.BoolState,
	isUnread bool,
	tag string,
	offset int64,
	size int64) (result []*NodeLog, err error)

ListNodeLogs 列出单页日志

func (*NodeLogDAO) UpdateAllNodeLogsFixed

func (this *NodeLogDAO) UpdateAllNodeLogsFixed(tx *dbs.Tx) error

UpdateAllNodeLogsFixed 设置所有节点日志为已修复

func (*NodeLogDAO) UpdateAllNodeLogsRead

func (this *NodeLogDAO) UpdateAllNodeLogsRead(tx *dbs.Tx) error

UpdateAllNodeLogsRead 设置所有日志为已读

func (*NodeLogDAO) UpdateNodeLogFixed

func (this *NodeLogDAO) UpdateNodeLogFixed(tx *dbs.Tx, logId int64) error

UpdateNodeLogFixed 设置节点日志为已修复

func (*NodeLogDAO) UpdateNodeLogIdsRead added in v0.5.2

func (this *NodeLogDAO) UpdateNodeLogIdsRead(tx *dbs.Tx, nodeLogIds []int64) error

UpdateNodeLogIdsRead 设置一组日志为已读

func (*NodeLogDAO) UpdateNodeLogsRead

func (this *NodeLogDAO) UpdateNodeLogsRead(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64) error

UpdateNodeLogsRead 设置节点日志为已读

type NodeLogOperator

type NodeLogOperator struct {
	Id          interface{} // ID
	Role        interface{} // 节点角色
	Type        interface{} // 类型
	CreatedAt   interface{} // 创建时间
	Tag         interface{} // 标签
	Description interface{} // 描述
	Level       interface{} // 级别
	NodeId      interface{} // 节点ID
	Day         interface{} // 日期
	ServerId    interface{} // 服务ID
	OriginId    interface{} // 源站ID
	Hash        interface{} // 信息内容Hash
	Count       interface{} // 重复次数
	IsFixed     interface{} // 是否已处理
	IsRead      interface{} // 是否已读
	Params      interface{} // 参数
}

func NewNodeLogOperator

func NewNodeLogOperator() *NodeLogOperator

type NodeLogin

type NodeLogin struct {
	Id     uint32   `field:"id"`     // ID
	NodeId uint32   `field:"nodeId"` // 节点ID
	Role   string   `field:"role"`   // 角色
	Name   string   `field:"name"`   // 名称
	Type   string   `field:"type"`   // 类型:ssh,agent
	Params dbs.JSON `field:"params"` // 配置参数
	State  uint8    `field:"state"`  // 状态
}

NodeLogin 节点登录信息

func (*NodeLogin) DecodeSSHParams

func (this *NodeLogin) DecodeSSHParams() (*NodeLoginSSHParams, error)

DecodeSSHParams 解析SSH登录参数

type NodeLoginDAO

type NodeLoginDAO dbs.DAO
var SharedNodeLoginDAO *NodeLoginDAO

func NewNodeLoginDAO

func NewNodeLoginDAO() *NodeLoginDAO

func (*NodeLoginDAO) CreateNodeLogin

func (this *NodeLoginDAO) CreateNodeLogin(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64, name string, loginType string, paramsJSON []byte) (loginId int64, err error)

CreateNodeLogin 创建认证

func (*NodeLoginDAO) DisableNodeLogin

func (this *NodeLoginDAO) DisableNodeLogin(tx *dbs.Tx, loginId int64) (rowsAffected int64, err error)

DisableNodeLogin 禁用条目

func (*NodeLoginDAO) DisableNodeLogins

func (this *NodeLoginDAO) DisableNodeLogins(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64) error

DisableNodeLogins 禁用某个节点的认证

func (*NodeLoginDAO) EnableNodeLogin

func (this *NodeLoginDAO) EnableNodeLogin(tx *dbs.Tx, id uint32) (rowsAffected int64, err error)

EnableNodeLogin 启用条目

func (*NodeLoginDAO) FindEnabledNodeLogin

func (this *NodeLoginDAO) FindEnabledNodeLogin(tx *dbs.Tx, id int64) (*NodeLogin, error)

FindEnabledNodeLogin 查找启用中的条目

func (*NodeLoginDAO) FindEnabledNodeLoginWithNodeId

func (this *NodeLoginDAO) FindEnabledNodeLoginWithNodeId(tx *dbs.Tx, role nodeconfigs.NodeRole, nodeId int64) (*NodeLogin, error)

FindEnabledNodeLoginWithNodeId 查找认证

func (*NodeLoginDAO) FindFrequentGrantIds

func (this *NodeLoginDAO) FindFrequentGrantIds(tx *dbs.Tx, nodeClusterId int64, nsClusterId int64) ([]int64, error)

func (*NodeLoginDAO) FindFrequentPorts

func (this *NodeLoginDAO) FindFrequentPorts(tx *dbs.Tx) ([]int32, error)

func (*NodeLoginDAO) FindNodeLoginName

func (this *NodeLoginDAO) FindNodeLoginName(tx *dbs.Tx, id uint32) (string, error)

FindNodeLoginName 根据主键查找名称

func (*NodeLoginDAO) UpdateNodeLogin

func (this *NodeLoginDAO) UpdateNodeLogin(tx *dbs.Tx, loginId int64, name string, loginType string, paramsJSON []byte) error

UpdateNodeLogin 修改认证

type NodeLoginOperator

type NodeLoginOperator struct {
	Id     interface{} // ID
	NodeId interface{} // 节点ID
	Role   interface{} // 角色
	Name   interface{} // 名称
	Type   interface{} // 类型:ssh,agent
	Params interface{} // 配置参数
	State  interface{} // 状态
}

func NewNodeLoginOperator

func NewNodeLoginOperator() *NodeLoginOperator

type NodeLoginSSHParams

type NodeLoginSSHParams struct {
	GrantId int64  `json:"grantId"`
	Host    string `json:"host"`
	Port    int    `json:"port"`
}

type NodeOperator

type NodeOperator struct {
	Id                     any // ID
	AdminId                any // 管理员ID
	UserId                 any // 用户ID
	Level                  any // 级别
	LnAddrs                any // Ln级别访问地址
	IsOn                   any // 是否启用
	IsUp                   any // 是否在线
	CountUp                any // 连续在线次数
	CountDown              any // 连续下线次数
	IsActive               any // 是否活跃
	InactiveNotifiedAt     any // 离线通知时间
	UniqueId               any // 节点ID
	Secret                 any // 密钥
	Name                   any // 节点名
	Code                   any // 代号
	ClusterId              any // 主集群ID
	SecondaryClusterIds    any // 从集群ID
	RegionId               any // 区域ID
	GroupId                any // 分组ID
	CreatedAt              any // 创建时间
	Status                 any // 最新的状态
	Version                any // 当前版本号
	LatestVersion          any // 最后版本号
	InstallDir             any // 安装目录
	IsInstalled            any // 是否已安装
	InstallStatus          any // 安装状态
	State                  any // 状态
	ConnectedAPINodes      any // 当前连接的API节点
	MaxCPU                 any // 可以使用的最多CPU
	MaxThreads             any // 最大线程数
	DdosProtection         any // DDOS配置
	DnsRoutes              any // DNS线路设置
	MaxCacheDiskCapacity   any // 硬盘缓存容量
	MaxCacheMemoryCapacity any // 内存缓存容量
	CacheDiskDir           any // 缓存目录
	DnsResolver            any // DNS解析器
}

func NewNodeOperator

func NewNodeOperator() *NodeOperator

type NodePriceItem

type NodePriceItem struct {
	Id        uint32 `field:"id"`        // ID
	IsOn      bool   `field:"isOn"`      // 是否启用
	Type      string `field:"type"`      // 类型:峰值|流量
	Name      string `field:"name"`      // 名称
	BitsFrom  uint64 `field:"bitsFrom"`  // 起始值
	BitsTo    uint64 `field:"bitsTo"`    // 结束值
	CreatedAt uint64 `field:"createdAt"` // 创建时间
	State     uint8  `field:"state"`     // 状态
}

NodePriceItem 区域计费设置

type NodePriceItemDAO

type NodePriceItemDAO dbs.DAO
var SharedNodePriceItemDAO *NodePriceItemDAO

func NewNodePriceItemDAO

func NewNodePriceItemDAO() *NodePriceItemDAO

func (*NodePriceItemDAO) CreateItem

func (this *NodePriceItemDAO) CreateItem(tx *dbs.Tx, name string, itemType string, bitsFrom, bitsTo int64) (int64, error)

CreateItem 创建价格

func (*NodePriceItemDAO) DisableNodePriceItem

func (this *NodePriceItemDAO) DisableNodePriceItem(tx *dbs.Tx, id int64) error

DisableNodePriceItem 禁用条目

func (*NodePriceItemDAO) EnableNodePriceItem

func (this *NodePriceItemDAO) EnableNodePriceItem(tx *dbs.Tx, id int64) error

EnableNodePriceItem 启用条目

func (*NodePriceItemDAO) FindAllEnabledAndOnRegionPrices

func (this *NodePriceItemDAO) FindAllEnabledAndOnRegionPrices(tx *dbs.Tx, priceType string) (result []*NodePriceItem, err error)

FindAllEnabledAndOnRegionPrices 列出某个区域的所有启用的价格

func (*NodePriceItemDAO) FindAllEnabledRegionPrices

func (this *NodePriceItemDAO) FindAllEnabledRegionPrices(tx *dbs.Tx, priceType string) (result []*NodePriceItem, err error)

FindAllEnabledRegionPrices 列出某个区域的所有价格

func (*NodePriceItemDAO) FindEnabledNodePriceItem

func (this *NodePriceItemDAO) FindEnabledNodePriceItem(tx *dbs.Tx, id int64) (*NodePriceItem, error)

FindEnabledNodePriceItem 查找启用中的条目

func (*NodePriceItemDAO) FindNodePriceItemName

func (this *NodePriceItemDAO) FindNodePriceItemName(tx *dbs.Tx, id int64) (string, error)

FindNodePriceItemName 根据主键查找名称

func (*NodePriceItemDAO) SearchItemsWithBytes

func (this *NodePriceItemDAO) SearchItemsWithBytes(items []*NodePriceItem, bytes int64) int64

SearchItemsWithBytes 根据字节查找付费项目

func (*NodePriceItemDAO) UpdateItem

func (this *NodePriceItemDAO) UpdateItem(tx *dbs.Tx, itemId int64, name string, bitsFrom, bitsTo int64) error

UpdateItem 修改价格

type NodePriceItemOperator

type NodePriceItemOperator struct {
	Id        interface{} // ID
	IsOn      interface{} // 是否启用
	Type      interface{} // 类型:峰值|流量
	Name      interface{} // 名称
	BitsFrom  interface{} // 起始值
	BitsTo    interface{} // 结束值
	CreatedAt interface{} // 创建时间
	State     interface{} // 状态
}

func NewNodePriceItemOperator

func NewNodePriceItemOperator() *NodePriceItemOperator

type NodeRegion

type NodeRegion struct {
	Id          uint32   `field:"id"`          // ID
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	Name        string   `field:"name"`        // 名称
	Description string   `field:"description"` // 描述
	Order       uint32   `field:"order"`       // 排序
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	Prices      dbs.JSON `field:"prices"`      // 价格
	State       uint8    `field:"state"`       // 状态
}

NodeRegion 节点区域

func (*NodeRegion) DecodePriceMap

func (this *NodeRegion) DecodePriceMap() map[int64]float64

type NodeRegionDAO

type NodeRegionDAO dbs.DAO
var SharedNodeRegionDAO *NodeRegionDAO

func NewNodeRegionDAO

func NewNodeRegionDAO() *NodeRegionDAO

func (*NodeRegionDAO) CreateRegion

func (this *NodeRegionDAO) CreateRegion(tx *dbs.Tx, adminId int64, name string, description string) (int64, error)

CreateRegion 创建区域

func (*NodeRegionDAO) DisableNodeRegion

func (this *NodeRegionDAO) DisableNodeRegion(tx *dbs.Tx, id int64) error

DisableNodeRegion 禁用条目

func (*NodeRegionDAO) EnableNodeRegion

func (this *NodeRegionDAO) EnableNodeRegion(tx *dbs.Tx, id int64) error

EnableNodeRegion 启用条目

func (*NodeRegionDAO) FindAllEnabledAndOnRegions

func (this *NodeRegionDAO) FindAllEnabledAndOnRegions(tx *dbs.Tx) (result []*NodeRegion, err error)

FindAllEnabledAndOnRegions 列出所有启用的区域

func (*NodeRegionDAO) FindAllEnabledRegionPrices

func (this *NodeRegionDAO) FindAllEnabledRegionPrices(tx *dbs.Tx) (result []*NodeRegion, err error)

FindAllEnabledRegionPrices 列出所有价格

func (*NodeRegionDAO) FindAllEnabledRegions

func (this *NodeRegionDAO) FindAllEnabledRegions(tx *dbs.Tx) (result []*NodeRegion, err error)

FindAllEnabledRegions 列出所有区域

func (*NodeRegionDAO) FindEnabledNodeRegion

func (this *NodeRegionDAO) FindEnabledNodeRegion(tx *dbs.Tx, id int64) (*NodeRegion, error)

FindEnabledNodeRegion 查找启用中的条目

func (*NodeRegionDAO) FindNodeRegionName

func (this *NodeRegionDAO) FindNodeRegionName(tx *dbs.Tx, id int64) (string, error)

FindNodeRegionName 根据主键查找名称

func (*NodeRegionDAO) UpdateRegion

func (this *NodeRegionDAO) UpdateRegion(tx *dbs.Tx, regionId int64, name string, description string, isOn bool) error

UpdateRegion 修改区域

func (*NodeRegionDAO) UpdateRegionItemPrice

func (this *NodeRegionDAO) UpdateRegionItemPrice(tx *dbs.Tx, regionId int64, itemId int64, price float32) error

UpdateRegionItemPrice 修改价格项价格

func (*NodeRegionDAO) UpdateRegionOrders

func (this *NodeRegionDAO) UpdateRegionOrders(tx *dbs.Tx, regionIds []int64) error

UpdateRegionOrders 排序

type NodeRegionOperator

type NodeRegionOperator struct {
	Id          interface{} // ID
	AdminId     interface{} // 管理员ID
	IsOn        interface{} // 是否启用
	Name        interface{} // 名称
	Description interface{} // 描述
	Order       interface{} // 排序
	CreatedAt   interface{} // 创建时间
	Prices      interface{} // 价格
	State       interface{} // 状态
}

func NewNodeRegionOperator

func NewNodeRegionOperator() *NodeRegionOperator

type NodeTask

type NodeTask struct {
	Id         uint64 `field:"id"`         // ID
	Role       string `field:"role"`       // 节点角色
	NodeId     uint32 `field:"nodeId"`     // 节点ID
	ClusterId  uint32 `field:"clusterId"`  // 集群ID
	ServerId   uint32 `field:"serverId"`   // 服务ID
	Type       string `field:"type"`       // 任务类型
	UniqueId   string `field:"uniqueId"`   // 唯一ID:nodeId@type
	UpdatedAt  uint64 `field:"updatedAt"`  // 修改时间
	IsDone     bool   `field:"isDone"`     // 是否已完成
	IsOk       bool   `field:"isOk"`       // 是否已完成
	Error      string `field:"error"`      // 错误信息
	IsNotified bool   `field:"isNotified"` // 是否已通知更新
	Version    uint64 `field:"version"`    // 版本
}

NodeTask 节点同步任务

type NodeTaskDAO

type NodeTaskDAO dbs.DAO
var SharedNodeTaskDAO *NodeTaskDAO

func NewNodeTaskDAO

func NewNodeTaskDAO() *NodeTaskDAO

func (*NodeTaskDAO) CountDoingNodeTasks

func (this *NodeTaskDAO) CountDoingNodeTasks(tx *dbs.Tx, role string) (int64, error)

CountDoingNodeTasks 计算正在执行的任务

func (*NodeTaskDAO) CreateClusterTask

func (this *NodeTaskDAO) CreateClusterTask(tx *dbs.Tx, role string, clusterId int64, serverId int64, taskType NodeTaskType) error

CreateClusterTask 创建集群任务

func (*NodeTaskDAO) CreateNodeTask

func (this *NodeTaskDAO) CreateNodeTask(tx *dbs.Tx, role string, clusterId int64, nodeId int64, serverId int64, taskType NodeTaskType, version int64) error

CreateNodeTask 创建单个节点任务

func (*NodeTaskDAO) DeleteAllClusterTasks

func (this *NodeTaskDAO) DeleteAllClusterTasks(tx *dbs.Tx, role string, clusterId int64) error

DeleteAllClusterTasks 删除集群所有相关任务

func (*NodeTaskDAO) DeleteNodeTask

func (this *NodeTaskDAO) DeleteNodeTask(tx *dbs.Tx, taskId int64) error

DeleteNodeTask 删除任务

func (*NodeTaskDAO) DeleteNodeTasks

func (this *NodeTaskDAO) DeleteNodeTasks(tx *dbs.Tx, role string, nodeId int64) error

DeleteNodeTasks 删除节点相关任务

func (*NodeTaskDAO) ExistsDoingNodeTasks

func (this *NodeTaskDAO) ExistsDoingNodeTasks(tx *dbs.Tx, role string, excludeTypes []NodeTaskType) (bool, error)

ExistsDoingNodeTasks 检查是否有正在执行的任务

func (*NodeTaskDAO) ExistsErrorNodeTasks

func (this *NodeTaskDAO) ExistsErrorNodeTasks(tx *dbs.Tx, role string, excludeTypes []NodeTaskType) (bool, error)

ExistsErrorNodeTasks 是否有错误的任务

func (*NodeTaskDAO) ExtractAllClusterTasks

func (this *NodeTaskDAO) ExtractAllClusterTasks(tx *dbs.Tx, role string) error

ExtractAllClusterTasks 分解所有集群任务

func (*NodeTaskDAO) ExtractNSClusterTask

func (this *NodeTaskDAO) ExtractNSClusterTask(tx *dbs.Tx, clusterId int64, taskType NodeTaskType) error

ExtractNSClusterTask 分解NS节点集群任务

func (*NodeTaskDAO) ExtractNodeClusterTask

func (this *NodeTaskDAO) ExtractNodeClusterTask(tx *dbs.Tx, clusterId int64, serverId int64, taskType NodeTaskType) error

ExtractNodeClusterTask 分解边缘节点集群任务

func (*NodeTaskDAO) FindAllDoingNodeIds

func (this *NodeTaskDAO) FindAllDoingNodeIds(tx *dbs.Tx, role string) ([]int64, error)

FindAllDoingNodeIds 查询有任务的节点IDs

func (*NodeTaskDAO) FindAllDoingNodeTasksWithClusterId

func (this *NodeTaskDAO) FindAllDoingNodeTasksWithClusterId(tx *dbs.Tx, role string, clusterId int64) (result []*NodeTask, err error)

FindAllDoingNodeTasksWithClusterId 查询某个集群下所有的任务

func (*NodeTaskDAO) FindAllDoingTaskClusterIds

func (this *NodeTaskDAO) FindAllDoingTaskClusterIds(tx *dbs.Tx, role string) ([]int64, error)

FindAllDoingTaskClusterIds 查找正在更新的集群IDs

func (*NodeTaskDAO) FindDoingNodeTasks

func (this *NodeTaskDAO) FindDoingNodeTasks(tx *dbs.Tx, role string, nodeId int64) (result []*NodeTask, err error)

FindDoingNodeTasks 查询一个节点的所有任务

func (*NodeTaskDAO) FindNotifyingNodeTasks

func (this *NodeTaskDAO) FindNotifyingNodeTasks(tx *dbs.Tx, role string, size int64) (result []*NodeTask, err error)

FindNotifyingNodeTasks 查找需要通知的任务

func (*NodeTaskDAO) UpdateNodeTaskDone

func (this *NodeTaskDAO) UpdateNodeTaskDone(tx *dbs.Tx, taskId int64, isOk bool, errorMessage string) error

UpdateNodeTaskDone 修改节点任务的完成状态

func (*NodeTaskDAO) UpdateTasksNotified

func (this *NodeTaskDAO) UpdateTasksNotified(tx *dbs.Tx, taskIds []int64) error

UpdateTasksNotified 设置任务已通知

type NodeTaskOperator

type NodeTaskOperator struct {
	Id         interface{} // ID
	Role       interface{} // 节点角色
	NodeId     interface{} // 节点ID
	ClusterId  interface{} // 集群ID
	ServerId   interface{} // 服务ID
	Type       interface{} // 任务类型
	UniqueId   interface{} // 唯一ID:nodeId@type
	UpdatedAt  interface{} // 修改时间
	IsDone     interface{} // 是否已完成
	IsOk       interface{} // 是否已完成
	Error      interface{} // 错误信息
	IsNotified interface{} // 是否已通知更新
	Version    interface{} // 版本
}

func NewNodeTaskOperator

func NewNodeTaskOperator() *NodeTaskOperator

type NodeTaskType

type NodeTaskType = string
const (
	NodeTaskTypeConfigChanged             NodeTaskType = "configChanged"             // 节点整体配置变化
	NodeTaskTypeDDosProtectionChanged     NodeTaskType = "ddosProtectionChanged"     // 节点DDoS配置变更
	NodeTaskTypeGlobalServerConfigChanged NodeTaskType = "globalServerConfigChanged" // 全局服务设置变化
	NodeTaskTypeIPItemChanged             NodeTaskType = "ipItemChanged"
	NodeTaskTypeNodeVersionChanged        NodeTaskType = "nodeVersionChanged"
	NodeTaskTypeScriptsChanged            NodeTaskType = "scriptsChanged"
	NodeTaskTypeNodeLevelChanged          NodeTaskType = "nodeLevelChanged"

	NSNodeTaskTypeConfigChanged         NodeTaskType = "nsConfigChanged"
	NSNodeTaskTypeDomainChanged         NodeTaskType = "nsDomainChanged"
	NSNodeTaskTypeRecordChanged         NodeTaskType = "nsRecordChanged"
	NSNodeTaskTypeRouteChanged          NodeTaskType = "nsRouteChanged"
	NSNodeTaskTypeKeyChanged            NodeTaskType = "nsKeyChanged"
	NSNodeTaskTypeDDosProtectionChanged NodeTaskType = "nsDDoSProtectionChanged" // 节点DDoS配置变更
)

type NodeThreshold

type NodeThreshold struct {
	Id             uint64   `field:"id"`             // ID
	Role           string   `field:"role"`           // 节点角色
	ClusterId      uint32   `field:"clusterId"`      // 集群ID
	NodeId         uint32   `field:"nodeId"`         // 节点ID
	IsOn           bool     `field:"isOn"`           // 是否启用
	Item           string   `field:"item"`           // 监控项
	Param          string   `field:"param"`          // 参数
	Operator       string   `field:"operator"`       // 操作符
	Value          dbs.JSON `field:"value"`          // 对比值
	Message        string   `field:"message"`        // 消息内容
	NotifyDuration uint32   `field:"notifyDuration"` // 通知间隔
	NotifiedAt     uint32   `field:"notifiedAt"`     // 上次通知时间
	Duration       uint32   `field:"duration"`       // 时间段
	DurationUnit   string   `field:"durationUnit"`   // 时间段单位
	SumMethod      string   `field:"sumMethod"`      // 聚合方法
	Order          uint32   `field:"order"`          // 排序
	State          uint8    `field:"state"`          // 状态
}

NodeThreshold 集群阈值设置

type NodeThresholdDAO

type NodeThresholdDAO dbs.DAO
var SharedNodeThresholdDAO *NodeThresholdDAO

func NewNodeThresholdDAO

func NewNodeThresholdDAO() *NodeThresholdDAO

func (*NodeThresholdDAO) CountAllEnabledThresholds

func (this *NodeThresholdDAO) CountAllEnabledThresholds(tx *dbs.Tx, role string, clusterId int64, nodeId int64) (int64, error)

CountAllEnabledThresholds 计算阈值的数量

func (*NodeThresholdDAO) CreateThreshold

func (this *NodeThresholdDAO) CreateThreshold(tx *dbs.Tx, role string, clusterId int64, nodeId int64, item nodeconfigs.NodeValueItem, param string, operator nodeconfigs.NodeValueOperator, valueJSON []byte, message string, sumMethod nodeconfigs.NodeValueSumMethod, duration int32, durationUnit nodeconfigs.NodeValueDurationUnit, notifyDuration int32) (int64, error)

CreateThreshold 创建阈值

func (*NodeThresholdDAO) DisableNodeThreshold

func (this *NodeThresholdDAO) DisableNodeThreshold(tx *dbs.Tx, id int64) error

DisableNodeThreshold 禁用条目

func (*NodeThresholdDAO) EnableNodeThreshold

func (this *NodeThresholdDAO) EnableNodeThreshold(tx *dbs.Tx, id int64) error

EnableNodeThreshold 启用条目

func (*NodeThresholdDAO) FindAllEnabledAndOnClusterThresholds

func (this *NodeThresholdDAO) FindAllEnabledAndOnClusterThresholds(tx *dbs.Tx, role string, clusterId int64, item string) (result []*NodeThreshold, err error)

FindAllEnabledAndOnClusterThresholds 查询集群专属的阈值设置

func (*NodeThresholdDAO) FindAllEnabledAndOnNodeThresholds

func (this *NodeThresholdDAO) FindAllEnabledAndOnNodeThresholds(tx *dbs.Tx, role string, nodeId int64, item string) (result []*NodeThreshold, err error)

FindAllEnabledAndOnNodeThresholds 查询节点专属的阈值设置

func (*NodeThresholdDAO) FindAllEnabledThresholds

func (this *NodeThresholdDAO) FindAllEnabledThresholds(tx *dbs.Tx, role string, clusterId int64, nodeId int64) (result []*NodeThreshold, err error)

FindAllEnabledThresholds 列出所有阈值

func (*NodeThresholdDAO) FindEnabledNodeThreshold

func (this *NodeThresholdDAO) FindEnabledNodeThreshold(tx *dbs.Tx, id int64) (*NodeThreshold, error)

FindEnabledNodeThreshold 查找启用中的条目

func (*NodeThresholdDAO) FireNodeThreshold

func (this *NodeThresholdDAO) FireNodeThreshold(tx *dbs.Tx, role string, nodeId int64, item string) error

FireNodeThreshold 触发相关阈值设置

func (*NodeThresholdDAO) UpdateThreshold

func (this *NodeThresholdDAO) UpdateThreshold(tx *dbs.Tx, thresholdId int64, item nodeconfigs.NodeValueItem, param string, operator nodeconfigs.NodeValueOperator, valueJSON []byte, message string, sumMethod nodeconfigs.NodeValueSumMethod, duration int32, durationUnit nodeconfigs.NodeValueDurationUnit, notifyDuration int32, isOn bool) error

UpdateThreshold 修改阈值

type NodeThresholdOperator

type NodeThresholdOperator struct {
	Id             interface{} // ID
	Role           interface{} // 节点角色
	ClusterId      interface{} // 集群ID
	NodeId         interface{} // 节点ID
	IsOn           interface{} // 是否启用
	Item           interface{} // 监控项
	Param          interface{} // 参数
	Operator       interface{} // 操作符
	Value          interface{} // 对比值
	Message        interface{} // 消息内容
	NotifyDuration interface{} // 通知间隔
	NotifiedAt     interface{} // 上次通知时间
	Duration       interface{} // 时间段
	DurationUnit   interface{} // 时间段单位
	SumMethod      interface{} // 聚合方法
	Order          interface{} // 排序
	State          interface{} // 状态
}

func NewNodeThresholdOperator

func NewNodeThresholdOperator() *NodeThresholdOperator

type NodeValue

type NodeValue struct {
	Id        uint64   `field:"id"`        // ID
	ClusterId uint32   `field:"clusterId"` // 集群ID
	NodeId    uint32   `field:"nodeId"`    // 节点ID
	Role      string   `field:"role"`      // 节点角色
	Item      string   `field:"item"`      // 监控项
	Value     dbs.JSON `field:"value"`     // 数据
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	Day       string   `field:"day"`       // 日期
	Hour      string   `field:"hour"`      // 小时
	Minute    string   `field:"minute"`    // 分钟
}

NodeValue 节点监控数据

func (*NodeValue) DecodeMapValue

func (this *NodeValue) DecodeMapValue() maps.Map

type NodeValueDAO

type NodeValueDAO dbs.DAO
var SharedNodeValueDAO *NodeValueDAO

func NewNodeValueDAO

func NewNodeValueDAO() *NodeValueDAO

func (*NodeValueDAO) Clean

func (this *NodeValueDAO) Clean(tx *dbs.Tx) error

Clean 清除数据

func (*NodeValueDAO) ComposeNodeStatus

func (this *NodeValueDAO) ComposeNodeStatus(tx *dbs.Tx, role string, nodeId int64, statusConfig *nodeconfigs.NodeStatus) error

ComposeNodeStatus 组合节点状态值

func (*NodeValueDAO) ComposeNodeStatusJSON

func (this *NodeValueDAO) ComposeNodeStatusJSON(tx *dbs.Tx, role string, nodeId int64, statusJSON []byte) ([]byte, error)

ComposeNodeStatusJSON 组合节点状态值,并转换为JSON数据

func (*NodeValueDAO) CreateValue

func (this *NodeValueDAO) CreateValue(tx *dbs.Tx, clusterId int64, role nodeconfigs.NodeRole, nodeId int64, item string, valueJSON []byte, createdAt int64) error

CreateValue 创建值

func (*NodeValueDAO) FindLatestNodeValue

func (this *NodeValueDAO) FindLatestNodeValue(tx *dbs.Tx, role string, nodeId int64, item string) (*NodeValue, error)

FindLatestNodeValue 获取最近一条数据

func (*NodeValueDAO) ListValues

func (this *NodeValueDAO) ListValues(tx *dbs.Tx, role string, nodeId int64, item string, timeRange nodeconfigs.NodeValueRange) (result []*NodeValue, err error)

ListValues 列出最近的的数据

func (*NodeValueDAO) ListValuesForNSNodes

func (this *NodeValueDAO) ListValuesForNSNodes(tx *dbs.Tx, item string, key string, timeRange nodeconfigs.NodeValueRange) (result []*NodeValue, err error)

ListValuesForNSNodes 列出用户节点相关的平均数据

func (*NodeValueDAO) ListValuesForUserNodes

func (this *NodeValueDAO) ListValuesForUserNodes(tx *dbs.Tx, item string, key string, timeRange nodeconfigs.NodeValueRange) (result []*NodeValue, err error)

ListValuesForUserNodes 列出用户节点相关的平均数据

func (*NodeValueDAO) ListValuesWithClusterId

func (this *NodeValueDAO) ListValuesWithClusterId(tx *dbs.Tx, role string, clusterId int64, item string, key string, timeRange nodeconfigs.NodeValueRange) (result []*NodeValue, err error)

ListValuesWithClusterId 列出集群最近的的平均数据

func (*NodeValueDAO) SumAllNodeValues

func (this *NodeValueDAO) SumAllNodeValues(tx *dbs.Tx, role string, item nodeconfigs.NodeValueItem, param string, duration int32, durationUnit nodeconfigs.NodeValueDurationUnit) (total float64, avg float64, max float64, err error)

SumAllNodeValues 计算所有节点的某项参数值

func (*NodeValueDAO) SumNodeClusterValues

func (this *NodeValueDAO) SumNodeClusterValues(tx *dbs.Tx, role string, clusterId int64, item string, param string, method nodeconfigs.NodeValueSumMethod, duration int32, durationUnit nodeconfigs.NodeValueDurationUnit) (float64, error)

SumNodeClusterValues 计算节点集群的某项参数值

func (*NodeValueDAO) SumNodeGroupValues

func (this *NodeValueDAO) SumNodeGroupValues(tx *dbs.Tx, role string, groupId int64, item string, param string, method nodeconfigs.NodeValueSumMethod, duration int32, durationUnit nodeconfigs.NodeValueDurationUnit) (float64, error)

SumNodeGroupValues 计算节点分组的某项参数值

func (*NodeValueDAO) SumNodeValues

func (this *NodeValueDAO) SumNodeValues(tx *dbs.Tx, role string, nodeId int64, item string, param string, method nodeconfigs.NodeValueSumMethod, duration int32, durationUnit nodeconfigs.NodeValueDurationUnit) (float64, error)

SumNodeValues 计算节点的某项参数值

type NodeValueOperator

type NodeValueOperator struct {
	Id        interface{} // ID
	ClusterId interface{} // 集群ID
	NodeId    interface{} // 节点ID
	Role      interface{} // 节点角色
	Item      interface{} // 监控项
	Value     interface{} // 数据
	CreatedAt interface{} // 创建时间
	Day       interface{} // 日期
	Hour      interface{} // 小时
	Minute    interface{} // 分钟
}

func NewNodeValueOperator

func NewNodeValueOperator() *NodeValueOperator

type Origin

type Origin struct {
	Id                 uint32   `field:"id"`                 // ID
	AdminId            uint32   `field:"adminId"`            // 管理员ID
	UserId             uint32   `field:"userId"`             // 用户ID
	IsOn               bool     `field:"isOn"`               // 是否启用
	Name               string   `field:"name"`               // 名称
	Version            uint32   `field:"version"`            // 版本
	Addr               dbs.JSON `field:"addr"`               // 地址
	Description        string   `field:"description"`        // 描述
	Code               string   `field:"code"`               // 代号
	Weight             uint32   `field:"weight"`             // 权重
	ConnTimeout        dbs.JSON `field:"connTimeout"`        // 连接超时
	ReadTimeout        dbs.JSON `field:"readTimeout"`        // 读超时
	IdleTimeout        dbs.JSON `field:"idleTimeout"`        // 空闲连接超时
	MaxFails           uint32   `field:"maxFails"`           // 最多失败次数
	MaxConns           uint32   `field:"maxConns"`           // 最大并发连接数
	MaxIdleConns       uint32   `field:"maxIdleConns"`       // 最多空闲连接数
	HttpRequestURI     string   `field:"httpRequestURI"`     // 转发后的请求URI
	HttpRequestHeader  dbs.JSON `field:"httpRequestHeader"`  // 请求Header配置
	HttpResponseHeader dbs.JSON `field:"httpResponseHeader"` // 响应Header配置
	Host               string   `field:"host"`               // 自定义主机名
	HealthCheck        dbs.JSON `field:"healthCheck"`        // 健康检查设置
	Cert               dbs.JSON `field:"cert"`               // 证书设置
	Ftp                dbs.JSON `field:"ftp"`                // FTP相关设置
	CreatedAt          uint64   `field:"createdAt"`          // 创建时间
	Domains            dbs.JSON `field:"domains"`            // 所属域名
	FollowPort         bool     `field:"followPort"`         // 端口跟随
	State              uint8    `field:"state"`              // 状态
}

Origin 源站

func (*Origin) DecodeAddr

func (this *Origin) DecodeAddr() (*serverconfigs.NetworkAddressConfig, error)

DecodeAddr 解析地址

func (*Origin) DecodeDomains

func (this *Origin) DecodeDomains() []string

type OriginDAO

type OriginDAO dbs.DAO
var SharedOriginDAO *OriginDAO

func NewOriginDAO

func NewOriginDAO() *OriginDAO

func (*OriginDAO) CheckUserOrigin added in v0.4.9

func (this *OriginDAO) CheckUserOrigin(tx *dbs.Tx, userId int64, originId int64) error

CheckUserOrigin 检查源站权限

func (*OriginDAO) ComposeOriginConfig

func (this *OriginDAO) ComposeOriginConfig(tx *dbs.Tx, originId int64, cacheMap *utils.CacheMap) (*serverconfigs.OriginConfig, error)

ComposeOriginConfig 将源站信息转换为配置

func (*OriginDAO) CreateOrigin

func (this *OriginDAO) CreateOrigin(tx *dbs.Tx,
	adminId int64,
	userId int64,
	name string,
	addrJSON string,
	description string,
	weight int32, isOn bool,
	connTimeout *shared.TimeDuration,
	readTimeout *shared.TimeDuration,
	idleTimeout *shared.TimeDuration,
	maxConns int32,
	maxIdleConns int32,
	certRef *sslconfigs.SSLCertRef,
	domains []string,
	host string,
	followPort bool) (originId int64, err error)

CreateOrigin 创建源站

func (*OriginDAO) DisableOrigin

func (this *OriginDAO) DisableOrigin(tx *dbs.Tx, originId int64) error

DisableOrigin 禁用条目

func (*OriginDAO) EnableOrigin

func (this *OriginDAO) EnableOrigin(tx *dbs.Tx, id int64) error

EnableOrigin 启用条目

func (*OriginDAO) FindEnabledOrigin

func (this *OriginDAO) FindEnabledOrigin(tx *dbs.Tx, id int64) (*Origin, error)

FindEnabledOrigin 查找启用中的条目

func (*OriginDAO) FindOriginName

func (this *OriginDAO) FindOriginName(tx *dbs.Tx, id int64) (string, error)

FindOriginName 根据主键查找名称

func (*OriginDAO) Init

func (this *OriginDAO) Init()

Init 初始化

func (*OriginDAO) NotifyUpdate

func (this *OriginDAO) NotifyUpdate(tx *dbs.Tx, originId int64) error

NotifyUpdate 通知更新

func (*OriginDAO) UpdateOrigin

func (this *OriginDAO) UpdateOrigin(tx *dbs.Tx,
	originId int64,
	name string,
	addrJSON string,
	description string,
	weight int32,
	isOn bool,
	connTimeout *shared.TimeDuration,
	readTimeout *shared.TimeDuration,
	idleTimeout *shared.TimeDuration,
	maxConns int32,
	maxIdleConns int32,
	certRef *sslconfigs.SSLCertRef,
	domains []string,
	host string,
	followPort bool) error

UpdateOrigin 修改源站

type OriginOperator

type OriginOperator struct {
	Id                 interface{} // ID
	AdminId            interface{} // 管理员ID
	UserId             interface{} // 用户ID
	IsOn               interface{} // 是否启用
	Name               interface{} // 名称
	Version            interface{} // 版本
	Addr               interface{} // 地址
	Description        interface{} // 描述
	Code               interface{} // 代号
	Weight             interface{} // 权重
	ConnTimeout        interface{} // 连接超时
	ReadTimeout        interface{} // 读超时
	IdleTimeout        interface{} // 空闲连接超时
	MaxFails           interface{} // 最多失败次数
	MaxConns           interface{} // 最大并发连接数
	MaxIdleConns       interface{} // 最多空闲连接数
	HttpRequestURI     interface{} // 转发后的请求URI
	HttpRequestHeader  interface{} // 请求Header配置
	HttpResponseHeader interface{} // 响应Header配置
	Host               interface{} // 自定义主机名
	HealthCheck        interface{} // 健康检查设置
	Cert               interface{} // 证书设置
	Ftp                interface{} // FTP相关设置
	CreatedAt          interface{} // 创建时间
	Domains            interface{} // 所属域名
	FollowPort         interface{} // 端口跟随
	State              interface{} // 状态
}

func NewOriginOperator

func NewOriginOperator() *OriginOperator

type Plan

type Plan struct {
	Id              uint32   `field:"id"`              // ID
	IsOn            bool     `field:"isOn"`            // 是否启用
	Name            string   `field:"name"`            // 套餐名
	ClusterId       uint32   `field:"clusterId"`       // 集群ID
	TrafficLimit    dbs.JSON `field:"trafficLimit"`    // 流量限制
	Features        dbs.JSON `field:"features"`        // 允许的功能
	TrafficPrice    dbs.JSON `field:"trafficPrice"`    // 流量价格设定
	BandwidthPrice  dbs.JSON `field:"bandwidthPrice"`  // 带宽价格
	MonthlyPrice    float64  `field:"monthlyPrice"`    // 月付
	SeasonallyPrice float64  `field:"seasonallyPrice"` // 季付
	YearlyPrice     float64  `field:"yearlyPrice"`     // 年付
	PriceType       string   `field:"priceType"`       // 价格类型
	Order           uint32   `field:"order"`           // 排序
	State           uint8    `field:"state"`           // 状态
}

Plan 用户套餐

func (*Plan) DecodeBandwidthPrice

func (this *Plan) DecodeBandwidthPrice() *serverconfigs.PlanBandwidthPriceConfig

DecodeBandwidthPrice 带宽价格配置

func (*Plan) DecodeTrafficPrice

func (this *Plan) DecodeTrafficPrice() *serverconfigs.PlanTrafficPriceConfig

DecodeTrafficPrice 流量价格配置

type PlanDAO

type PlanDAO dbs.DAO
var SharedPlanDAO *PlanDAO

func NewPlanDAO

func NewPlanDAO() *PlanDAO

func (*PlanDAO) CountAllEnabledPlans

func (this *PlanDAO) CountAllEnabledPlans(tx *dbs.Tx) (int64, error)

CountAllEnabledPlans 计算套餐的数量

func (*PlanDAO) CreatePlan

func (this *PlanDAO) CreatePlan(tx *dbs.Tx,
	name string,
	clusterId int64,
	trafficLimitJSON []byte,
	featuresJSON []byte,
	priceType serverconfigs.PlanPriceType,
	trafficPriceJSON []byte,
	bandwidthPriceJSON []byte,
	monthlyPrice float32,
	seasonallyPrice float32,
	yearlyPrice float32) (int64, error)

CreatePlan 创建套餐

func (*PlanDAO) DisablePlan

func (this *PlanDAO) DisablePlan(tx *dbs.Tx, id int64) error

DisablePlan 禁用条目

func (*PlanDAO) EnablePlan

func (this *PlanDAO) EnablePlan(tx *dbs.Tx, id uint32) error

EnablePlan 启用条目

func (*PlanDAO) FindAllEnabledPlans

func (this *PlanDAO) FindAllEnabledPlans(tx *dbs.Tx) (result []*Plan, err error)

FindAllEnabledPlans 查找所有可用套餐

func (*PlanDAO) FindEnabledPlan

func (this *PlanDAO) FindEnabledPlan(tx *dbs.Tx, id int64) (*Plan, error)

FindEnabledPlan 查找启用中的条目

func (*PlanDAO) FindEnabledPlanTrafficLimit

func (this *PlanDAO) FindEnabledPlanTrafficLimit(tx *dbs.Tx, planId int64, cacheMap *utils.CacheMap) (*serverconfigs.TrafficLimitConfig, error)

FindEnabledPlanTrafficLimit 获取套餐的流量限制

func (*PlanDAO) FindPlanName

func (this *PlanDAO) FindPlanName(tx *dbs.Tx, id int64) (string, error)

FindPlanName 根据主键查找名称

func (*PlanDAO) ListEnabledPlans

func (this *PlanDAO) ListEnabledPlans(tx *dbs.Tx, offset int64, size int64) (result []*Plan, err error)

ListEnabledPlans 列出单页套餐

func (*PlanDAO) NotifyUpdate

func (this *PlanDAO) NotifyUpdate(tx *dbs.Tx, planId int64) error

NotifyUpdate 通知变更

func (*PlanDAO) SortPlans

func (this *PlanDAO) SortPlans(tx *dbs.Tx, planIds []int64) error

SortPlans 增加排序

func (*PlanDAO) UpdatePlan

func (this *PlanDAO) UpdatePlan(tx *dbs.Tx,
	planId int64,
	name string,
	isOn bool,
	clusterId int64,
	trafficLimitJSON []byte,
	featuresJSON []byte,
	priceType serverconfigs.PlanPriceType,
	trafficPriceJSON []byte,
	bandwidthPriceJSON []byte,
	monthlyPrice float32,
	seasonallyPrice float32,
	yearlyPrice float32) error

UpdatePlan 修改套餐

type PlanOperator

type PlanOperator struct {
	Id              interface{} // ID
	IsOn            interface{} // 是否启用
	Name            interface{} // 套餐名
	ClusterId       interface{} // 集群ID
	TrafficLimit    interface{} // 流量限制
	Features        interface{} // 允许的功能
	TrafficPrice    interface{} // 流量价格设定
	BandwidthPrice  interface{} // 带宽价格
	MonthlyPrice    interface{} // 月付
	SeasonallyPrice interface{} // 季付
	YearlyPrice     interface{} // 年付
	PriceType       interface{} // 价格类型
	Order           interface{} // 排序
	State           interface{} // 状态
}

func NewPlanOperator

func NewPlanOperator() *PlanOperator

type Provider

type Provider struct {
	Id        uint32 `field:"id"`        // ID
	Username  string `field:"username"`  // 用户名
	Password  string `field:"password"`  // 密码
	Fullname  string `field:"fullname"`  // 真实姓名
	CreatedAt uint64 `field:"createdAt"` // 创建时间
	UpdatedAt uint64 `field:"updatedAt"` // 修改时间
	State     uint8  `field:"state"`     // 状态
}

供应商

type ProviderDAO

type ProviderDAO dbs.DAO
var SharedProviderDAO *ProviderDAO

func NewProviderDAO

func NewProviderDAO() *ProviderDAO

func (*ProviderDAO) DisableProvider

func (this *ProviderDAO) DisableProvider(tx *dbs.Tx, id int64) (rowsAffected int64, err error)

禁用条目

func (*ProviderDAO) EnableProvider

func (this *ProviderDAO) EnableProvider(tx *dbs.Tx, id int64) (rowsAffected int64, err error)

启用条目

func (*ProviderDAO) FindEnabledProvider

func (this *ProviderDAO) FindEnabledProvider(tx *dbs.Tx, id int64) (*Provider, error)

查找启用中的条目

func (*ProviderDAO) FindProviderName

func (this *ProviderDAO) FindProviderName(tx *dbs.Tx, providerId int64) (string, error)

查找供应商名称

type ProviderOperator

type ProviderOperator struct {
	Id        interface{} // ID
	Username  interface{} // 用户名
	Password  interface{} // 密码
	Fullname  interface{} // 真实姓名
	CreatedAt interface{} // 创建时间
	UpdatedAt interface{} // 修改时间
	State     interface{} // 状态
}

func NewProviderOperator

func NewProviderOperator() *ProviderOperator

type ReportNode

type ReportNode struct {
	Id        uint32   `field:"id"`        // ID
	UniqueId  string   `field:"uniqueId"`  // 唯一ID
	Secret    string   `field:"secret"`    // 密钥
	IsOn      bool     `field:"isOn"`      // 是否启用
	Name      string   `field:"name"`      // 名称
	Location  string   `field:"location"`  // 所在区域
	Isp       string   `field:"isp"`       // 网络服务商
	AllowIPs  dbs.JSON `field:"allowIPs"`  // 允许的IP
	IsActive  bool     `field:"isActive"`  // 是否活跃
	Status    dbs.JSON `field:"status"`    // 状态
	State     uint8    `field:"state"`     // 状态
	CreatedAt uint64   `field:"createdAt"` // 创建时间
	GroupIds  dbs.JSON `field:"groupIds"`  // 分组ID
}

ReportNode 连通性报告终端

func (*ReportNode) DecodeAllowIPs

func (this *ReportNode) DecodeAllowIPs() []string

func (*ReportNode) DecodeGroupIds

func (this *ReportNode) DecodeGroupIds() []int64

type ReportNodeDAO

type ReportNodeDAO dbs.DAO
var SharedReportNodeDAO *ReportNodeDAO

func NewReportNodeDAO

func NewReportNodeDAO() *ReportNodeDAO

func (*ReportNodeDAO) ComposeConfig

func (this *ReportNodeDAO) ComposeConfig(tx *dbs.Tx, nodeId int64) (*reporterconfigs.NodeConfig, error)

ComposeConfig 组合配置

func (*ReportNodeDAO) CountAllEnabledAndOnReportNodes

func (this *ReportNodeDAO) CountAllEnabledAndOnReportNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAndOnReportNodes 计算可用的终端数量

func (*ReportNodeDAO) CountAllEnabledReportNodes

func (this *ReportNodeDAO) CountAllEnabledReportNodes(tx *dbs.Tx, groupId int64, keyword string) (int64, error)

CountAllEnabledReportNodes 计算终端数量

func (*ReportNodeDAO) CountAllLowerVersionNodes

func (this *ReportNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有节点中低于某个版本的节点数量

func (*ReportNodeDAO) CreateReportNode

func (this *ReportNodeDAO) CreateReportNode(tx *dbs.Tx, name string, location string, isp string, allowIPs []string, groupIds []int64) (int64, error)

CreateReportNode 创建终端

func (*ReportNodeDAO) DisableReportNode

func (this *ReportNodeDAO) DisableReportNode(tx *dbs.Tx, nodeId int64) error

DisableReportNode 禁用条目

func (*ReportNodeDAO) EnableReportNode

func (this *ReportNodeDAO) EnableReportNode(tx *dbs.Tx, id int64) error

EnableReportNode 启用条目

func (*ReportNodeDAO) FindEnabledNodeIdWithUniqueId

func (this *ReportNodeDAO) FindEnabledNodeIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledNodeIdWithUniqueId 根据唯一ID获取节点ID

func (*ReportNodeDAO) FindEnabledReportNode

func (this *ReportNodeDAO) FindEnabledReportNode(tx *dbs.Tx, id int64) (*ReportNode, error)

FindEnabledReportNode 查找启用中的条目

func (*ReportNodeDAO) FindNodeActive

func (this *ReportNodeDAO) FindNodeActive(tx *dbs.Tx, nodeId int64) (bool, error)

FindNodeActive 检查节点活跃状态

func (*ReportNodeDAO) FindNodeAllowIPs

func (this *ReportNodeDAO) FindNodeAllowIPs(tx *dbs.Tx, nodeId int64) ([]string, error)

FindNodeAllowIPs 查询节点允许的IP

func (*ReportNodeDAO) FindReportNodeName

func (this *ReportNodeDAO) FindReportNodeName(tx *dbs.Tx, id int64) (string, error)

FindReportNodeName 根据主键查找名称

func (*ReportNodeDAO) GenUniqueId

func (this *ReportNodeDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*ReportNodeDAO) ListEnabledReportNodes

func (this *ReportNodeDAO) ListEnabledReportNodes(tx *dbs.Tx, groupId int64, keyword string, offset int64, size int64) (result []*ReportNode, err error)

ListEnabledReportNodes 列出单页终端

func (*ReportNodeDAO) UpdateNodeActive

func (this *ReportNodeDAO) UpdateNodeActive(tx *dbs.Tx, nodeId int64, isActive bool) error

UpdateNodeActive 修改节点活跃状态

func (*ReportNodeDAO) UpdateNodeStatus

func (this *ReportNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, nodeStatus *reporterconfigs.Status) error

UpdateNodeStatus 更改节点状态

func (*ReportNodeDAO) UpdateReportNode

func (this *ReportNodeDAO) UpdateReportNode(tx *dbs.Tx, nodeId int64, name string, location string, isp string, allowIPs []string, groupIds []int64, isOn bool) error

UpdateReportNode 修改终端

type ReportNodeGroup

type ReportNodeGroup struct {
	Id    uint32 `field:"id"`    // ID
	Name  string `field:"name"`  // 名称
	State uint8  `field:"state"` // 状态
	IsOn  bool   `field:"isOn"`  // 是否启用
}

ReportNodeGroup 监控终端区域

type ReportNodeGroupDAO

type ReportNodeGroupDAO dbs.DAO
var SharedReportNodeGroupDAO *ReportNodeGroupDAO

func NewReportNodeGroupDAO

func NewReportNodeGroupDAO() *ReportNodeGroupDAO

func (*ReportNodeGroupDAO) CountAllEnabledGroups

func (this *ReportNodeGroupDAO) CountAllEnabledGroups(tx *dbs.Tx) (int64, error)

CountAllEnabledGroups 查找所有分组的数量

func (*ReportNodeGroupDAO) CreateGroup

func (this *ReportNodeGroupDAO) CreateGroup(tx *dbs.Tx, name string) (int64, error)

CreateGroup 创建

func (*ReportNodeGroupDAO) DisableReportNodeGroup

func (this *ReportNodeGroupDAO) DisableReportNodeGroup(tx *dbs.Tx, id int64) error

DisableReportNodeGroup 禁用条目

func (*ReportNodeGroupDAO) EnableReportNodeGroup

func (this *ReportNodeGroupDAO) EnableReportNodeGroup(tx *dbs.Tx, id uint32) error

EnableReportNodeGroup 启用条目

func (*ReportNodeGroupDAO) FindAllEnabledGroups

func (this *ReportNodeGroupDAO) FindAllEnabledGroups(tx *dbs.Tx) (result []*ReportNodeGroup, err error)

FindAllEnabledGroups 查找所有可用的分组

func (*ReportNodeGroupDAO) FindEnabledReportNodeGroup

func (this *ReportNodeGroupDAO) FindEnabledReportNodeGroup(tx *dbs.Tx, id int64) (*ReportNodeGroup, error)

FindEnabledReportNodeGroup 查找启用中的条目

func (*ReportNodeGroupDAO) FindReportNodeGroupName

func (this *ReportNodeGroupDAO) FindReportNodeGroupName(tx *dbs.Tx, id int64) (string, error)

FindReportNodeGroupName 根据主键查找名称

func (*ReportNodeGroupDAO) UpdateGroup

func (this *ReportNodeGroupDAO) UpdateGroup(tx *dbs.Tx, groupId int64, name string) error

UpdateGroup 修改

type ReportNodeGroupOperator

type ReportNodeGroupOperator struct {
	Id    interface{} // ID
	Name  interface{} // 名称
	State interface{} // 状态
	IsOn  interface{} // 是否启用
}

func NewReportNodeGroupOperator

func NewReportNodeGroupOperator() *ReportNodeGroupOperator

type ReportNodeOperator

type ReportNodeOperator struct {
	Id        interface{} // ID
	UniqueId  interface{} // 唯一ID
	Secret    interface{} // 密钥
	IsOn      interface{} // 是否启用
	Name      interface{} // 名称
	Location  interface{} // 所在区域
	Isp       interface{} // 网络服务商
	AllowIPs  interface{} // 允许的IP
	IsActive  interface{} // 是否活跃
	Status    interface{} // 状态
	State     interface{} // 状态
	CreatedAt interface{} // 创建时间
	GroupIds  interface{} // 分组ID
}

func NewReportNodeOperator

func NewReportNodeOperator() *ReportNodeOperator

type ReportResult

type ReportResult struct {
	Id           uint64  `field:"id"`           // ID
	Type         string  `field:"type"`         // 对象类型
	TargetId     uint64  `field:"targetId"`     // 对象ID
	TargetDesc   string  `field:"targetDesc"`   // 对象描述
	UpdatedAt    uint64  `field:"updatedAt"`    // 更新时间
	ReportNodeId uint32  `field:"reportNodeId"` // 监控节点ID
	IsOk         bool    `field:"isOk"`         // 是否可连接
	Level        string  `field:"level"`        // 级别
	CostMs       float64 `field:"costMs"`       // 单次连接花费的时间
	Error        string  `field:"error"`        // 产生的错误信息
	CountUp      uint32  `field:"countUp"`      // 连续上线次数
	CountDown    uint32  `field:"countDown"`    // 连续下线次数
}

ReportResult 连通性监控结果

type ReportResultDAO

type ReportResultDAO dbs.DAO
var SharedReportResultDAO *ReportResultDAO

func NewReportResultDAO

func NewReportResultDAO() *ReportResultDAO

func (*ReportResultDAO) CountAllResults

func (this *ReportResultDAO) CountAllResults(tx *dbs.Tx, reportNodeId int64, level reporterconfigs.ReportLevel, okState configutils.BoolState) (int64, error)

CountAllResults 计算结果数量

func (*ReportResultDAO) FindAllResults

func (this *ReportResultDAO) FindAllResults(tx *dbs.Tx, taskType string, targetId int64) (result []*ReportResult, err error)

FindAllResults 列出所有结果

func (*ReportResultDAO) FindAvgCostMsWithTarget

func (this *ReportResultDAO) FindAvgCostMsWithTarget(tx *dbs.Tx, taskType reporterconfigs.TaskType, targetId int64) (float64, error)

FindAvgCostMsWithTarget 获取某个对象的平均耗时

func (*ReportResultDAO) FindAvgLevelWithTarget

func (this *ReportResultDAO) FindAvgLevelWithTarget(tx *dbs.Tx, taskType reporterconfigs.TaskType, targetId int64) (string, error)

FindAvgLevelWithTarget 获取某个对象的平均级别

func (*ReportResultDAO) FindConnectivityWithTargetPercent

func (this *ReportResultDAO) FindConnectivityWithTargetPercent(tx *dbs.Tx, taskType reporterconfigs.TaskType, targetId int64, groupId int64) (float64, error)

FindConnectivityWithTargetPercent 获取某个对象的连通率 返回值在0-100

func (*ReportResultDAO) ListResults

func (this *ReportResultDAO) ListResults(tx *dbs.Tx, reportNodeId int64, okState configutils.BoolState, level reporterconfigs.ReportLevel, offset int64, size int64) (result []*ReportResult, err error)

ListResults 列出单页结果

func (*ReportResultDAO) UpdateResult

func (this *ReportResultDAO) UpdateResult(tx *dbs.Tx, taskType string, targetId int64, targetDesc string, reportNodeId int64, level reporterconfigs.ReportLevel, isOk bool, costMs float64, errString string) error

UpdateResult 创建结果

type ReportResultOperator

type ReportResultOperator struct {
	Id           interface{} // ID
	Type         interface{} // 对象类型
	TargetId     interface{} // 对象ID
	TargetDesc   interface{} // 对象描述
	UpdatedAt    interface{} // 更新时间
	ReportNodeId interface{} // 监控节点ID
	IsOk         interface{} // 是否可连接
	Level        interface{} // 级别
	CostMs       interface{} // 单次连接花费的时间
	Error        interface{} // 产生的错误信息
	CountUp      interface{} // 连续上线次数
	CountDown    interface{} // 连续下线次数
}

func NewReportResultOperator

func NewReportResultOperator() *ReportResultOperator

type ReverseProxy

type ReverseProxy struct {
	Id                       uint32   `field:"id"`                       // ID
	AdminId                  uint32   `field:"adminId"`                  // 管理员ID
	UserId                   uint32   `field:"userId"`                   // 用户ID
	TemplateId               uint32   `field:"templateId"`               // 模版ID
	IsOn                     bool     `field:"isOn"`                     // 是否启用
	Scheduling               dbs.JSON `field:"scheduling"`               // 调度算法
	PrimaryOrigins           dbs.JSON `field:"primaryOrigins"`           // 主要源站
	BackupOrigins            dbs.JSON `field:"backupOrigins"`            // 备用源站
	StripPrefix              string   `field:"stripPrefix"`              // 去除URL前缀
	RequestHostType          uint8    `field:"requestHostType"`          // 请求Host类型
	RequestHost              string   `field:"requestHost"`              // 请求Host
	RequestHostExcludingPort bool     `field:"requestHostExcludingPort"` // 移除请求Host中的域名
	RequestURI               string   `field:"requestURI"`               // 请求URI
	AutoFlush                uint8    `field:"autoFlush"`                // 是否自动刷新缓冲区
	AddHeaders               dbs.JSON `field:"addHeaders"`               // 自动添加的Header列表
	State                    uint8    `field:"state"`                    // 状态
	CreatedAt                uint64   `field:"createdAt"`                // 创建时间
	ConnTimeout              dbs.JSON `field:"connTimeout"`              // 连接超时时间
	ReadTimeout              dbs.JSON `field:"readTimeout"`              // 读取超时时间
	IdleTimeout              dbs.JSON `field:"idleTimeout"`              // 空闲超时时间
	MaxConns                 uint32   `field:"maxConns"`                 // 最大并发连接数
	MaxIdleConns             uint32   `field:"maxIdleConns"`             // 最大空闲连接数
	ProxyProtocol            dbs.JSON `field:"proxyProtocol"`            // Proxy Protocol配置
	FollowRedirects          uint8    `field:"followRedirects"`          // 回源跟随
}

ReverseProxy 反向代理配置

type ReverseProxyDAO

type ReverseProxyDAO dbs.DAO
var SharedReverseProxyDAO *ReverseProxyDAO

func NewReverseProxyDAO

func NewReverseProxyDAO() *ReverseProxyDAO

func (*ReverseProxyDAO) CheckUserReverseProxy

func (this *ReverseProxyDAO) CheckUserReverseProxy(tx *dbs.Tx, userId int64, reverseProxyId int64) error

CheckUserReverseProxy 检查用户权限

func (*ReverseProxyDAO) ComposeReverseProxyConfig

func (this *ReverseProxyDAO) ComposeReverseProxyConfig(tx *dbs.Tx, reverseProxyId int64, cacheMap *utils.CacheMap) (*serverconfigs.ReverseProxyConfig, error)

ComposeReverseProxyConfig 根据ID组合配置

func (*ReverseProxyDAO) CreateReverseProxy

func (this *ReverseProxyDAO) CreateReverseProxy(tx *dbs.Tx, adminId int64, userId int64, schedulingJSON []byte, primaryOriginsJSON []byte, backupOriginsJSON []byte) (int64, error)

CreateReverseProxy 创建反向代理

func (*ReverseProxyDAO) DisableReverseProxy

func (this *ReverseProxyDAO) DisableReverseProxy(tx *dbs.Tx, id int64) error

DisableReverseProxy 禁用条目

func (*ReverseProxyDAO) EnableReverseProxy

func (this *ReverseProxyDAO) EnableReverseProxy(tx *dbs.Tx, id int64) error

EnableReverseProxy 启用条目

func (*ReverseProxyDAO) FindEnabledReverseProxy

func (this *ReverseProxyDAO) FindEnabledReverseProxy(tx *dbs.Tx, id int64) (*ReverseProxy, error)

FindEnabledReverseProxy 查找启用中的条目

func (*ReverseProxyDAO) FindReverseProxyContainsOriginId

func (this *ReverseProxyDAO) FindReverseProxyContainsOriginId(tx *dbs.Tx, originId int64) (int64, error)

FindReverseProxyContainsOriginId 查找包含某个源站的反向代理ID

func (*ReverseProxyDAO) Init

func (this *ReverseProxyDAO) Init()

Init 初始化

func (*ReverseProxyDAO) NotifyUpdate

func (this *ReverseProxyDAO) NotifyUpdate(tx *dbs.Tx, reverseProxyId int64) error

NotifyUpdate 通知更新

func (*ReverseProxyDAO) UpdateReverseProxy

func (this *ReverseProxyDAO) UpdateReverseProxy(tx *dbs.Tx,
	reverseProxyId int64,
	requestHostType int8,
	requestHost string,
	requestHostExcludingPort bool,
	requestURI string,
	stripPrefix string,
	autoFlush bool,
	addHeaders []string,
	connTimeout *shared.TimeDuration,
	readTimeout *shared.TimeDuration,
	idleTimeout *shared.TimeDuration,
	maxConns int32,
	maxIdleConns int32,
	proxyProtocolJSON []byte,
	followRedirects bool) error

UpdateReverseProxy 修改是否启用

func (*ReverseProxyDAO) UpdateReverseProxyBackupOrigins

func (this *ReverseProxyDAO) UpdateReverseProxyBackupOrigins(tx *dbs.Tx, reverseProxyId int64, origins []byte) error

UpdateReverseProxyBackupOrigins 修改备用源站

func (*ReverseProxyDAO) UpdateReverseProxyPrimaryOrigins

func (this *ReverseProxyDAO) UpdateReverseProxyPrimaryOrigins(tx *dbs.Tx, reverseProxyId int64, origins []byte) error

UpdateReverseProxyPrimaryOrigins 修改主要源站

func (*ReverseProxyDAO) UpdateReverseProxyScheduling

func (this *ReverseProxyDAO) UpdateReverseProxyScheduling(tx *dbs.Tx, reverseProxyId int64, schedulingJSON []byte) error

UpdateReverseProxyScheduling 修改反向代理调度算法

type ReverseProxyOperator

type ReverseProxyOperator struct {
	Id                       interface{} // ID
	AdminId                  interface{} // 管理员ID
	UserId                   interface{} // 用户ID
	TemplateId               interface{} // 模版ID
	IsOn                     interface{} // 是否启用
	Scheduling               interface{} // 调度算法
	PrimaryOrigins           interface{} // 主要源站
	BackupOrigins            interface{} // 备用源站
	StripPrefix              interface{} // 去除URL前缀
	RequestHostType          interface{} // 请求Host类型
	RequestHost              interface{} // 请求Host
	RequestHostExcludingPort interface{} // 移除请求Host中的域名
	RequestURI               interface{} // 请求URI
	AutoFlush                interface{} // 是否自动刷新缓冲区
	AddHeaders               interface{} // 自动添加的Header列表
	State                    interface{} // 状态
	CreatedAt                interface{} // 创建时间
	ConnTimeout              interface{} // 连接超时时间
	ReadTimeout              interface{} // 读取超时时间
	IdleTimeout              interface{} // 空闲超时时间
	MaxConns                 interface{} // 最大并发连接数
	MaxIdleConns             interface{} // 最大空闲连接数
	ProxyProtocol            interface{} // Proxy Protocol配置
	FollowRedirects          interface{} // 回源跟随
}

func NewReverseProxyOperator

func NewReverseProxyOperator() *ReverseProxyOperator

type SSLCert

type SSLCert struct {
	Id                 uint32   `field:"id"`                 // ID
	AdminId            uint32   `field:"adminId"`            // 管理员ID
	UserId             uint32   `field:"userId"`             // 用户ID
	State              uint8    `field:"state"`              // 状态
	CreatedAt          uint64   `field:"createdAt"`          // 创建时间
	UpdatedAt          uint64   `field:"updatedAt"`          // 修改时间
	IsOn               bool     `field:"isOn"`               // 是否启用
	Name               string   `field:"name"`               // 证书名
	Description        string   `field:"description"`        // 描述
	CertData           []byte   `field:"certData"`           // 证书内容
	KeyData            []byte   `field:"keyData"`            // 密钥内容
	ServerName         string   `field:"serverName"`         // 证书使用的主机名
	IsCA               bool     `field:"isCA"`               // 是否为CA证书
	GroupIds           dbs.JSON `field:"groupIds"`           // 证书分组
	TimeBeginAt        uint64   `field:"timeBeginAt"`        // 开始时间
	TimeEndAt          uint64   `field:"timeEndAt"`          // 结束时间
	DnsNames           dbs.JSON `field:"dnsNames"`           // DNS名称列表
	CommonNames        dbs.JSON `field:"commonNames"`        // 发行单位列表
	IsACME             bool     `field:"isACME"`             // 是否为ACME自动生成的
	AcmeTaskId         uint64   `field:"acmeTaskId"`         // ACME任务ID
	NotifiedAt         uint64   `field:"notifiedAt"`         // 最后通知时间
	Ocsp               []byte   `field:"ocsp"`               // OCSP缓存
	OcspIsUpdated      uint8    `field:"ocspIsUpdated"`      // OCSP是否已更新
	OcspUpdatedAt      uint64   `field:"ocspUpdatedAt"`      // OCSP更新时间
	OcspError          string   `field:"ocspError"`          // OCSP更新错误
	OcspUpdatedVersion uint64   `field:"ocspUpdatedVersion"` // OCSP更新版本
	OcspExpiresAt      uint64   `field:"ocspExpiresAt"`      // OCSP过期时间(UTC)
	OcspTries          uint32   `field:"ocspTries"`          // OCSP尝试次数
}

SSLCert SSL证书

func (*SSLCert) DecodeCommonNames

func (this *SSLCert) DecodeCommonNames() []string

func (*SSLCert) DecodeDNSNames

func (this *SSLCert) DecodeDNSNames() []string

type SSLCertDAO

type SSLCertDAO dbs.DAO
var SharedSSLCertDAO *SSLCertDAO

func NewSSLCertDAO

func NewSSLCertDAO() *SSLCertDAO

func (*SSLCertDAO) CheckUserCert

func (this *SSLCertDAO) CheckUserCert(tx *dbs.Tx, certId int64, userId int64) error

CheckUserCert 检查用户权限

func (*SSLCertDAO) ComposeCertConfig

func (this *SSLCertDAO) ComposeCertConfig(tx *dbs.Tx, certId int64, cacheMap *utils.CacheMap) (*sslconfigs.SSLCertConfig, error)

ComposeCertConfig 组合配置

func (*SSLCertDAO) CountAllSSLCertsWithOCSPError

func (this *SSLCertDAO) CountAllSSLCertsWithOCSPError(tx *dbs.Tx, keyword string) (int64, error)

CountAllSSLCertsWithOCSPError 计算有OCSP错误的证书数量

func (*SSLCertDAO) CountCerts

func (this *SSLCertDAO) CountCerts(tx *dbs.Tx, isCA bool, isAvailable bool, isExpired bool, expiringDays int64, keyword string, userId int64) (int64, error)

CountCerts 计算符合条件的证书数量

func (*SSLCertDAO) CreateCert

func (this *SSLCertDAO) CreateCert(tx *dbs.Tx, adminId int64, userId int64, isOn bool, name string, description string, serverName string, isCA bool, certData []byte, keyData []byte, timeBeginAt int64, timeEndAt int64, dnsNames []string, commonNames []string) (int64, error)

CreateCert 创建证书

func (*SSLCertDAO) DisableSSLCert

func (this *SSLCertDAO) DisableSSLCert(tx *dbs.Tx, certId int64) error

DisableSSLCert 禁用条目

func (*SSLCertDAO) EnableSSLCert

func (this *SSLCertDAO) EnableSSLCert(tx *dbs.Tx, id int64) error

EnableSSLCert 启用条目

func (*SSLCertDAO) FindAllExpiringCerts

func (this *SSLCertDAO) FindAllExpiringCerts(tx *dbs.Tx, days int) (result []*SSLCert, err error)

FindAllExpiringCerts 查找需要自动更新的任务 这里我们只返回有限的字段以节省内存

func (*SSLCertDAO) FindCertOCSPLatestVersion

func (this *SSLCertDAO) FindCertOCSPLatestVersion(tx *dbs.Tx) (int64, error)

FindCertOCSPLatestVersion 获取OCSP最新版本

func (*SSLCertDAO) FindEnabledSSLCert

func (this *SSLCertDAO) FindEnabledSSLCert(tx *dbs.Tx, id int64) (*SSLCert, error)

FindEnabledSSLCert 查找启用中的条目

func (*SSLCertDAO) FindSSLCertName

func (this *SSLCertDAO) FindSSLCertName(tx *dbs.Tx, id int64) (string, error)

FindSSLCertName 根据主键查找名称

func (*SSLCertDAO) IgnoreSSLCertsWithOCSPError

func (this *SSLCertDAO) IgnoreSSLCertsWithOCSPError(tx *dbs.Tx, certIds []int64) error

IgnoreSSLCertsWithOCSPError 忽略一组OCSP证书错误

func (*SSLCertDAO) Init

func (this *SSLCertDAO) Init()

Init 初始化

func (*SSLCertDAO) ListCertIds

func (this *SSLCertDAO) ListCertIds(tx *dbs.Tx, isCA bool, isAvailable bool, isExpired bool, expiringDays int64, keyword string, userId int64, offset int64, size int64) (certIds []int64, err error)

ListCertIds 列出符合条件的证书

func (*SSLCertDAO) ListCertOCSPAfterVersion

func (this *SSLCertDAO) ListCertOCSPAfterVersion(tx *dbs.Tx, version int64, size int64) (result []*SSLCert, err error)

ListCertOCSPAfterVersion 列出某个版本后的OCSP

func (*SSLCertDAO) ListCertsToUpdateOCSP

func (this *SSLCertDAO) ListCertsToUpdateOCSP(tx *dbs.Tx, maxTries int, size int64) (result []*SSLCert, err error)

ListCertsToUpdateOCSP 查找需要更新OCSP的证书

func (*SSLCertDAO) ListSSLCertsWithOCSPError

func (this *SSLCertDAO) ListSSLCertsWithOCSPError(tx *dbs.Tx, keyword string, offset int64, size int64) (result []*SSLCert, err error)

ListSSLCertsWithOCSPError 列出有OCSP错误的证书

func (*SSLCertDAO) NotifyUpdate

func (this *SSLCertDAO) NotifyUpdate(tx *dbs.Tx, certId int64) error

NotifyUpdate 通知更新

func (*SSLCertDAO) PrepareCertOCSPUpdating

func (this *SSLCertDAO) PrepareCertOCSPUpdating(tx *dbs.Tx, certId int64) error

PrepareCertOCSPUpdating 更新OCSP更新时间,以便于准备更新,相当于锁定

func (*SSLCertDAO) ResetAllSSLCertsWithOCSPError

func (this *SSLCertDAO) ResetAllSSLCertsWithOCSPError(tx *dbs.Tx) error

ResetAllSSLCertsWithOCSPError 重置所有证书OCSP错误状态

func (*SSLCertDAO) ResetSSLCertsWithOCSPError

func (this *SSLCertDAO) ResetSSLCertsWithOCSPError(tx *dbs.Tx, certIds []int64) error

ResetSSLCertsWithOCSPError 重置一组证书OCSP错误状态

func (*SSLCertDAO) UpdateCert

func (this *SSLCertDAO) UpdateCert(tx *dbs.Tx,
	certId int64,
	isOn bool,
	name string,
	description string,
	serverName string,
	isCA bool,
	certData []byte,
	keyData []byte,
	timeBeginAt int64,
	timeEndAt int64,
	dnsNames []string, commonNames []string) error

UpdateCert 修改证书

func (*SSLCertDAO) UpdateCertACME

func (this *SSLCertDAO) UpdateCertACME(tx *dbs.Tx, certId int64, acmeTaskId int64) error

UpdateCertACME 设置证书的ACME信息

func (*SSLCertDAO) UpdateCertNotifiedAt

func (this *SSLCertDAO) UpdateCertNotifiedAt(tx *dbs.Tx, certId int64) error

UpdateCertNotifiedAt 设置当前证书事件通知时间

func (*SSLCertDAO) UpdateCertOCSP

func (this *SSLCertDAO) UpdateCertOCSP(tx *dbs.Tx, certId int64, ocsp []byte, expiresAt int64, hasErr bool, errString string) error

UpdateCertOCSP 修改OCSP

type SSLCertGroup

type SSLCertGroup struct {
	Id        uint32 `field:"id"`        // ID
	AdminId   uint32 `field:"adminId"`   // 管理员ID
	UserId    uint32 `field:"userId"`    // 用户ID
	Name      string `field:"name"`      // 分组名
	Order     uint32 `field:"order"`     // 分组排序
	State     uint8  `field:"state"`     // 状态
	CreatedAt uint64 `field:"createdAt"` // 创建时间
}

type SSLCertGroupDAO

type SSLCertGroupDAO dbs.DAO
var SharedSSLCertGroupDAO *SSLCertGroupDAO

func NewSSLCertGroupDAO

func NewSSLCertGroupDAO() *SSLCertGroupDAO

func (*SSLCertGroupDAO) DisableSSLCertGroup

func (this *SSLCertGroupDAO) DisableSSLCertGroup(tx *dbs.Tx, id uint32) error

禁用条目

func (*SSLCertGroupDAO) EnableSSLCertGroup

func (this *SSLCertGroupDAO) EnableSSLCertGroup(tx *dbs.Tx, id uint32) error

启用条目

func (*SSLCertGroupDAO) FindEnabledSSLCertGroup

func (this *SSLCertGroupDAO) FindEnabledSSLCertGroup(tx *dbs.Tx, id uint32) (*SSLCertGroup, error)

查找启用中的条目

func (*SSLCertGroupDAO) FindSSLCertGroupName

func (this *SSLCertGroupDAO) FindSSLCertGroupName(tx *dbs.Tx, id uint32) (string, error)

根据主键查找名称

type SSLCertGroupOperator

type SSLCertGroupOperator struct {
	Id        interface{} // ID
	AdminId   interface{} // 管理员ID
	UserId    interface{} // 用户ID
	Name      interface{} // 分组名
	Order     interface{} // 分组排序
	State     interface{} // 状态
	CreatedAt interface{} // 创建时间
}

func NewSSLCertGroupOperator

func NewSSLCertGroupOperator() *SSLCertGroupOperator

type SSLCertOperator

type SSLCertOperator struct {
	Id                 interface{} // ID
	AdminId            interface{} // 管理员ID
	UserId             interface{} // 用户ID
	State              interface{} // 状态
	CreatedAt          interface{} // 创建时间
	UpdatedAt          interface{} // 修改时间
	IsOn               interface{} // 是否启用
	Name               interface{} // 证书名
	Description        interface{} // 描述
	CertData           interface{} // 证书内容
	KeyData            interface{} // 密钥内容
	ServerName         interface{} // 证书使用的主机名
	IsCA               interface{} // 是否为CA证书
	GroupIds           interface{} // 证书分组
	TimeBeginAt        interface{} // 开始时间
	TimeEndAt          interface{} // 结束时间
	DnsNames           interface{} // DNS名称列表
	CommonNames        interface{} // 发行单位列表
	IsACME             interface{} // 是否为ACME自动生成的
	AcmeTaskId         interface{} // ACME任务ID
	NotifiedAt         interface{} // 最后通知时间
	Ocsp               interface{} // OCSP缓存
	OcspIsUpdated      interface{} // OCSP是否已更新
	OcspUpdatedAt      interface{} // OCSP更新时间
	OcspError          interface{} // OCSP更新错误
	OcspUpdatedVersion interface{} // OCSP更新版本
	OcspExpiresAt      interface{} // OCSP过期时间(UTC)
	OcspTries          interface{} // OCSP尝试次数
}

func NewSSLCertOperator

func NewSSLCertOperator() *SSLCertOperator

type SSLPolicy

type SSLPolicy struct {
	Id               uint32   `field:"id"`               // ID
	AdminId          uint32   `field:"adminId"`          // 管理员ID
	UserId           uint32   `field:"userId"`           // 用户ID
	IsOn             bool     `field:"isOn"`             // 是否启用
	Certs            dbs.JSON `field:"certs"`            // 证书列表
	ClientCACerts    dbs.JSON `field:"clientCACerts"`    // 客户端证书
	ClientAuthType   uint32   `field:"clientAuthType"`   // 客户端认证类型
	MinVersion       string   `field:"minVersion"`       // 支持的SSL最小版本
	CipherSuitesIsOn uint8    `field:"cipherSuitesIsOn"` // 是否自定义加密算法套件
	CipherSuites     dbs.JSON `field:"cipherSuites"`     // 加密算法套件
	Hsts             dbs.JSON `field:"hsts"`             // HSTS设置
	Http2Enabled     uint8    `field:"http2Enabled"`     // 是否启用HTTP/2
	OcspIsOn         uint8    `field:"ocspIsOn"`         // 是否启用OCSP
	State            uint8    `field:"state"`            // 状态
	CreatedAt        uint64   `field:"createdAt"`        // 创建时间
}

SSLPolicy SSL配置策略

type SSLPolicyDAO

type SSLPolicyDAO dbs.DAO
var SharedSSLPolicyDAO *SSLPolicyDAO

func NewSSLPolicyDAO

func NewSSLPolicyDAO() *SSLPolicyDAO

func (*SSLPolicyDAO) CheckUserPolicy

func (this *SSLPolicyDAO) CheckUserPolicy(tx *dbs.Tx, userId int64, policyId int64) error

CheckUserPolicy 检查是否为用户所属策略

func (*SSLPolicyDAO) ComposePolicyConfig

func (this *SSLPolicyDAO) ComposePolicyConfig(tx *dbs.Tx, policyId int64, cacheMap *utils.CacheMap) (*sslconfigs.SSLPolicy, error)

ComposePolicyConfig 组合配置

func (*SSLPolicyDAO) CreatePolicy

func (this *SSLPolicyDAO) CreatePolicy(tx *dbs.Tx, adminId int64, userId int64, http2Enabled bool, minVersion string, certsJSON []byte, hstsJSON []byte, ocspIsOn bool, clientAuthType int32, clientCACertsJSON []byte, cipherSuitesIsOn bool, cipherSuites []string) (int64, error)

CreatePolicy 创建Policy

func (*SSLPolicyDAO) DisableSSLPolicy

func (this *SSLPolicyDAO) DisableSSLPolicy(tx *dbs.Tx, policyId int64) error

DisableSSLPolicy 禁用条目

func (*SSLPolicyDAO) EnableSSLPolicy

func (this *SSLPolicyDAO) EnableSSLPolicy(tx *dbs.Tx, id int64) error

EnableSSLPolicy 启用条目

func (*SSLPolicyDAO) FindAllEnabledPolicyIdsWithCertId

func (this *SSLPolicyDAO) FindAllEnabledPolicyIdsWithCertId(tx *dbs.Tx, certId int64) (policyIds []int64, err error)

FindAllEnabledPolicyIdsWithCertId 查询使用单个证书的所有策略ID

func (*SSLPolicyDAO) FindEnabledSSLPolicy

func (this *SSLPolicyDAO) FindEnabledSSLPolicy(tx *dbs.Tx, id int64) (*SSLPolicy, error)

FindEnabledSSLPolicy 查找启用中的条目

func (*SSLPolicyDAO) Init

func (this *SSLPolicyDAO) Init()

Init 初始化

func (*SSLPolicyDAO) NotifyUpdate

func (this *SSLPolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error

NotifyUpdate 通知更新

func (*SSLPolicyDAO) UpdatePolicy

func (this *SSLPolicyDAO) UpdatePolicy(tx *dbs.Tx, policyId int64, http2Enabled bool, minVersion string, certsJSON []byte, hstsJSON []byte, ocspIsOn bool, clientAuthType int32, clientCACertsJSON []byte, cipherSuitesIsOn bool, cipherSuites []string) error

UpdatePolicy 修改Policy

type SSLPolicyOperator

type SSLPolicyOperator struct {
	Id               interface{} // ID
	AdminId          interface{} // 管理员ID
	UserId           interface{} // 用户ID
	IsOn             interface{} // 是否启用
	Certs            interface{} // 证书列表
	ClientCACerts    interface{} // 客户端证书
	ClientAuthType   interface{} // 客户端认证类型
	MinVersion       interface{} // 支持的SSL最小版本
	CipherSuitesIsOn interface{} // 是否自定义加密算法套件
	CipherSuites     interface{} // 加密算法套件
	Hsts             interface{} // HSTS设置
	Http2Enabled     interface{} // 是否启用HTTP/2
	OcspIsOn         interface{} // 是否启用OCSP
	State            interface{} // 状态
	CreatedAt        interface{} // 创建时间
}

func NewSSLPolicyOperator

func NewSSLPolicyOperator() *SSLPolicyOperator

type Script

type Script struct {
	Id        uint64 `field:"id"`        // ID
	UserId    uint64 `field:"userId"`    // 用户ID
	IsOn      bool   `field:"isOn"`      // 是否启用
	Name      string `field:"name"`      // 名称
	Filename  string `field:"filename"`  // 文件名
	Code      string `field:"code"`      // 代码
	CreatedAt uint64 `field:"createdAt"` // 创建时间
	UpdatedAt uint64 `field:"updatedAt"` // 修改时间
	State     uint8  `field:"state"`     // 是否启用
}

Script 脚本库

type ScriptHistory

type ScriptHistory struct {
	Id       uint32 `field:"id"`       // ID
	UserId   uint64 `field:"userId"`   // 用户ID
	ScriptId uint64 `field:"scriptId"` // 脚本ID
	Filename string `field:"filename"` // 文件名
	Code     string `field:"code"`     // 代码
	Version  uint64 `field:"version"`  // 版本号
}

ScriptHistory 脚本历史记录

type ScriptHistoryOperator

type ScriptHistoryOperator struct {
	Id       interface{} // ID
	UserId   interface{} // 用户ID
	ScriptId interface{} // 脚本ID
	Filename interface{} // 文件名
	Code     interface{} // 代码
	Version  interface{} // 版本号
}

func NewScriptHistoryOperator

func NewScriptHistoryOperator() *ScriptHistoryOperator

type ScriptOperator

type ScriptOperator struct {
	Id        interface{} // ID
	UserId    interface{} // 用户ID
	IsOn      interface{} // 是否启用
	Name      interface{} // 名称
	Filename  interface{} // 文件名
	Code      interface{} // 代码
	CreatedAt interface{} // 创建时间
	UpdatedAt interface{} // 修改时间
	State     interface{} // 是否启用
}

func NewScriptOperator

func NewScriptOperator() *ScriptOperator

type Server

type Server struct {
	Id                  uint32   `field:"id"`                  // ID
	IsOn                bool     `field:"isOn"`                // 是否启用
	UserId              uint32   `field:"userId"`              // 用户ID
	AdminId             uint32   `field:"adminId"`             // 管理员ID
	Type                string   `field:"type"`                // 服务类型
	Name                string   `field:"name"`                // 名称
	Description         string   `field:"description"`         // 描述
	PlainServerNames    dbs.JSON `field:"plainServerNames"`    // 扁平化域名列表
	ServerNames         dbs.JSON `field:"serverNames"`         // 域名列表
	AuditingAt          uint64   `field:"auditingAt"`          // 审核提交时间
	AuditingServerNames dbs.JSON `field:"auditingServerNames"` // 审核中的域名
	IsAuditing          bool     `field:"isAuditing"`          // 是否正在审核
	AuditingResult      dbs.JSON `field:"auditingResult"`      // 审核结果
	Http                dbs.JSON `field:"http"`                // HTTP配置
	Https               dbs.JSON `field:"https"`               // HTTPS配置
	Tcp                 dbs.JSON `field:"tcp"`                 // TCP配置
	Tls                 dbs.JSON `field:"tls"`                 // TLS配置
	Unix                dbs.JSON `field:"unix"`                // Unix配置
	Udp                 dbs.JSON `field:"udp"`                 // UDP配置
	WebId               uint32   `field:"webId"`               // WEB配置
	ReverseProxy        dbs.JSON `field:"reverseProxy"`        // 反向代理配置
	GroupIds            dbs.JSON `field:"groupIds"`            // 分组ID列表
	Config              dbs.JSON `field:"config"`              // 服务配置,自动生成
	ConfigMd5           string   `field:"configMd5"`           // Md5
	ClusterId           uint32   `field:"clusterId"`           // 集群ID
	IncludeNodes        dbs.JSON `field:"includeNodes"`        // 部署条件
	ExcludeNodes        dbs.JSON `field:"excludeNodes"`        // 节点排除条件
	Version             uint32   `field:"version"`             // 版本号
	CreatedAt           uint64   `field:"createdAt"`           // 创建时间
	State               uint8    `field:"state"`               // 状态
	DnsName             string   `field:"dnsName"`             // DNS名称
	TcpPorts            dbs.JSON `field:"tcpPorts"`            // 所包含TCP端口
	UdpPorts            dbs.JSON `field:"udpPorts"`            // 所包含UDP端口
	SupportCNAME        uint8    `field:"supportCNAME"`        // 允许CNAME不在域名名单
	TrafficLimit        dbs.JSON `field:"trafficLimit"`        // 流量限制
	TrafficDay          string   `field:"trafficDay"`          // YYYYMMDD
	TrafficMonth        string   `field:"trafficMonth"`        // YYYYMM
	TotalDailyTraffic   float64  `field:"totalDailyTraffic"`   // 日流量
	TotalMonthlyTraffic float64  `field:"totalMonthlyTraffic"` // 月流量
	TrafficLimitStatus  dbs.JSON `field:"trafficLimitStatus"`  // 流量限制状态
	TotalTraffic        float64  `field:"totalTraffic"`        // 总流量
	UserPlanId          uint32   `field:"userPlanId"`          // 所属套餐ID
	LastUserPlanId      uint32   `field:"lastUserPlanId"`      // 上一次使用的套餐
	Uam                 dbs.JSON `field:"uam"`                 // UAM设置
	BandwidthTime       string   `field:"bandwidthTime"`       // 带宽更新时间,YYYYMMDDHHII
	BandwidthBytes      uint64   `field:"bandwidthBytes"`      // 最近带宽峰值
}

Server 服务

func (*Server) DecodeGroupIds

func (this *Server) DecodeGroupIds() []int64

DecodeGroupIds 解析服务所属分组ID

func (*Server) DecodeHTTPPorts

func (this *Server) DecodeHTTPPorts() (ports []int)

DecodeHTTPPorts 获取HTTP所有端口

func (*Server) DecodeHTTPSPorts

func (this *Server) DecodeHTTPSPorts() (ports []int)

DecodeHTTPSPorts 获取HTTPS所有端口

func (*Server) DecodeTCPPorts

func (this *Server) DecodeTCPPorts() (ports []int)

DecodeTCPPorts 获取TCP所有端口

func (*Server) DecodeTLSPorts

func (this *Server) DecodeTLSPorts() (ports []int)

DecodeTLSPorts 获取TLS所有端口

func (*Server) DecodeUDPPorts

func (this *Server) DecodeUDPPorts() (ports []int)

DecodeUDPPorts 获取UDP所有端口

type ServerBandwidthStat added in v0.4.9

type ServerBandwidthStat struct {
	Id       uint64 `field:"id"`       // ID
	UserId   uint64 `field:"userId"`   // 用户ID
	ServerId uint64 `field:"serverId"` // 服务ID
	Day      string `field:"day"`      // 日期YYYYMMDD
	TimeAt   string `field:"timeAt"`   // 时间点HHMM
	Bytes    uint64 `field:"bytes"`    // 带宽字节
}

ServerBandwidthStat 服务峰值带宽统计

type ServerBandwidthStatDAO added in v0.4.9

type ServerBandwidthStatDAO dbs.DAO
var SharedServerBandwidthStatDAO *ServerBandwidthStatDAO

func NewServerBandwidthStatDAO added in v0.4.9

func NewServerBandwidthStatDAO() *ServerBandwidthStatDAO

func (*ServerBandwidthStatDAO) Clean added in v0.4.9

func (this *ServerBandwidthStatDAO) Clean(tx *dbs.Tx) error

Clean 清理过期数据

func (*ServerBandwidthStatDAO) FindAllServerStatsWithDay added in v0.5.0

func (this *ServerBandwidthStatDAO) FindAllServerStatsWithDay(tx *dbs.Tx, serverId int64, day string) (result []*ServerBandwidthStat, err error)

FindAllServerStatsWithDay 查找某个服务的当天的所有带宽峰值 day YYYYMMDD

func (*ServerBandwidthStatDAO) FindAllServerStatsWithMonth added in v0.5.0

func (this *ServerBandwidthStatDAO) FindAllServerStatsWithMonth(tx *dbs.Tx, serverId int64, month string) (result []*ServerBandwidthStat, err error)

FindAllServerStatsWithMonth 查找某个服务的当月的所有带宽峰值 month YYYYMM

func (*ServerBandwidthStatDAO) FindDailyBandwidthStats added in v0.5.2

func (this *ServerBandwidthStatDAO) FindDailyBandwidthStats(tx *dbs.Tx, serverId int64, days int32) (result []*pb.FindDailyServerBandwidthStatsResponse_Stat, err error)

FindDailyBandwidthStats 按天获取带宽峰值

func (*ServerBandwidthStatDAO) FindDailyPeekBandwidthBytes added in v0.4.9

func (this *ServerBandwidthStatDAO) FindDailyPeekBandwidthBytes(tx *dbs.Tx, serverId int64, day string) (int64, error)

FindDailyPeekBandwidthBytes 获取某天的带宽峰值 day YYYYMMDD

func (*ServerBandwidthStatDAO) FindHourlyBandwidthStats added in v0.5.2

func (this *ServerBandwidthStatDAO) FindHourlyBandwidthStats(tx *dbs.Tx, serverId int64, hours int32) (result []*pb.FindHourlyServerBandwidthStatsResponse_Stat, err error)

FindHourlyBandwidthStats 按小时获取带宽峰值

func (*ServerBandwidthStatDAO) FindMinutelyPeekBandwidthBytes added in v0.4.9

func (this *ServerBandwidthStatDAO) FindMinutelyPeekBandwidthBytes(tx *dbs.Tx, serverId int64, day string, minute string) (int64, error)

FindMinutelyPeekBandwidthBytes 获取某分钟的带宽峰值 day YYYYMMDD minute HHII

func (*ServerBandwidthStatDAO) FindMonthlyPeekBandwidthBytes added in v0.4.9

func (this *ServerBandwidthStatDAO) FindMonthlyPeekBandwidthBytes(tx *dbs.Tx, serverId int64, month string) (int64, error)

FindMonthlyPeekBandwidthBytes 获取某月的带宽峰值 month YYYYMM

func (*ServerBandwidthStatDAO) FindMonthlyPercentile added in v0.4.9

func (this *ServerBandwidthStatDAO) FindMonthlyPercentile(tx *dbs.Tx, serverId int64, month string, percentile int) (result int64, err error)

FindMonthlyPercentile 获取某月内百分位

func (*ServerBandwidthStatDAO) FindServerStats added in v0.4.9

func (this *ServerBandwidthStatDAO) FindServerStats(tx *dbs.Tx, serverId int64, day string, timeFrom string, timeTo string) (result []*ServerBandwidthStat, err error)

FindServerStats 查找某个时间段的带宽统计 参数:

  • day YYYYMMDD
  • timeAt HHII

func (*ServerBandwidthStatDAO) UpdateServerBandwidth added in v0.4.9

func (this *ServerBandwidthStatDAO) UpdateServerBandwidth(tx *dbs.Tx, userId int64, serverId int64, day string, timeAt string, bytes int64) error

UpdateServerBandwidth 写入数据

type ServerBandwidthStatOperator added in v0.4.9

type ServerBandwidthStatOperator struct {
	Id       interface{} // ID
	UserId   interface{} // 用户ID
	ServerId interface{} // 服务ID
	Day      interface{} // 日期YYYYMMDD
	TimeAt   interface{} // 时间点HHMM
	Bytes    interface{} // 带宽字节
}

func NewServerBandwidthStatOperator added in v0.4.9

func NewServerBandwidthStatOperator() *ServerBandwidthStatOperator

type ServerBill

type ServerBill struct {
	Id                       uint64  `field:"id"`                       // ID
	UserId                   uint32  `field:"userId"`                   // 用户ID
	ServerId                 uint32  `field:"serverId"`                 // 服务ID
	Amount                   float64 `field:"amount"`                   // 金额
	Month                    string  `field:"month"`                    // 月份
	CreatedAt                uint64  `field:"createdAt"`                // 创建时间
	UserPlanId               uint32  `field:"userPlanId"`               // 用户套餐ID
	PlanId                   uint32  `field:"planId"`                   // 套餐ID
	TotalTrafficBytes        uint64  `field:"totalTrafficBytes"`        // 总流量
	BandwidthPercentileBytes uint64  `field:"bandwidthPercentileBytes"` // 带宽百分位字节
	BandwidthPercentile      uint8   `field:"bandwidthPercentile"`      // 带宽百分位
	PriceType                string  `field:"priceType"`                // 计费类型
}

ServerBill 服务账单

type ServerBillDAO

type ServerBillDAO dbs.DAO
var SharedServerBillDAO *ServerBillDAO

func NewServerBillDAO

func NewServerBillDAO() *ServerBillDAO

func (*ServerBillDAO) CountServerBills

func (this *ServerBillDAO) CountServerBills(tx *dbs.Tx, userId int64, month string) (int64, error)

CountServerBills 计算总账单数量

func (*ServerBillDAO) CreateOrUpdateServerBill

func (this *ServerBillDAO) CreateOrUpdateServerBill(tx *dbs.Tx,
	userId int64,
	serverId int64,
	month string,
	userPlanId int64,
	planId int64,
	totalTrafficBytes int64,
	bandwidthPercentileBytes int64,
	bandwidthPercentile int,
	priceType string,
	fee float64) error

CreateOrUpdateServerBill 创建账单

func (*ServerBillDAO) ListServerBills

func (this *ServerBillDAO) ListServerBills(tx *dbs.Tx, userId int64, month string, offset int64, size int64) (result []*ServerBill, err error)

ListServerBills 列出单页账单

func (*ServerBillDAO) SumUserMonthlyAmount

func (this *ServerBillDAO) SumUserMonthlyAmount(tx *dbs.Tx, userId int64, month string) (float64, error)

SumUserMonthlyAmount 计算总费用

type ServerBillOperator

type ServerBillOperator struct {
	Id                       interface{} // ID
	UserId                   interface{} // 用户ID
	ServerId                 interface{} // 服务ID
	Amount                   interface{} // 金额
	Month                    interface{} // 月份
	CreatedAt                interface{} // 创建时间
	UserPlanId               interface{} // 用户套餐ID
	PlanId                   interface{} // 套餐ID
	TotalTrafficBytes        interface{} // 总流量
	BandwidthPercentileBytes interface{} // 带宽百分位字节
	BandwidthPercentile      interface{} // 带宽百分位
	PriceType                interface{} // 计费类型
}

func NewServerBillOperator

func NewServerBillOperator() *ServerBillOperator

type ServerDAO

type ServerDAO dbs.DAO
var SharedServerDAO *ServerDAO

func NewServerDAO

func NewServerDAO() *ServerDAO

func (*ServerDAO) CalculateServerTrafficLimitConfig

func (this *ServerDAO) CalculateServerTrafficLimitConfig(tx *dbs.Tx, serverId int64, cacheMap *utils.CacheMap) (*serverconfigs.TrafficLimitConfig, error)

CalculateServerTrafficLimitConfig 计算服务的流量限制 TODO 优化性能

func (*ServerDAO) CheckPortIsUsing

func (this *ServerDAO) CheckPortIsUsing(tx *dbs.Tx, clusterId int64, protocolFamily string, port int, excludeServerId int64, excludeProtocol string) (bool, error)

CheckPortIsUsing 检查端口是否被使用 protocolFamily支持tcp和udp

func (*ServerDAO) CheckUserServer

func (this *ServerDAO) CheckUserServer(tx *dbs.Tx, userId int64, serverId int64) error

CheckUserServer 检查用户服务

func (*ServerDAO) ComposeServerConfig

func (this *ServerDAO) ComposeServerConfig(tx *dbs.Tx, server *Server, cacheMap *utils.CacheMap, forNode bool, forList bool) (*serverconfigs.ServerConfig, error)

ComposeServerConfig 构造服务的Config forNode 是否是节点请求

func (*ServerDAO) ComposeServerConfigWithServerId

func (this *ServerDAO) ComposeServerConfigWithServerId(tx *dbs.Tx, serverId int64, forNode bool) (*serverconfigs.ServerConfig, error)

ComposeServerConfigWithServerId 构造服务的Config

func (*ServerDAO) CountAllEnabledServers

func (this *ServerDAO) CountAllEnabledServers(tx *dbs.Tx) (int64, error)

CountAllEnabledServers 计算所有可用服务数量

func (*ServerDAO) CountAllEnabledServersMatch

func (this *ServerDAO) CountAllEnabledServersMatch(tx *dbs.Tx, groupId int64, keyword string, userId int64, clusterId int64, auditingFlag configutils.BoolState, protocolFamilies []string) (int64, error)

CountAllEnabledServersMatch 计算所有可用服务数量 参数:

groupId 分组ID,如果为-1,则搜索没有分组的服务

func (*ServerDAO) CountAllEnabledServersWithGroupId

func (this *ServerDAO) CountAllEnabledServersWithGroupId(tx *dbs.Tx, groupId int64, userId int64) (int64, error)

CountAllEnabledServersWithGroupId 计算使用某个分组的服务数量

func (*ServerDAO) CountAllEnabledServersWithNodeClusterId

func (this *ServerDAO) CountAllEnabledServersWithNodeClusterId(tx *dbs.Tx, clusterId int64) (int64, error)

CountAllEnabledServersWithNodeClusterId 计算使用某个集群的所有服务数量

func (*ServerDAO) CountAllEnabledServersWithSSLPolicyIds

func (this *ServerDAO) CountAllEnabledServersWithSSLPolicyIds(tx *dbs.Tx, sslPolicyIds []int64) (count int64, err error)

CountAllEnabledServersWithSSLPolicyIds 计算使用SSL策略的所有服务数量

func (*ServerDAO) CountEnabledServersWithWebIds

func (this *ServerDAO) CountEnabledServersWithWebIds(tx *dbs.Tx, webIds []int64) (count int64, err error)

CountEnabledServersWithWebIds 计算使用某个缓存策略的所有服务数量

func (*ServerDAO) CreateServer

func (this *ServerDAO) CreateServer(tx *dbs.Tx,
	adminId int64,
	userId int64,
	serverType serverconfigs.ServerType,
	name string,
	description string,
	serverNamesJSON []byte,
	isAuditing bool,
	auditingServerNamesJSON []byte,
	httpJSON []byte,
	httpsJSON []byte,
	tcpJSON []byte,
	tlsJSON []byte,
	unixJSON []byte,
	udpJSON []byte,
	webId int64,
	reverseProxyJSON []byte,
	clusterId int64,
	includeNodesJSON []byte,
	excludeNodesJSON []byte,
	groupIds []int64,
	userPlanId int64) (serverId int64, err error)

CreateServer 创建服务

func (*ServerDAO) DisableServer

func (this *ServerDAO) DisableServer(tx *dbs.Tx, serverId int64) (err error)

DisableServer 禁用条目

func (*ServerDAO) EnableServer

func (this *ServerDAO) EnableServer(tx *dbs.Tx, id uint32) (rowsAffected int64, err error)

EnableServer 启用条目

func (*ServerDAO) ExistEnabledUserServerWithSSLPolicyId

func (this *ServerDAO) ExistEnabledUserServerWithSSLPolicyId(tx *dbs.Tx, userId int64, sslPolicyId int64) (bool, error)

ExistEnabledUserServerWithSSLPolicyId 检查是否存在某个用户的策略

func (*ServerDAO) ExistServerNameInCluster

func (this *ServerDAO) ExistServerNameInCluster(tx *dbs.Tx, clusterId int64, serverName string, excludeServerId int64, supportWildcard bool) (bool, error)

ExistServerNameInCluster 检查ServerName是否已存在

func (*ServerDAO) FindAllEnabledServerIds

func (this *ServerDAO) FindAllEnabledServerIds(tx *dbs.Tx) (serverIds []int64, err error)

FindAllEnabledServerIds 获取所有的服务ID

func (*ServerDAO) FindAllEnabledServerIdsWithGroupId

func (this *ServerDAO) FindAllEnabledServerIdsWithGroupId(tx *dbs.Tx, groupId int64) (serverIds []int64, err error)

FindAllEnabledServerIdsWithGroupId 获取某个分组下的所有的服务ID

func (*ServerDAO) FindAllEnabledServerIdsWithSSLPolicyIds

func (this *ServerDAO) FindAllEnabledServerIdsWithSSLPolicyIds(tx *dbs.Tx, sslPolicyIds []int64) (result []int64, err error)

FindAllEnabledServerIdsWithSSLPolicyIds 查找使用某个SSL策略的所有服务Id

func (*ServerDAO) FindAllEnabledServerIdsWithUserId

func (this *ServerDAO) FindAllEnabledServerIdsWithUserId(tx *dbs.Tx, userId int64) (serverIds []int64, err error)

FindAllEnabledServerIdsWithUserId 获取某个用户的所有的服务ID

func (*ServerDAO) FindAllEnabledServersWithDomain

func (this *ServerDAO) FindAllEnabledServersWithDomain(tx *dbs.Tx, domain string) (result []*Server, err error)

FindAllEnabledServersWithDomain 根据域名查找服务 TODO 需要改成使用plainServerNames

func (*ServerDAO) FindAllEnabledServersWithNode

func (this *ServerDAO) FindAllEnabledServersWithNode(tx *dbs.Tx, nodeId int64) (result []*Server, err error)

FindAllEnabledServersWithNode 获取节点中的所有服务

func (*ServerDAO) FindAllEnabledServersWithSSLPolicyIds

func (this *ServerDAO) FindAllEnabledServersWithSSLPolicyIds(tx *dbs.Tx, sslPolicyIds []int64) (result []*Server, err error)

FindAllEnabledServersWithSSLPolicyIds 查找使用某个SSL策略的所有服务

func (*ServerDAO) FindAllEnabledServersWithUserId

func (this *ServerDAO) FindAllEnabledServersWithUserId(tx *dbs.Tx, userId int64) (result []*Server, err error)

FindAllEnabledServersWithUserId 查找用户的所有的服务

func (*ServerDAO) FindAllEnabledServersWithWebIds

func (this *ServerDAO) FindAllEnabledServersWithWebIds(tx *dbs.Tx, webIds []int64) (result []*Server, err error)

FindAllEnabledServersWithWebIds 查找使用某个缓存策略的所有服务

func (*ServerDAO) FindAllServerDNSNamesWithDNSDomainId

func (this *ServerDAO) FindAllServerDNSNamesWithDNSDomainId(tx *dbs.Tx, dnsDomainId int64) ([]string, error)

FindAllServerDNSNamesWithDNSDomainId 查询使用某个DNS域名的所有服务域名

func (*ServerDAO) FindAllServersDNSWithClusterId

func (this *ServerDAO) FindAllServersDNSWithClusterId(tx *dbs.Tx, clusterId int64) (result []*Server, err error)

FindAllServersDNSWithClusterId 获取某个集群下的服务DNS信息

func (*ServerDAO) FindEnabledServer

func (this *ServerDAO) FindEnabledServer(tx *dbs.Tx, serverId int64) (*Server, error)

FindEnabledServer 查找启用中的服务

func (*ServerDAO) FindEnabledServerBasic

func (this *ServerDAO) FindEnabledServerBasic(tx *dbs.Tx, serverId int64) (*Server, error)

FindEnabledServerBasic 查找服务基本信息

func (*ServerDAO) FindEnabledServerIdWithReverseProxyId

func (this *ServerDAO) FindEnabledServerIdWithReverseProxyId(tx *dbs.Tx, reverseProxyId int64) (serverId int64, err error)

FindEnabledServerIdWithReverseProxyId 查找包含某个反向代理的Server

func (*ServerDAO) FindEnabledServerIdWithUserPlanId

func (this *ServerDAO) FindEnabledServerIdWithUserPlanId(tx *dbs.Tx, userPlanId int64) (int64, error)

FindEnabledServerIdWithUserPlanId 查找使用某个套餐的服务ID

func (*ServerDAO) FindEnabledServerIdWithWebId

func (this *ServerDAO) FindEnabledServerIdWithWebId(tx *dbs.Tx, webId int64) (serverId int64, err error)

FindEnabledServerIdWithWebId 根据WebId查找ServerId

func (*ServerDAO) FindEnabledServerName

func (this *ServerDAO) FindEnabledServerName(tx *dbs.Tx, serverId int64) (string, error)

FindEnabledServerName 查找服务名称

func (*ServerDAO) FindEnabledServerType

func (this *ServerDAO) FindEnabledServerType(tx *dbs.Tx, serverId int64) (string, error)

FindEnabledServerType 查找服务类型

func (*ServerDAO) FindEnabledServerWithDomain

func (this *ServerDAO) FindEnabledServerWithDomain(tx *dbs.Tx, domain string) (server *Server, err error)

FindEnabledServerWithDomain 根据域名查找服务集群ID

func (*ServerDAO) FindEnabledServerWithUserPlanId

func (this *ServerDAO) FindEnabledServerWithUserPlanId(tx *dbs.Tx, userPlanId int64) (*Server, error)

FindEnabledServerWithUserPlanId 查找使用某个套餐的服务

func (*ServerDAO) FindFirstHTTPOrHTTPSPortWithClusterId

func (this *ServerDAO) FindFirstHTTPOrHTTPSPortWithClusterId(tx *dbs.Tx, clusterId int64) (int, error)

FindFirstHTTPOrHTTPSPortWithClusterId 获取集群中第一个HTTP或者HTTPS端口

func (*ServerDAO) FindLatestServers

func (this *ServerDAO) FindLatestServers(tx *dbs.Tx, size int64) (result []*Server, err error)

FindLatestServers 查询最近访问的服务

func (*ServerDAO) FindNearbyServersInCluster

func (this *ServerDAO) FindNearbyServersInCluster(tx *dbs.Tx, clusterId int64, serverId int64, size int64) (result []*Server, err error)

FindNearbyServersInCluster 查找所属集群附近的服务

func (*ServerDAO) FindNearbyServersInGroup

func (this *ServerDAO) FindNearbyServersInGroup(tx *dbs.Tx, groupId int64, serverId int64, size int64) (result []*Server, err error)

FindNearbyServersInGroup 查找所属分组附近的服务

func (*ServerDAO) FindReverseProxyRef

func (this *ServerDAO) FindReverseProxyRef(tx *dbs.Tx, serverId int64) (*serverconfigs.ReverseProxyRef, error)

FindReverseProxyRef 根据条件获取反向代理配置

func (*ServerDAO) FindServerAdminIdAndUserId

func (this *ServerDAO) FindServerAdminIdAndUserId(tx *dbs.Tx, serverId int64) (adminId int64, userId int64, err error)

FindServerAdminIdAndUserId 获取当前服务的管理员ID和用户ID

func (*ServerDAO) FindServerClusterId

func (this *ServerDAO) FindServerClusterId(tx *dbs.Tx, serverId int64) (int64, error)

FindServerClusterId 查询当前服务的集群ID

func (*ServerDAO) FindServerDNSName

func (this *ServerDAO) FindServerDNSName(tx *dbs.Tx, serverId int64) (string, error)

FindServerDNSName 查询服务的DNS名称

func (*ServerDAO) FindServerGroupIds

func (this *ServerDAO) FindServerGroupIds(tx *dbs.Tx, serverId int64) ([]int64, error)

FindServerGroupIds 获取服务的分组ID

func (*ServerDAO) FindServerIdWithDNSName added in v0.5.2

func (this *ServerDAO) FindServerIdWithDNSName(tx *dbs.Tx, clusterId int64, dnsName string) (int64, error)

FindServerIdWithDNSName 根据CNAME查询服务ID

func (*ServerDAO) FindServerLastUserPlanIdAndUserId

func (this *ServerDAO) FindServerLastUserPlanIdAndUserId(tx *dbs.Tx, serverId int64) (userPlanId int64, userId int64, err error)

FindServerLastUserPlanIdAndUserId 查找最后使用的套餐

func (*ServerDAO) FindServerNodeFilters

func (this *ServerDAO) FindServerNodeFilters(tx *dbs.Tx, serverId int64) (isOk bool, clusterId int64, err error)

FindServerNodeFilters 查找服务的搜索条件

func (*ServerDAO) FindServerServerNames

func (this *ServerDAO) FindServerServerNames(tx *dbs.Tx, serverId int64) (serverNamesJSON []byte, isAuditing bool, auditingAt int64, auditingServerNamesJSON []byte, auditingResultJSON []byte, err error)

FindServerServerNames 查找ServerNames配置

func (*ServerDAO) FindServerSupportCNAME

func (this *ServerDAO) FindServerSupportCNAME(tx *dbs.Tx, serverId int64) (bool, error)

FindServerSupportCNAME 查询服务是否支持CNAME

func (*ServerDAO) FindServerTrafficLimitConfig

func (this *ServerDAO) FindServerTrafficLimitConfig(tx *dbs.Tx, serverId int64, cacheMap *utils.CacheMap) (*serverconfigs.TrafficLimitConfig, error)

FindServerTrafficLimitConfig 查找服务的流量限制

func (*ServerDAO) FindServerUAM

func (this *ServerDAO) FindServerUAM(tx *dbs.Tx, serverId int64) ([]byte, error)

FindServerUAM 查找服务的UAM配置

func (*ServerDAO) FindServerUserId

func (this *ServerDAO) FindServerUserId(tx *dbs.Tx, serverId int64) (userId int64, err error)

FindServerUserId 查找服务的用户ID

func (*ServerDAO) FindServerUserPlanId

func (this *ServerDAO) FindServerUserPlanId(tx *dbs.Tx, serverId int64) (userPlanId int64, err error)

FindServerUserPlanId 查找服务的套餐ID

func (*ServerDAO) FindServerWebId

func (this *ServerDAO) FindServerWebId(tx *dbs.Tx, serverId int64) (int64, error)

FindServerWebId 查找Server对应的WebId

func (*ServerDAO) FindStatelessServerDNS

func (this *ServerDAO) FindStatelessServerDNS(tx *dbs.Tx, serverId int64) (*Server, error)

FindStatelessServerDNS 查询服务的DNS相关信息,并且不关注状态

func (*ServerDAO) FindUserServerClusterIds added in v0.4.10

func (this *ServerDAO) FindUserServerClusterIds(tx *dbs.Tx, userId int64) ([]int64, error)

FindUserServerClusterIds 获取用户相关服务的集群ID组合

func (*ServerDAO) GenDNSName

func (this *ServerDAO) GenDNSName(tx *dbs.Tx) (string, error)

GenDNSName 生成DNS Name

func (*ServerDAO) GenerateServerDNSName

func (this *ServerDAO) GenerateServerDNSName(tx *dbs.Tx, serverId int64) (string, error)

GenerateServerDNSName 重新生成子域名

func (*ServerDAO) IncreaseServerTotalTraffic

func (this *ServerDAO) IncreaseServerTotalTraffic(tx *dbs.Tx, serverId int64, bytes int64) error

IncreaseServerTotalTraffic 增加服务的总流量

func (*ServerDAO) Init

func (this *ServerDAO) Init()

Init 初始化

func (*ServerDAO) InitServerWeb

func (this *ServerDAO) InitServerWeb(tx *dbs.Tx, serverId int64) (int64, error)

InitServerWeb 初始化Web配置

func (*ServerDAO) ListEnabledServersMatch

func (this *ServerDAO) ListEnabledServersMatch(tx *dbs.Tx, offset int64, size int64, groupId int64, keyword string, userId int64, clusterId int64, auditingFlag int32, protocolFamilies []string, order string) (result []*Server, err error)

ListEnabledServersMatch 列出单页的服务 参数:

groupId 分组ID,如果为-1,则搜索没有分组的服务

func (*ServerDAO) NotifyClusterDNSUpdate

func (this *ServerDAO) NotifyClusterDNSUpdate(tx *dbs.Tx, clusterId int64, serverId int64) error

NotifyClusterDNSUpdate 通知某个集群中的DNS更新

func (*ServerDAO) NotifyClusterUpdate

func (this *ServerDAO) NotifyClusterUpdate(tx *dbs.Tx, clusterId, serverId int64) error

NotifyClusterUpdate 同步指定的集群

func (*ServerDAO) NotifyDNSUpdate

func (this *ServerDAO) NotifyDNSUpdate(tx *dbs.Tx, serverId int64) error

NotifyDNSUpdate 通知当前集群DNS更新

func (*ServerDAO) NotifyDisable

func (this *ServerDAO) NotifyDisable(tx *dbs.Tx, serverId int64) error

NotifyDisable 通知禁用

func (*ServerDAO) NotifyServerPortsUpdate

func (this *ServerDAO) NotifyServerPortsUpdate(tx *dbs.Tx, serverId int64) error

NotifyServerPortsUpdate 通知服务端口变化

func (*ServerDAO) NotifyUpdate

func (this *ServerDAO) NotifyUpdate(tx *dbs.Tx, serverId int64) error

NotifyUpdate 同步服务所在的集群

func (*ServerDAO) NotifyUserClustersChange added in v0.4.10

func (this *ServerDAO) NotifyUserClustersChange(tx *dbs.Tx, userId int64) error

NotifyUserClustersChange 通知用户相关集群更新

func (*ServerDAO) ResetServerTotalTraffic

func (this *ServerDAO) ResetServerTotalTraffic(tx *dbs.Tx, serverId int64) error

ResetServerTotalTraffic 重置服务总流量

func (*ServerDAO) UpdateAuditingServerNames

func (this *ServerDAO) UpdateAuditingServerNames(tx *dbs.Tx, serverId int64, isAuditing bool, auditingServerNamesJSON []byte) error

UpdateAuditingServerNames 修改域名审核

func (*ServerDAO) UpdateServerAuditing

func (this *ServerDAO) UpdateServerAuditing(tx *dbs.Tx, serverId int64, result *pb.ServerNameAuditingResult) error

UpdateServerAuditing 修改域名审核结果

func (*ServerDAO) UpdateServerBandwidth added in v0.5.2

func (this *ServerDAO) UpdateServerBandwidth(tx *dbs.Tx, serverId int64, fullTime string, bandwidthBytes int64) error

UpdateServerBandwidth 更新服务带宽 fullTime YYYYMMDDHHII

func (*ServerDAO) UpdateServerBasic

func (this *ServerDAO) UpdateServerBasic(tx *dbs.Tx, serverId int64, name string, description string, clusterId int64, keepOldConfigs bool, isOn bool, groupIds []int64) error

UpdateServerBasic 修改服务基本信息

func (*ServerDAO) UpdateServerDNS

func (this *ServerDAO) UpdateServerDNS(tx *dbs.Tx, serverId int64, supportCNAME bool) error

UpdateServerDNS 修改DNS设置

func (*ServerDAO) UpdateServerDNSName added in v0.5.2

func (this *ServerDAO) UpdateServerDNSName(tx *dbs.Tx, serverId int64, dnsName string) error

UpdateServerDNSName 设置CNAME

func (*ServerDAO) UpdateServerGroupIds added in v0.4.9

func (this *ServerDAO) UpdateServerGroupIds(tx *dbs.Tx, serverId int64, groupIds []int64) error

UpdateServerGroupIds 修改服务所在分组

func (*ServerDAO) UpdateServerHTTP

func (this *ServerDAO) UpdateServerHTTP(tx *dbs.Tx, serverId int64, config []byte) error

UpdateServerHTTP 修改HTTP配置

func (*ServerDAO) UpdateServerHTTPS

func (this *ServerDAO) UpdateServerHTTPS(tx *dbs.Tx, serverId int64, httpsJSON []byte) error

UpdateServerHTTPS 修改HTTPS配置

func (*ServerDAO) UpdateServerIsOn

func (this *ServerDAO) UpdateServerIsOn(tx *dbs.Tx, serverId int64, isOn bool) error

UpdateServerIsOn 修复服务是否启用

func (*ServerDAO) UpdateServerNames

func (this *ServerDAO) UpdateServerNames(tx *dbs.Tx, serverId int64, serverNamesJSON []byte) error

UpdateServerNames 修改ServerNames配置

func (*ServerDAO) UpdateServerReverseProxy

func (this *ServerDAO) UpdateServerReverseProxy(tx *dbs.Tx, serverId int64, config []byte) error

UpdateServerReverseProxy 修改反向代理配置

func (*ServerDAO) UpdateServerTCP

func (this *ServerDAO) UpdateServerTCP(tx *dbs.Tx, serverId int64, config []byte) error

UpdateServerTCP 修改TCP配置

func (*ServerDAO) UpdateServerTLS

func (this *ServerDAO) UpdateServerTLS(tx *dbs.Tx, serverId int64, config []byte) error

UpdateServerTLS 修改TLS配置

func (*ServerDAO) UpdateServerTrafficLimitConfig

func (this *ServerDAO) UpdateServerTrafficLimitConfig(tx *dbs.Tx, serverId int64, trafficLimitConfig *serverconfigs.TrafficLimitConfig) error

UpdateServerTrafficLimitConfig 修改服务的流量限制

func (*ServerDAO) UpdateServerTrafficLimitStatus

func (this *ServerDAO) UpdateServerTrafficLimitStatus(tx *dbs.Tx, trafficLimitConfig *serverconfigs.TrafficLimitConfig, serverId int64, isUpdatingConfig bool) error

UpdateServerTrafficLimitStatus 修改服务的流量限制状态

func (*ServerDAO) UpdateServerUAM

func (this *ServerDAO) UpdateServerUAM(tx *dbs.Tx, serverId int64, uamConfig *serverconfigs.UAMConfig) error

UpdateServerUAM 开启UAM

func (*ServerDAO) UpdateServerUDP

func (this *ServerDAO) UpdateServerUDP(tx *dbs.Tx, serverId int64, config []byte) error

UpdateServerUDP 修改UDP配置

func (*ServerDAO) UpdateServerUnix

func (this *ServerDAO) UpdateServerUnix(tx *dbs.Tx, serverId int64, config []byte) error

UpdateServerUnix 修改Unix配置

func (*ServerDAO) UpdateServerUserPlanId

func (this *ServerDAO) UpdateServerUserPlanId(tx *dbs.Tx, serverId int64, userPlanId int64) error

UpdateServerUserPlanId 设置服务所属套餐

func (*ServerDAO) UpdateServerWeb

func (this *ServerDAO) UpdateServerWeb(tx *dbs.Tx, serverId int64, webId int64) error

UpdateServerWeb 修改Web配置

func (*ServerDAO) UpdateServersClusterIdWithPlanId

func (this *ServerDAO) UpdateServersClusterIdWithPlanId(tx *dbs.Tx, planId int64, clusterId int64) error

UpdateServersClusterIdWithPlanId 修改套餐所在集群

func (*ServerDAO) UpdateUserServerBasic

func (this *ServerDAO) UpdateUserServerBasic(tx *dbs.Tx, serverId int64, name string) error

UpdateUserServerBasic 设置用户相关的基本信息

func (*ServerDAO) UpdateUserServersClusterId

func (this *ServerDAO) UpdateUserServersClusterId(tx *dbs.Tx, userId int64, oldClusterId, newClusterId int64) error

UpdateUserServersClusterId 设置一个用户下的所有服务的所属集群

type ServerDailyStat

type ServerDailyStat struct {
	Id                  uint64  `field:"id"`                  // ID
	UserId              uint32  `field:"userId"`              // 用户ID
	ServerId            uint32  `field:"serverId"`            // 服务ID
	RegionId            uint32  `field:"regionId"`            // 区域ID
	Bytes               uint64  `field:"bytes"`               // 流量
	CachedBytes         uint64  `field:"cachedBytes"`         // 缓存的流量
	CountRequests       uint64  `field:"countRequests"`       // 请求数
	CountCachedRequests uint64  `field:"countCachedRequests"` // 缓存的请求数
	CountAttackRequests uint64  `field:"countAttackRequests"` // 攻击请求数
	AttackBytes         uint64  `field:"attackBytes"`         // 攻击流量
	Day                 string  `field:"day"`                 // 日期YYYYMMDD
	Hour                string  `field:"hour"`                // YYYYMMDDHH
	TimeFrom            string  `field:"timeFrom"`            // 开始时间HHMMSS
	TimeTo              string  `field:"timeTo"`              // 结束时间
	IsCharged           bool    `field:"isCharged"`           // 是否已计算费用
	PlanId              uint64  `field:"planId"`              // 套餐ID
	Fee                 float64 `field:"fee"`                 // 费用
}

ServerDailyStat 计费流量统计

type ServerDailyStatDAO

type ServerDailyStatDAO dbs.DAO
var SharedServerDailyStatDAO *ServerDailyStatDAO

func NewServerDailyStatDAO

func NewServerDailyStatDAO() *ServerDailyStatDAO

func (*ServerDailyStatDAO) Clean

func (this *ServerDailyStatDAO) Clean(tx *dbs.Tx, days int) error

Clean 清理历史数据

func (*ServerDailyStatDAO) FindDailyStats

func (this *ServerDailyStatDAO) FindDailyStats(tx *dbs.Tx, serverId int64, dayFrom string, dayTo string) (result []*ServerDailyStat, err error)

FindDailyStats 按天统计

func (*ServerDailyStatDAO) FindDistinctServerIds

func (this *ServerDailyStatDAO) FindDistinctServerIds(tx *dbs.Tx, dayFrom string, dayTo string) (serverIds []int64, err error)

FindDistinctServerIds 查找所有有流量的服务ID列表 dayFrom YYYYMMDD dayTo YYYYMMDD

func (*ServerDailyStatDAO) FindHourlyStats

func (this *ServerDailyStatDAO) FindHourlyStats(tx *dbs.Tx, serverId int64, hourFrom string, hourTo string) (result []*ServerDailyStat, err error)

FindHourlyStats 按小时统计

func (*ServerDailyStatDAO) FindMonthlyStatsWithPlan

func (this *ServerDailyStatDAO) FindMonthlyStatsWithPlan(tx *dbs.Tx, month string) (result []*ServerDailyStat, err error)

FindMonthlyStatsWithPlan 查找某月有套餐的流量 month YYYYMM

func (*ServerDailyStatDAO) FindStatsWithDay added in v0.5.3

func (this *ServerDailyStatDAO) FindStatsWithDay(tx *dbs.Tx, serverId int64, day string, timeFrom string, timeTo string) (result []*ServerDailyStat, err error)

FindStatsWithDay 按天查找5分钟级统计 day YYYYMMDD

func (*ServerDailyStatDAO) FindTopUserStats

func (this *ServerDailyStatDAO) FindTopUserStats(tx *dbs.Tx, hourFrom string, hourTo string) (result []*ServerDailyStat, err error)

FindTopUserStats 流量排行

func (*ServerDailyStatDAO) SaveStats

func (this *ServerDailyStatDAO) SaveStats(tx *dbs.Tx, stats []*pb.ServerDailyStat) error

SaveStats 提交数据

func (*ServerDailyStatDAO) SumCurrentDailyStat

func (this *ServerDailyStatDAO) SumCurrentDailyStat(tx *dbs.Tx, serverId int64) (*ServerDailyStat, error)

SumCurrentDailyStat 查找当前时刻的数据统计

func (*ServerDailyStatDAO) SumDailyStat

func (this *ServerDailyStatDAO) SumDailyStat(tx *dbs.Tx, serverId int64, day string) (stat *pb.ServerDailyStat, err error)

SumDailyStat 获取某天内的流量 day 格式为YYYYMMDD

func (*ServerDailyStatDAO) SumDailyStatBeforeMinute

func (this *ServerDailyStatDAO) SumDailyStatBeforeMinute(tx *dbs.Tx, serverId int64, day string, minute string) (stat *pb.ServerDailyStat, err error)

SumDailyStatBeforeMinute 获取某天内某个时间之前的流量 用于同期流量对比 day 格式为YYYYMMDD minute 格式为HHIISS

func (*ServerDailyStatDAO) SumHourlyStat

func (this *ServerDailyStatDAO) SumHourlyStat(tx *dbs.Tx, serverId int64, hour string) (stat *pb.ServerDailyStat, err error)

SumHourlyStat 获取某个小时内的流量 hour 格式为YYYYMMDDHH

func (*ServerDailyStatDAO) SumMinutelyStat

func (this *ServerDailyStatDAO) SumMinutelyStat(tx *dbs.Tx, serverId int64, minute string) (stat *pb.ServerDailyStat, err error)

SumMinutelyStat 获取某个分钟内的流量 minute 格式为YYYYMMDDHHMM,并且已经格式化成每5分钟一个值

func (*ServerDailyStatDAO) SumMonthlyBytes

func (this *ServerDailyStatDAO) SumMonthlyBytes(tx *dbs.Tx, serverId int64, month string) (result int64, err error)

SumMonthlyBytes 获取某月内的流量 month 格式为YYYYMM

func (*ServerDailyStatDAO) SumMonthlyStat

func (this *ServerDailyStatDAO) SumMonthlyStat(tx *dbs.Tx, serverId int64, month string) (stat *pb.ServerDailyStat, err error)

SumMonthlyStat 获取某月内的流量 month 格式为YYYYMM

func (*ServerDailyStatDAO) SumServerMonthlyWithRegion

func (this *ServerDailyStatDAO) SumServerMonthlyWithRegion(tx *dbs.Tx, serverId int64, regionId int64, month string) (int64, error)

SumServerMonthlyWithRegion 根据服务计算某月合计 month 格式为YYYYMM

func (*ServerDailyStatDAO) SumUserDaily

func (this *ServerDailyStatDAO) SumUserDaily(tx *dbs.Tx, userId int64, regionId int64, day string) (int64, error)

SumUserDaily 获取某天流量总和 day 格式为YYYYMMDD

func (*ServerDailyStatDAO) SumUserDailyPeek

func (this *ServerDailyStatDAO) SumUserDailyPeek(tx *dbs.Tx, userId int64, regionId int64, day string) (int64, error)

SumUserDailyPeek 获取某天带宽峰值 day 格式为YYYYMMDD

func (*ServerDailyStatDAO) SumUserMonthly

func (this *ServerDailyStatDAO) SumUserMonthly(tx *dbs.Tx, userId int64, month string) (int64, error)

SumUserMonthly 获取某月流量总和 month 格式为YYYYMM

func (*ServerDailyStatDAO) SumUserMonthlyPeek

func (this *ServerDailyStatDAO) SumUserMonthlyPeek(tx *dbs.Tx, userId int64, regionId int64, month string) (int64, error)

SumUserMonthlyPeek 获取某月带宽峰值 month 格式为YYYYMM

func (*ServerDailyStatDAO) SumUserMonthlyWithoutPlan

func (this *ServerDailyStatDAO) SumUserMonthlyWithoutPlan(tx *dbs.Tx, userId int64, regionId int64, month string) (int64, error)

SumUserMonthlyWithoutPlan 根据用户计算某月合计并排除套餐 month 格式为YYYYMM

func (*ServerDailyStatDAO) UpdateStatFee

func (this *ServerDailyStatDAO) UpdateStatFee(tx *dbs.Tx, statId int64, fee float32) error

UpdateStatFee 设置费用

type ServerDailyStatOperator

type ServerDailyStatOperator struct {
	Id                  interface{} // ID
	UserId              interface{} // 用户ID
	ServerId            interface{} // 服务ID
	RegionId            interface{} // 区域ID
	Bytes               interface{} // 流量
	CachedBytes         interface{} // 缓存的流量
	CountRequests       interface{} // 请求数
	CountCachedRequests interface{} // 缓存的请求数
	CountAttackRequests interface{} // 攻击请求数
	AttackBytes         interface{} // 攻击流量
	Day                 interface{} // 日期YYYYMMDD
	Hour                interface{} // YYYYMMDDHH
	TimeFrom            interface{} // 开始时间HHMMSS
	TimeTo              interface{} // 结束时间
	IsCharged           interface{} // 是否已计算费用
	PlanId              interface{} // 套餐ID
	Fee                 interface{} // 费用
}

func NewServerDailyStatOperator

func NewServerDailyStatOperator() *ServerDailyStatOperator

type ServerGroup

type ServerGroup struct {
	Id               uint32   `field:"id"`               // ID
	AdminId          uint32   `field:"adminId"`          // 管理员ID
	UserId           uint32   `field:"userId"`           // 用户ID
	IsOn             bool     `field:"isOn"`             // 是否启用
	Name             string   `field:"name"`             // 名称
	Order            uint32   `field:"order"`            // 排序
	CreatedAt        uint64   `field:"createdAt"`        // 创建时间
	State            uint8    `field:"state"`            // 状态
	HttpReverseProxy dbs.JSON `field:"httpReverseProxy"` // 反向代理设置
	TcpReverseProxy  dbs.JSON `field:"tcpReverseProxy"`  // TCP反向代理
	UdpReverseProxy  dbs.JSON `field:"udpReverseProxy"`  // UDP反向代理
	WebId            uint32   `field:"webId"`            // Web配置ID
}

ServerGroup 服务分组

type ServerGroupDAO

type ServerGroupDAO dbs.DAO
var SharedServerGroupDAO *ServerGroupDAO

func NewServerGroupDAO

func NewServerGroupDAO() *ServerGroupDAO

func (*ServerGroupDAO) CheckUserGroup

func (this *ServerGroupDAO) CheckUserGroup(tx *dbs.Tx, userId int64, groupId int64) error

CheckUserGroup 检查用户分组

func (*ServerGroupDAO) ComposeGroupConfig

func (this *ServerGroupDAO) ComposeGroupConfig(tx *dbs.Tx, groupId int64, forList bool, cacheMap *utils.CacheMap) (*serverconfigs.ServerGroupConfig, error)

ComposeGroupConfig 组合配置

func (*ServerGroupDAO) CreateGroup

func (this *ServerGroupDAO) CreateGroup(tx *dbs.Tx, name string, userId int64) (groupId int64, err error)

CreateGroup 创建分组

func (*ServerGroupDAO) DisableServerGroup

func (this *ServerGroupDAO) DisableServerGroup(tx *dbs.Tx, id int64) error

DisableServerGroup 禁用条目

func (*ServerGroupDAO) EnableServerGroup

func (this *ServerGroupDAO) EnableServerGroup(tx *dbs.Tx, id int64) error

EnableServerGroup 启用条目

func (*ServerGroupDAO) ExistsGroup added in v0.4.9

func (this *ServerGroupDAO) ExistsGroup(tx *dbs.Tx, groupId int64) (bool, error)

ExistsGroup 检查分组ID是否存在

func (*ServerGroupDAO) FindAllEnabledGroups

func (this *ServerGroupDAO) FindAllEnabledGroups(tx *dbs.Tx, userId int64) (result []*ServerGroup, err error)

FindAllEnabledGroups 查找所有分组

func (*ServerGroupDAO) FindEnabledGroupIdWithReverseProxyId

func (this *ServerGroupDAO) FindEnabledGroupIdWithReverseProxyId(tx *dbs.Tx, reverseProxyId int64) (serverId int64, err error)

FindEnabledGroupIdWithReverseProxyId 查找包含某个反向代理的服务分组

func (*ServerGroupDAO) FindEnabledGroupIdWithWebId

func (this *ServerGroupDAO) FindEnabledGroupIdWithWebId(tx *dbs.Tx, webId int64) (int64, error)

FindEnabledGroupIdWithWebId 根据WebId查找分组

func (*ServerGroupDAO) FindEnabledServerGroup

func (this *ServerGroupDAO) FindEnabledServerGroup(tx *dbs.Tx, id int64) (*ServerGroup, error)

FindEnabledServerGroup 查找启用中的条目

func (*ServerGroupDAO) FindGroupWebId

func (this *ServerGroupDAO) FindGroupWebId(tx *dbs.Tx, groupId int64) (webId int64, err error)

FindGroupWebId 查找分组WebId

func (*ServerGroupDAO) FindHTTPReverseProxyRef

func (this *ServerGroupDAO) FindHTTPReverseProxyRef(tx *dbs.Tx, groupId int64) (*serverconfigs.ReverseProxyRef, error)

FindHTTPReverseProxyRef 根据条件获取HTTP反向代理配置

func (*ServerGroupDAO) FindServerGroupName

func (this *ServerGroupDAO) FindServerGroupName(tx *dbs.Tx, id int64) (string, error)

FindServerGroupName 根据主键查找名称

func (*ServerGroupDAO) FindTCPReverseProxyRef

func (this *ServerGroupDAO) FindTCPReverseProxyRef(tx *dbs.Tx, groupId int64) (*serverconfigs.ReverseProxyRef, error)

FindTCPReverseProxyRef 根据条件获取TCP反向代理配置

func (*ServerGroupDAO) FindUDPReverseProxyRef

func (this *ServerGroupDAO) FindUDPReverseProxyRef(tx *dbs.Tx, groupId int64) (*serverconfigs.ReverseProxyRef, error)

FindUDPReverseProxyRef 根据条件获取UDP反向代理配置

func (*ServerGroupDAO) InitGroupWeb

func (this *ServerGroupDAO) InitGroupWeb(tx *dbs.Tx, groupId int64) (int64, error)

InitGroupWeb 初始化Web配置

func (*ServerGroupDAO) NotifyUpdate

func (this *ServerGroupDAO) NotifyUpdate(tx *dbs.Tx, groupId int64) error

NotifyUpdate 通知更新

func (*ServerGroupDAO) UpdateGroup

func (this *ServerGroupDAO) UpdateGroup(tx *dbs.Tx, groupId int64, name string) error

UpdateGroup 修改分组

func (*ServerGroupDAO) UpdateGroupOrders

func (this *ServerGroupDAO) UpdateGroupOrders(tx *dbs.Tx, groupIds []int64, userId int64) error

UpdateGroupOrders 修改分组排序

func (*ServerGroupDAO) UpdateHTTPReverseProxy

func (this *ServerGroupDAO) UpdateHTTPReverseProxy(tx *dbs.Tx, groupId int64, config []byte) error

UpdateHTTPReverseProxy 修改HTTP反向代理配置

func (*ServerGroupDAO) UpdateTCPReverseProxy

func (this *ServerGroupDAO) UpdateTCPReverseProxy(tx *dbs.Tx, groupId int64, config []byte) error

UpdateTCPReverseProxy 修改TCP反向代理配置

func (*ServerGroupDAO) UpdateUDPReverseProxy

func (this *ServerGroupDAO) UpdateUDPReverseProxy(tx *dbs.Tx, groupId int64, config []byte) error

UpdateUDPReverseProxy 修改UDP反向代理配置

type ServerGroupOperator

type ServerGroupOperator struct {
	Id               interface{} // ID
	AdminId          interface{} // 管理员ID
	UserId           interface{} // 用户ID
	IsOn             interface{} // 是否启用
	Name             interface{} // 名称
	Order            interface{} // 排序
	CreatedAt        interface{} // 创建时间
	State            interface{} // 状态
	HttpReverseProxy interface{} // 反向代理设置
	TcpReverseProxy  interface{} // TCP反向代理
	UdpReverseProxy  interface{} // UDP反向代理
	WebId            interface{} // Web配置ID
}

func NewServerGroupOperator

func NewServerGroupOperator() *ServerGroupOperator

type ServerOperator

type ServerOperator struct {
	Id                  any // ID
	IsOn                any // 是否启用
	UserId              any // 用户ID
	AdminId             any // 管理员ID
	Type                any // 服务类型
	Name                any // 名称
	Description         any // 描述
	PlainServerNames    any // 扁平化域名列表
	ServerNames         any // 域名列表
	AuditingAt          any // 审核提交时间
	AuditingServerNames any // 审核中的域名
	IsAuditing          any // 是否正在审核
	AuditingResult      any // 审核结果
	Http                any // HTTP配置
	Https               any // HTTPS配置
	Tcp                 any // TCP配置
	Tls                 any // TLS配置
	Unix                any // Unix配置
	Udp                 any // UDP配置
	WebId               any // WEB配置
	ReverseProxy        any // 反向代理配置
	GroupIds            any // 分组ID列表
	Config              any // 服务配置,自动生成
	ConfigMd5           any // Md5
	ClusterId           any // 集群ID
	IncludeNodes        any // 部署条件
	ExcludeNodes        any // 节点排除条件
	Version             any // 版本号
	CreatedAt           any // 创建时间
	State               any // 状态
	DnsName             any // DNS名称
	TcpPorts            any // 所包含TCP端口
	UdpPorts            any // 所包含UDP端口
	SupportCNAME        any // 允许CNAME不在域名名单
	TrafficLimit        any // 流量限制
	TrafficDay          any // YYYYMMDD
	TrafficMonth        any // YYYYMM
	TotalDailyTraffic   any // 日流量
	TotalMonthlyTraffic any // 月流量
	TrafficLimitStatus  any // 流量限制状态
	TotalTraffic        any // 总流量
	UserPlanId          any // 所属套餐ID
	LastUserPlanId      any // 上一次使用的套餐
	Uam                 any // UAM设置
	BandwidthTime       any // 带宽更新时间,YYYYMMDDHHII
	BandwidthBytes      any // 最近带宽峰值
}

func NewServerOperator

func NewServerOperator() *ServerOperator

type ServerStatBoard

type ServerStatBoard struct {
	Id        uint64 `field:"id"`        // ID
	Name      string `field:"name"`      // 名称
	ClusterId uint32 `field:"clusterId"` // 集群ID
	IsOn      bool   `field:"isOn"`      // 是否启用
	Order     uint32 `field:"order"`     // 排序
	State     uint8  `field:"state"`     // 状态
}

ServerStatBoard 服务统计看板

type ServerStatBoardChart

type ServerStatBoardChart struct {
	Id      uint64 `field:"id"`      // ID
	BoardId uint64 `field:"boardId"` // 看板ID
	Code    string `field:"code"`    // 内置图表代码
	ItemId  uint32 `field:"itemId"`  // 指标ID
	ChartId uint32 `field:"chartId"` // 图表ID
	Order   uint32 `field:"order"`   // 排序
	State   uint8  `field:"state"`   // 状态
}

ServerStatBoardChart 服务看板中的图表

type ServerStatBoardChartDAO

type ServerStatBoardChartDAO dbs.DAO
var SharedServerStatBoardChartDAO *ServerStatBoardChartDAO

func NewServerStatBoardChartDAO

func NewServerStatBoardChartDAO() *ServerStatBoardChartDAO

func (*ServerStatBoardChartDAO) DisableChart

func (this *ServerStatBoardChartDAO) DisableChart(tx *dbs.Tx, boardId int64, chartId int64) error

DisableChart 禁用图表

func (*ServerStatBoardChartDAO) DisableServerStatBoardChart

func (this *ServerStatBoardChartDAO) DisableServerStatBoardChart(tx *dbs.Tx, id uint64) error

DisableServerStatBoardChart 禁用条目

func (*ServerStatBoardChartDAO) EnableChart

func (this *ServerStatBoardChartDAO) EnableChart(tx *dbs.Tx, boardId int64, chartId int64) error

EnableChart 启用图表

func (*ServerStatBoardChartDAO) EnableServerStatBoardChart

func (this *ServerStatBoardChartDAO) EnableServerStatBoardChart(tx *dbs.Tx, id uint64) error

EnableServerStatBoardChart 启用条目

func (*ServerStatBoardChartDAO) FindAllEnabledCharts

func (this *ServerStatBoardChartDAO) FindAllEnabledCharts(tx *dbs.Tx, boardId int64) (result []*ServerStatBoardChart, err error)

FindAllEnabledCharts 查找看板中所有图表

func (*ServerStatBoardChartDAO) FindEnabledServerStatBoardChart

func (this *ServerStatBoardChartDAO) FindEnabledServerStatBoardChart(tx *dbs.Tx, id uint64) (*ServerStatBoardChart, error)

FindEnabledServerStatBoardChart 查找启用中的条目

type ServerStatBoardChartOperator

type ServerStatBoardChartOperator struct {
	Id      interface{} // ID
	BoardId interface{} // 看板ID
	Code    interface{} // 内置图表代码
	ItemId  interface{} // 指标ID
	ChartId interface{} // 图表ID
	Order   interface{} // 排序
	State   interface{} // 状态
}

func NewServerStatBoardChartOperator

func NewServerStatBoardChartOperator() *ServerStatBoardChartOperator

type ServerStatBoardDAO

type ServerStatBoardDAO dbs.DAO
var SharedServerStatBoardDAO *ServerStatBoardDAO

func NewServerStatBoardDAO

func NewServerStatBoardDAO() *ServerStatBoardDAO

func (*ServerStatBoardDAO) DisableServerStatBoard

func (this *ServerStatBoardDAO) DisableServerStatBoard(tx *dbs.Tx, id uint64) error

DisableServerStatBoard 禁用条目

func (*ServerStatBoardDAO) EnableServerStatBoard

func (this *ServerStatBoardDAO) EnableServerStatBoard(tx *dbs.Tx, id uint64) error

EnableServerStatBoard 启用条目

func (*ServerStatBoardDAO) FindAllEnabledBoards

func (this *ServerStatBoardDAO) FindAllEnabledBoards(tx *dbs.Tx, clusterId int64) (result []*ServerStatBoard, err error)

FindAllEnabledBoards 查找看板

func (*ServerStatBoardDAO) FindEnabledServerStatBoard

func (this *ServerStatBoardDAO) FindEnabledServerStatBoard(tx *dbs.Tx, id uint64) (*ServerStatBoard, error)

FindEnabledServerStatBoard 查找启用中的条目

func (*ServerStatBoardDAO) FindServerStatBoardName

func (this *ServerStatBoardDAO) FindServerStatBoardName(tx *dbs.Tx, id uint64) (string, error)

FindServerStatBoardName 根据主键查找名称

type ServerStatBoardOperator

type ServerStatBoardOperator struct {
	Id        interface{} // ID
	Name      interface{} // 名称
	ClusterId interface{} // 集群ID
	IsOn      interface{} // 是否启用
	Order     interface{} // 排序
	State     interface{} // 状态
}

func NewServerStatBoardOperator

func NewServerStatBoardOperator() *ServerStatBoardOperator

type SubUser

type SubUser struct {
	Id       uint32 `field:"id"`       // ID
	UserId   uint32 `field:"userId"`   // 所属主用户ID
	IsOn     bool   `field:"isOn"`     // 是否启用
	Name     string `field:"name"`     // 名称
	Username string `field:"username"` // 用户名
	Password string `field:"password"` // 密码
	State    uint8  `field:"state"`    // 状态
}

SubUser 子用户

type SubUserDAO

type SubUserDAO dbs.DAO
var SharedSubUserDAO *SubUserDAO

func NewSubUserDAO

func NewSubUserDAO() *SubUserDAO

func (*SubUserDAO) DisableSubUser

func (this *SubUserDAO) DisableSubUser(tx *dbs.Tx, id uint32) error

禁用条目

func (*SubUserDAO) EnableSubUser

func (this *SubUserDAO) EnableSubUser(tx *dbs.Tx, id uint32) error

启用条目

func (*SubUserDAO) FindEnabledSubUser

func (this *SubUserDAO) FindEnabledSubUser(tx *dbs.Tx, id uint32) (*SubUser, error)

查找启用中的条目

func (*SubUserDAO) FindSubUserName

func (this *SubUserDAO) FindSubUserName(tx *dbs.Tx, id uint32) (string, error)

根据主键查找名称

type SubUserOperator

type SubUserOperator struct {
	Id       interface{} // ID
	UserId   interface{} // 所属主用户ID
	IsOn     interface{} // 是否启用
	Name     interface{} // 名称
	Username interface{} // 用户名
	Password interface{} // 密码
	State    interface{} // 状态
}

func NewSubUserOperator

func NewSubUserOperator() *SubUserOperator

type SysEvent

type SysEvent struct {
	Id        uint64   `field:"id"`        // ID
	Type      string   `field:"type"`      // 类型
	Params    dbs.JSON `field:"params"`    // 参数
	CreatedAt uint64   `field:"createdAt"` // 创建时间
}

SysEvent 系统事件

func (*SysEvent) DecodeEvent

func (this *SysEvent) DecodeEvent() (EventInterface, error)

DecodeEvent 解码事件

type SysEventDAO

type SysEventDAO dbs.DAO
var SharedSysEventDAO *SysEventDAO

func NewSysEventDAO

func NewSysEventDAO() *SysEventDAO

func (*SysEventDAO) CreateEvent

func (this *SysEventDAO) CreateEvent(tx *dbs.Tx, event EventInterface) error

创建事件

func (*SysEventDAO) DeleteEvent

func (this *SysEventDAO) DeleteEvent(tx *dbs.Tx, eventId int64) error

删除事件

func (*SysEventDAO) FindEvents

func (this *SysEventDAO) FindEvents(tx *dbs.Tx, size int64) (result []*SysEvent, err error)

查找事件

type SysEventOperator

type SysEventOperator struct {
	Id        interface{} // ID
	Type      interface{} // 类型
	Params    interface{} // 参数
	CreatedAt interface{} // 创建时间
}

func NewSysEventOperator

func NewSysEventOperator() *SysEventOperator

type SysLocker

type SysLocker struct {
	Id        uint64 `field:"id"`        // ID
	Key       string `field:"key"`       // 键值
	Version   uint64 `field:"version"`   // 版本号
	TimeoutAt uint64 `field:"timeoutAt"` // 超时时间
}

并发锁

type SysLockerDAO

type SysLockerDAO dbs.DAO
var SharedSysLockerDAO *SysLockerDAO

func NewSysLockerDAO

func NewSysLockerDAO() *SysLockerDAO

func (*SysLockerDAO) Increase

func (this *SysLockerDAO) Increase(tx *dbs.Tx, key string, defaultValue int64) (int64, error)

Increase 增加版本号

func (*SysLockerDAO) Lock

func (this *SysLockerDAO) Lock(tx *dbs.Tx, key string, timeout int64) (ok bool, err error)

Lock 开锁

func (*SysLockerDAO) Unlock

func (this *SysLockerDAO) Unlock(tx *dbs.Tx, key string) error

Unlock 解锁

type SysLockerOperator

type SysLockerOperator struct {
	Id        interface{} // ID
	Key       interface{} // 键值
	Version   interface{} // 版本号
	TimeoutAt interface{} // 超时时间
}

func NewSysLockerOperator

func NewSysLockerOperator() *SysLockerOperator

type SysSetting

type SysSetting struct {
	Id     uint32   `field:"id"`     // ID
	UserId uint32   `field:"userId"` // 用户ID
	Code   string   `field:"code"`   // 代号
	Value  dbs.JSON `field:"value"`  // 配置值
}

SysSetting 系统配置

type SysSettingDAO

type SysSettingDAO dbs.DAO
var SharedSysSettingDAO *SysSettingDAO

func NewSysSettingDAO

func NewSysSettingDAO() *SysSettingDAO

func (*SysSettingDAO) CompareInt64Setting

func (this *SysSettingDAO) CompareInt64Setting(tx *dbs.Tx, code string, anotherValue int64) (int8, error)

CompareInt64Setting 对比配置中的数字大小

func (*SysSettingDAO) NotifyUpdate

func (this *SysSettingDAO) NotifyUpdate(tx *dbs.Tx, code string) error

NotifyUpdate 通知更改

func (*SysSettingDAO) ReadAdminUIConfig

func (this *SysSettingDAO) ReadAdminUIConfig(tx *dbs.Tx, cacheMap *utils.CacheMap) (*systemconfigs.AdminUIConfig, error)

ReadAdminUIConfig 读取管理员界面配置

func (*SysSettingDAO) ReadGlobalConfig

func (this *SysSettingDAO) ReadGlobalConfig(tx *dbs.Tx) (*serverconfigs.GlobalConfig, error)

ReadGlobalConfig 读取全局配置

func (*SysSettingDAO) ReadSetting

func (this *SysSettingDAO) ReadSetting(tx *dbs.Tx, code string, codeFormatArgs ...interface{}) (valueJSON []byte, err error)

ReadSetting 读取配置

func (*SysSettingDAO) ReadUserFinanceConfig

func (this *SysSettingDAO) ReadUserFinanceConfig(tx *dbs.Tx) (*userconfigs.UserFinanceConfig, error)

ReadUserFinanceConfig 读取用户服务配置

func (*SysSettingDAO) ReadUserServerConfig

func (this *SysSettingDAO) ReadUserServerConfig(tx *dbs.Tx) (*userconfigs.UserServerConfig, error)

ReadUserServerConfig 读取用户服务配置

func (*SysSettingDAO) UpdateSetting

func (this *SysSettingDAO) UpdateSetting(tx *dbs.Tx, codeFormat string, valueJSON []byte, codeFormatArgs ...interface{}) error

UpdateSetting 设置配置

type SysSettingOperator

type SysSettingOperator struct {
	Id     interface{} // ID
	UserId interface{} // 用户ID
	Code   interface{} // 代号
	Value  interface{} // 配置值
}

func NewSysSettingOperator

func NewSysSettingOperator() *SysSettingOperator

type TCPFirewallPolicy

type TCPFirewallPolicy struct {
	Id         uint32 `field:"id"`         // ID
	AdminId    int32  `field:"adminId"`    // 管理员ID
	UserId     uint32 `field:"userId"`     // 用户ID
	TemplateId uint32 `field:"templateId"` // 模版ID
}

TCP防火墙

type TCPFirewallPolicyDAO

type TCPFirewallPolicyDAO dbs.DAO
var SharedTCPFirewallPolicyDAO *TCPFirewallPolicyDAO

func NewTCPFirewallPolicyDAO

func NewTCPFirewallPolicyDAO() *TCPFirewallPolicyDAO

func (*TCPFirewallPolicyDAO) Init

func (this *TCPFirewallPolicyDAO) Init()

初始化

type TCPFirewallPolicyOperator

type TCPFirewallPolicyOperator struct {
	Id         interface{} // ID
	AdminId    interface{} // 管理员ID
	UserId     interface{} // 用户ID
	TemplateId interface{} // 模版ID
}

func NewTCPFirewallPolicyOperator

func NewTCPFirewallPolicyOperator() *TCPFirewallPolicyOperator

type User

type User struct {
	Id              uint32   `field:"id"`              // ID
	IsOn            bool     `field:"isOn"`            // 是否启用
	Username        string   `field:"username"`        // 用户名
	Password        string   `field:"password"`        // 密码
	Fullname        string   `field:"fullname"`        // 真实姓名
	Mobile          string   `field:"mobile"`          // 手机号
	Tel             string   `field:"tel"`             // 联系电话
	Remark          string   `field:"remark"`          // 备注
	Email           string   `field:"email"`           // 邮箱地址
	EmailIsVerified uint8    `field:"emailIsVerified"` // 邮箱是否已验证
	AvatarFileId    uint64   `field:"avatarFileId"`    // 头像文件ID
	CreatedAt       uint64   `field:"createdAt"`       // 创建时间
	Day             string   `field:"day"`             // YYYYMMDD
	UpdatedAt       uint64   `field:"updatedAt"`       // 修改时间
	State           uint8    `field:"state"`           // 状态
	Source          string   `field:"source"`          // 来源
	ClusterId       uint32   `field:"clusterId"`       // 集群ID
	Features        dbs.JSON `field:"features"`        // 允许操作的特征
	RegisteredIP    string   `field:"registeredIP"`    // 注册使用的IP
	IsRejected      bool     `field:"isRejected"`      // 是否已拒绝
	RejectReason    string   `field:"rejectReason"`    // 拒绝理由
	IsVerified      bool     `field:"isVerified"`      // 是否验证通过
	RequirePlans    uint8    `field:"requirePlans"`    // 是否需要购买套餐
	Modules         dbs.JSON `field:"modules"`         // 用户模块
}

User 用户

func (*User) DecodeModules added in v0.5.3

func (this *User) DecodeModules() []string

DecodeModules 解析模块

type UserAccessKey

type UserAccessKey struct {
	Id          uint32 `field:"id"`          // ID
	AdminId     uint32 `field:"adminId"`     // 管理员ID
	UserId      uint32 `field:"userId"`      // 用户ID
	SubUserId   uint32 `field:"subUserId"`   // 子用户ID
	IsOn        bool   `field:"isOn"`        // 是否启用
	UniqueId    string `field:"uniqueId"`    // 唯一的Key
	Secret      string `field:"secret"`      // 密钥
	Description string `field:"description"` // 备注
	AccessedAt  uint64 `field:"accessedAt"`  // 最近一次访问时间
	State       uint8  `field:"state"`       // 状态
}

UserAccessKey AccessKey

type UserAccessKeyDAO

type UserAccessKeyDAO dbs.DAO
var SharedUserAccessKeyDAO *UserAccessKeyDAO

func NewUserAccessKeyDAO

func NewUserAccessKeyDAO() *UserAccessKeyDAO

func (*UserAccessKeyDAO) CheckUserAccessKey

func (this *UserAccessKeyDAO) CheckUserAccessKey(tx *dbs.Tx, adminId int64, userId int64, accessKeyId int64) (bool, error)

CheckUserAccessKey 检查用户的AccessKey

func (*UserAccessKeyDAO) CountAllEnabledAccessKeys

func (this *UserAccessKeyDAO) CountAllEnabledAccessKeys(tx *dbs.Tx, adminId int64, userId int64) (int64, error)

CountAllEnabledAccessKeys 计算可用AccessKey数量

func (*UserAccessKeyDAO) CreateAccessKey

func (this *UserAccessKeyDAO) CreateAccessKey(tx *dbs.Tx, adminId int64, userId int64, description string) (int64, error)

CreateAccessKey 创建Key

func (*UserAccessKeyDAO) DisableUserAccessKey

func (this *UserAccessKeyDAO) DisableUserAccessKey(tx *dbs.Tx, id int64) error

DisableUserAccessKey 禁用条目

func (*UserAccessKeyDAO) EnableUserAccessKey

func (this *UserAccessKeyDAO) EnableUserAccessKey(tx *dbs.Tx, id int64) error

EnableUserAccessKey 启用条目

func (*UserAccessKeyDAO) FindAccessKeyWithUniqueId

func (this *UserAccessKeyDAO) FindAccessKeyWithUniqueId(tx *dbs.Tx, uniqueId string) (*UserAccessKey, error)

FindAccessKeyWithUniqueId 根据UniqueId查找AccessKey

func (*UserAccessKeyDAO) FindAllEnabledAccessKeys

func (this *UserAccessKeyDAO) FindAllEnabledAccessKeys(tx *dbs.Tx, adminId int64, userId int64) (result []*UserAccessKey, err error)

FindAllEnabledAccessKeys 查找用户所有的Key

func (*UserAccessKeyDAO) FindEnabledUserAccessKey

func (this *UserAccessKeyDAO) FindEnabledUserAccessKey(tx *dbs.Tx, id int64) (*UserAccessKey, error)

FindEnabledUserAccessKey 查找启用中的条目

func (*UserAccessKeyDAO) UpdateAccessKeyAccessedAt

func (this *UserAccessKeyDAO) UpdateAccessKeyAccessedAt(tx *dbs.Tx, accessKeyId int64) error

UpdateAccessKeyAccessedAt 更新AccessKey访问时间

func (*UserAccessKeyDAO) UpdateAccessKeyIsOn

func (this *UserAccessKeyDAO) UpdateAccessKeyIsOn(tx *dbs.Tx, accessKeyId int64, isOn bool) error

UpdateAccessKeyIsOn 设置是否启用

type UserAccessKeyOperator

type UserAccessKeyOperator struct {
	Id          interface{} // ID
	AdminId     interface{} // 管理员ID
	UserId      interface{} // 用户ID
	SubUserId   interface{} // 子用户ID
	IsOn        interface{} // 是否启用
	UniqueId    interface{} // 唯一的Key
	Secret      interface{} // 密钥
	Description interface{} // 备注
	AccessedAt  interface{} // 最近一次访问时间
	State       interface{} // 状态
}

func NewUserAccessKeyOperator

func NewUserAccessKeyOperator() *UserAccessKeyOperator

type UserBandwidthStat added in v0.4.9

type UserBandwidthStat struct {
	Id     uint64 `field:"id"`     // ID
	UserId uint64 `field:"userId"` // 用户ID
	Day    string `field:"day"`    // 日期YYYYMMDD
	TimeAt string `field:"timeAt"` // 时间点HHII
	Bytes  uint64 `field:"bytes"`  // 带宽
}

UserBandwidthStat 用户月带宽峰值

type UserBandwidthStatDAO added in v0.4.9

type UserBandwidthStatDAO dbs.DAO
var SharedUserBandwidthStatDAO *UserBandwidthStatDAO

func NewUserBandwidthStatDAO added in v0.4.9

func NewUserBandwidthStatDAO() *UserBandwidthStatDAO

func (*UserBandwidthStatDAO) Clean added in v0.4.9

func (this *UserBandwidthStatDAO) Clean(tx *dbs.Tx) error

Clean 清理过期数据

func (*UserBandwidthStatDAO) FindUserPeekBandwidthInDay added in v0.4.9

func (this *UserBandwidthStatDAO) FindUserPeekBandwidthInDay(tx *dbs.Tx, userId int64, day string) (*UserBandwidthStat, error)

FindUserPeekBandwidthInDay 读取某日带宽峰值 day YYYYMMDD

func (*UserBandwidthStatDAO) FindUserPeekBandwidthInMonth added in v0.4.9

func (this *UserBandwidthStatDAO) FindUserPeekBandwidthInMonth(tx *dbs.Tx, userId int64, month string) (*UserBandwidthStat, error)

FindUserPeekBandwidthInMonth 读取某月带宽峰值 month YYYYMM

func (*UserBandwidthStatDAO) UpdateUserBandwidth added in v0.4.9

func (this *UserBandwidthStatDAO) UpdateUserBandwidth(tx *dbs.Tx, userId int64, day string, timeAt string, bytes int64) error

UpdateUserBandwidth 写入数据

type UserBandwidthStatOperator added in v0.4.9

type UserBandwidthStatOperator struct {
	Id     interface{} // ID
	UserId interface{} // 用户ID
	Day    interface{} // 日期YYYYMMDD
	TimeAt interface{} // 时间点HHII
	Bytes  interface{} // 带宽
}

func NewUserBandwidthStatOperator added in v0.4.9

func NewUserBandwidthStatOperator() *UserBandwidthStatOperator

type UserBill

type UserBill struct {
	Id          uint64  `field:"id"`          // ID
	UserId      uint32  `field:"userId"`      // 用户ID
	Type        string  `field:"type"`        // 消费类型
	Description string  `field:"description"` // 描述
	Amount      float64 `field:"amount"`      // 消费数额
	DayFrom     string  `field:"dayFrom"`     // YYYYMMDD
	DayTo       string  `field:"dayTo"`       // YYYYMMDD
	Month       string  `field:"month"`       // 帐期YYYYMM
	CanPay      bool    `field:"canPay"`      // 是否可以支付
	IsPaid      bool    `field:"isPaid"`      // 是否已支付
	PaidAt      uint64  `field:"paidAt"`      // 支付时间
	Code        string  `field:"code"`        // 账单编号
	CreatedAt   uint64  `field:"createdAt"`   // 创建时间
}

UserBill 用户账单

type UserBillDAO

type UserBillDAO dbs.DAO
var SharedUserBillDAO *UserBillDAO

func NewUserBillDAO

func NewUserBillDAO() *UserBillDAO

func (*UserBillDAO) BillTypeName

func (this *UserBillDAO) BillTypeName(billType BillType) string

BillTypeName 获取账单类型名称

func (*UserBillDAO) CheckUserBill

func (this *UserBillDAO) CheckUserBill(tx *dbs.Tx, userId int64, billId int64) error

CheckUserBill 检查用户账单

func (*UserBillDAO) CountAllUserBills

func (this *UserBillDAO) CountAllUserBills(tx *dbs.Tx, isPaid int32, userId int64, month string) (int64, error)

CountAllUserBills 计算账单数量

func (*UserBillDAO) CreateBill

func (this *UserBillDAO) CreateBill(tx *dbs.Tx, userId int64, billType BillType, description string, amount float64, month string, canPay bool) error

CreateBill 创建账单

func (*UserBillDAO) ExistBill

func (this *UserBillDAO) ExistBill(tx *dbs.Tx, userId int64, billType BillType, month string) (bool, error)

ExistBill 检查是否有当月账单

func (*UserBillDAO) FindUnpaidBills

func (this *UserBillDAO) FindUnpaidBills(tx *dbs.Tx, size int64) (result []*UserBill, err error)

FindUnpaidBills 查找未支付订单

func (*UserBillDAO) FindUserBill

func (this *UserBillDAO) FindUserBill(tx *dbs.Tx, billId int64) (*UserBill, error)

FindUserBill 查找单个账单

func (*UserBillDAO) GenerateBillCode

func (this *UserBillDAO) GenerateBillCode(tx *dbs.Tx) (string, error)

GenerateBillCode 生成账单编号

func (*UserBillDAO) GenerateBills

func (this *UserBillDAO) GenerateBills(tx *dbs.Tx, month string) error

GenerateBills 生成账单 month 格式YYYYMM

func (*UserBillDAO) ListUserBills

func (this *UserBillDAO) ListUserBills(tx *dbs.Tx, isPaid int32, userId int64, month string, offset, size int64) (result []*UserBill, err error)

ListUserBills 列出单页账单

func (*UserBillDAO) SumUnpaidUserBill

func (this *UserBillDAO) SumUnpaidUserBill(tx *dbs.Tx, userId int64) (float32, error)

SumUnpaidUserBill 计算某个用户未支付总额

func (*UserBillDAO) UpdateUserBillIsPaid

func (this *UserBillDAO) UpdateUserBillIsPaid(tx *dbs.Tx, billId int64, isPaid bool) error

UpdateUserBillIsPaid 设置账单已支付

type UserBillOperator

type UserBillOperator struct {
	Id          interface{} // ID
	UserId      interface{} // 用户ID
	Type        interface{} // 消费类型
	Description interface{} // 描述
	Amount      interface{} // 消费数额
	DayFrom     interface{} // YYYYMMDD
	DayTo       interface{} // YYYYMMDD
	Month       interface{} // 帐期YYYYMM
	CanPay      interface{} // 是否可以支付
	IsPaid      interface{} // 是否已支付
	PaidAt      interface{} // 支付时间
	Code        interface{} // 账单编号
	CreatedAt   interface{} // 创建时间
}

func NewUserBillOperator

func NewUserBillOperator() *UserBillOperator

type UserDAO

type UserDAO dbs.DAO
var SharedUserDAO *UserDAO

func NewUserDAO

func NewUserDAO() *UserDAO

func (*UserDAO) CheckUserPassword

func (this *UserDAO) CheckUserPassword(tx *dbs.Tx, username string, encryptedPassword string) (int64, error)

CheckUserPassword 检查用户名、密码

func (*UserDAO) CountAllEnabledUsers

func (this *UserDAO) CountAllEnabledUsers(tx *dbs.Tx, clusterId int64, keyword string, isVerifying bool) (int64, error)

CountAllEnabledUsers 计算用户数量

func (*UserDAO) CountAllVerifyingUsers

func (this *UserDAO) CountAllVerifyingUsers(tx *dbs.Tx) (int64, error)

CountAllVerifyingUsers 获取等待审核的用户数

func (*UserDAO) CountDailyUsers

func (this *UserDAO) CountDailyUsers(tx *dbs.Tx, dayFrom string, dayTo string) ([]*pb.ComposeUserGlobalBoardResponse_DailyStat, error)

CountDailyUsers 计算每天用户数

func (*UserDAO) CreateUser

func (this *UserDAO) CreateUser(tx *dbs.Tx, username string,
	password string,
	fullname string,
	mobile string,
	tel string,
	email string,
	remark string,
	source string,
	clusterId int64,
	features []string,
	registeredIP string,
	isVerified bool) (int64, error)

CreateUser 创建用户

func (*UserDAO) DisableUser

func (this *UserDAO) DisableUser(tx *dbs.Tx, userId int64) error

DisableUser 禁用条目

func (*UserDAO) EnableUser

func (this *UserDAO) EnableUser(tx *dbs.Tx, userId int64) error

EnableUser 启用条目

func (*UserDAO) ExistUser

func (this *UserDAO) ExistUser(tx *dbs.Tx, userId int64, username string) (bool, error)

ExistUser 检查用户名是否存在

func (*UserDAO) FindBasicUserWithoutState

func (this *UserDAO) FindBasicUserWithoutState(tx *dbs.Tx, id int64) (*User, error)

FindBasicUserWithoutState 查找用户基本信息,并忽略状态

func (*UserDAO) FindEnabledBasicUser

func (this *UserDAO) FindEnabledBasicUser(tx *dbs.Tx, id int64) (*User, error)

FindEnabledBasicUser 查找用户基本信息

func (*UserDAO) FindEnabledUser

func (this *UserDAO) FindEnabledUser(tx *dbs.Tx, userId int64, cacheMap *utils.CacheMap) (*User, error)

FindEnabledUser 查找启用的用户

func (*UserDAO) FindEnabledUserIdWithUsername added in v0.4.10

func (this *UserDAO) FindEnabledUserIdWithUsername(tx *dbs.Tx, username string) (int64, error)

FindEnabledUserIdWithUsername 根据用户名查找用户ID

func (*UserDAO) FindUserClusterId

func (this *UserDAO) FindUserClusterId(tx *dbs.Tx, userId int64) (int64, error)

FindUserClusterId 查找用户所在集群

func (*UserDAO) FindUserFeatures

func (this *UserDAO) FindUserFeatures(tx *dbs.Tx, userId int64) ([]*userconfigs.UserFeature, error)

FindUserFeatures 查找用户Features

func (*UserDAO) FindUserFullname

func (this *UserDAO) FindUserFullname(tx *dbs.Tx, userId int64) (string, error)

FindUserFullname 获取管理员名称

func (*UserDAO) ListEnabledUserIds

func (this *UserDAO) ListEnabledUserIds(tx *dbs.Tx, offset, size int64) ([]int64, error)

ListEnabledUserIds 列出单页的用户ID

func (*UserDAO) ListEnabledUsers

func (this *UserDAO) ListEnabledUsers(tx *dbs.Tx, clusterId int64, keyword string, isVerifying bool, offset int64, size int64) (result []*User, err error)

ListEnabledUsers 列出单页用户

func (*UserDAO) SumDailyUsers

func (this *UserDAO) SumDailyUsers(tx *dbs.Tx, dayFrom string, dayTo string) (int64, error)

SumDailyUsers 获取当天用户数量

func (*UserDAO) UpdateUser

func (this *UserDAO) UpdateUser(tx *dbs.Tx, userId int64, username string, password string, fullname string, mobile string, tel string, email string, remark string, isOn bool, nodeClusterId int64) error

UpdateUser 修改用户

func (*UserDAO) UpdateUserFeatures

func (this *UserDAO) UpdateUserFeatures(tx *dbs.Tx, userId int64, featuresJSON []byte) error

UpdateUserFeatures 更新单个用户Features

func (*UserDAO) UpdateUserInfo

func (this *UserDAO) UpdateUserInfo(tx *dbs.Tx, userId int64, fullname string, mobile string, email string) error

UpdateUserInfo 修改用户基本信息

func (*UserDAO) UpdateUserIsVerified

func (this *UserDAO) UpdateUserIsVerified(tx *dbs.Tx, userId int64, isRejected bool, rejectReason string) error

UpdateUserIsVerified 审核用户

func (*UserDAO) UpdateUserLogin

func (this *UserDAO) UpdateUserLogin(tx *dbs.Tx, userId int64, username string, password string) error

UpdateUserLogin 修改用户登录信息

func (*UserDAO) UpdateUsersFeatures added in v0.5.2

func (this *UserDAO) UpdateUsersFeatures(tx *dbs.Tx, featureCodes []string, overwrite bool) error

UpdateUsersFeatures 更新所有用户的Features

type UserIdentity added in v0.4.9

type UserIdentity struct {
	Id           uint64   `field:"id"`           // ID
	UserId       uint64   `field:"userId"`       // 用户ID
	OrgType      string   `field:"orgType"`      // 组织类型
	Type         string   `field:"type"`         // 证件类型
	RealName     string   `field:"realName"`     // 真实姓名
	Number       string   `field:"number"`       // 编号
	FileIds      dbs.JSON `field:"fileIds"`      // 文件ID
	Status       string   `field:"status"`       // 状态:none,submitted,verified,rejected
	State        uint8    `field:"state"`        // 状态
	CreatedAt    uint64   `field:"createdAt"`    // 创建时间
	UpdatedAt    uint64   `field:"updatedAt"`    // 修改时间
	SubmittedAt  uint64   `field:"submittedAt"`  // 提交时间
	RejectedAt   uint64   `field:"rejectedAt"`   // 拒绝时间
	VerifiedAt   uint64   `field:"verifiedAt"`   // 认证时间
	RejectReason string   `field:"rejectReason"` // 拒绝原因
}

UserIdentity 用户实名认证信息

func (*UserIdentity) DecodeFileIds added in v0.4.9

func (this *UserIdentity) DecodeFileIds() []int64

type UserIdentityDAO added in v0.4.9

type UserIdentityDAO dbs.DAO
var SharedUserIdentityDAO *UserIdentityDAO

func NewUserIdentityDAO added in v0.4.9

func NewUserIdentityDAO() *UserIdentityDAO

func (*UserIdentityDAO) CancelUserIdentity added in v0.4.9

func (this *UserIdentityDAO) CancelUserIdentity(tx *dbs.Tx, identityId int64) error

CancelUserIdentity 取消提交审核

func (*UserIdentityDAO) CheckUserIdentity added in v0.4.9

func (this *UserIdentityDAO) CheckUserIdentity(tx *dbs.Tx, userId int64, identityId int64) error

CheckUserIdentity 检查用户认证

func (*UserIdentityDAO) CheckUserIdentityIsVerified added in v0.4.10

func (this *UserIdentityDAO) CheckUserIdentityIsVerified(tx *dbs.Tx, userId int64, orgType userconfigs.UserIdentityOrgType) (bool, error)

CheckUserIdentityIsVerified 检查实名认证

func (*UserIdentityDAO) CheckUserIdentityStatus added in v0.4.10

func (this *UserIdentityDAO) CheckUserIdentityStatus(tx *dbs.Tx, userId int64, status userconfigs.UserIdentityStatus) (bool, error)

CheckUserIdentityStatus 检查状态

func (*UserIdentityDAO) CreateUserIdentity added in v0.4.9

func (this *UserIdentityDAO) CreateUserIdentity(tx *dbs.Tx, userId int64, orgType userconfigs.UserIdentityOrgType, idType userconfigs.UserIdentityType, realName string, number string, fileIds []int64) (int64, error)

CreateUserIdentity 创建

func (*UserIdentityDAO) DisableUserIdentity added in v0.4.9

func (this *UserIdentityDAO) DisableUserIdentity(tx *dbs.Tx, id uint64) error

DisableUserIdentity 禁用条目

func (*UserIdentityDAO) EnableUserIdentity added in v0.4.9

func (this *UserIdentityDAO) EnableUserIdentity(tx *dbs.Tx, id uint64) error

EnableUserIdentity 启用条目

func (*UserIdentityDAO) FindEnabledUserIdentity added in v0.4.9

func (this *UserIdentityDAO) FindEnabledUserIdentity(tx *dbs.Tx, id int64) (*UserIdentity, error)

FindEnabledUserIdentity 查找启用中的条目

func (*UserIdentityDAO) FindEnabledUserIdentityWithOrgType added in v0.4.10

func (this *UserIdentityDAO) FindEnabledUserIdentityWithOrgType(tx *dbs.Tx, userId int64, orgType userconfigs.UserIdentityOrgType) (*UserIdentity, error)

FindEnabledUserIdentityWithOrgType 查找某个类型的认证信息

func (*UserIdentityDAO) FindUserIdentityStatus added in v0.4.9

func (this *UserIdentityDAO) FindUserIdentityStatus(tx *dbs.Tx, identityId int64) (userconfigs.UserIdentityStatus, error)

FindUserIdentityStatus 查找认证信息当前状态

func (*UserIdentityDAO) RejectUserIdentity added in v0.4.9

func (this *UserIdentityDAO) RejectUserIdentity(tx *dbs.Tx, identityId int64, reason string) error

RejectUserIdentity 拒绝

func (*UserIdentityDAO) ResetUserIdentity added in v0.4.10

func (this *UserIdentityDAO) ResetUserIdentity(tx *dbs.Tx, identityId int64) error

ResetUserIdentity 重置实名认证状态

func (*UserIdentityDAO) SubmitUserIdentity added in v0.4.9

func (this *UserIdentityDAO) SubmitUserIdentity(tx *dbs.Tx, identityId int64) error

SubmitUserIdentity 提交审核

func (*UserIdentityDAO) UpdateUserIdentity added in v0.4.9

func (this *UserIdentityDAO) UpdateUserIdentity(tx *dbs.Tx, identityId int64, idType userconfigs.UserIdentityType, realName string, number string, fileIds []int64) error

UpdateUserIdentity 修改

func (*UserIdentityDAO) VerifyUserIdentity added in v0.4.9

func (this *UserIdentityDAO) VerifyUserIdentity(tx *dbs.Tx, identityId int64) error

VerifyUserIdentity 通过

type UserIdentityOperator added in v0.4.9

type UserIdentityOperator struct {
	Id           interface{} // ID
	UserId       interface{} // 用户ID
	OrgType      interface{} // 组织类型
	Type         interface{} // 证件类型
	RealName     interface{} // 真实姓名
	Number       interface{} // 编号
	FileIds      interface{} // 文件ID
	Status       interface{} // 状态:none,submitted,verified,rejected
	State        interface{} // 状态
	CreatedAt    interface{} // 创建时间
	UpdatedAt    interface{} // 修改时间
	SubmittedAt  interface{} // 提交时间
	RejectedAt   interface{} // 拒绝时间
	VerifiedAt   interface{} // 认证时间
	RejectReason interface{} // 拒绝原因
}

func NewUserIdentityOperator added in v0.4.9

func NewUserIdentityOperator() *UserIdentityOperator

type UserNode

type UserNode struct {
	Id          uint32   `field:"id"`          // ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	UniqueId    string   `field:"uniqueId"`    // 唯一ID
	Secret      string   `field:"secret"`      // 密钥
	Name        string   `field:"name"`        // 名称
	Description string   `field:"description"` // 描述
	Http        dbs.JSON `field:"http"`        // 监听的HTTP配置
	Https       dbs.JSON `field:"https"`       // 监听的HTTPS配置
	AccessAddrs dbs.JSON `field:"accessAddrs"` // 外部访问地址
	Order       uint32   `field:"order"`       // 排序
	State       uint8    `field:"state"`       // 状态
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	Weight      uint32   `field:"weight"`      // 权重
	Status      dbs.JSON `field:"status"`      // 运行状态
}

UserNode 用户节点

func (*UserNode) DecodeAccessAddrStrings

func (this *UserNode) DecodeAccessAddrStrings() ([]string, error)

DecodeAccessAddrStrings 解析访问地址,并返回字符串形式

func (*UserNode) DecodeAccessAddrs

func (this *UserNode) DecodeAccessAddrs() ([]*serverconfigs.NetworkAddressConfig, error)

DecodeAccessAddrs 解析访问地址

func (*UserNode) DecodeHTTP

func (this *UserNode) DecodeHTTP() (*serverconfigs.HTTPProtocolConfig, error)

DecodeHTTP 解析HTTP配置

func (*UserNode) DecodeHTTPS

func (this *UserNode) DecodeHTTPS(cacheMap *utils.CacheMap) (*serverconfigs.HTTPSProtocolConfig, error)

DecodeHTTPS 解析HTTPS配置

type UserNodeDAO

type UserNodeDAO dbs.DAO
var SharedUserNodeDAO *UserNodeDAO

func NewUserNodeDAO

func NewUserNodeDAO() *UserNodeDAO

func (*UserNodeDAO) CountAllEnabledAndOnOfflineNodes

func (this *UserNodeDAO) CountAllEnabledAndOnOfflineNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAndOnOfflineNodes 计算离线节点数量

func (*UserNodeDAO) CountAllEnabledAndOnUserNodes

func (this *UserNodeDAO) CountAllEnabledAndOnUserNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAndOnUserNodes 计算启用的用户节点数量

func (*UserNodeDAO) CountAllEnabledUserNodes

func (this *UserNodeDAO) CountAllEnabledUserNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledUserNodes 计算用户节点数量

func (*UserNodeDAO) CountAllEnabledUserNodesWithSSLPolicyIds

func (this *UserNodeDAO) CountAllEnabledUserNodesWithSSLPolicyIds(tx *dbs.Tx, sslPolicyIds []int64) (count int64, err error)

CountAllEnabledUserNodesWithSSLPolicyIds 计算使用SSL策略的所有用户节点数量

func (*UserNodeDAO) CountAllLowerVersionNodes

func (this *UserNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有节点中低于某个版本的节点数量

func (*UserNodeDAO) CreateUserNode

func (this *UserNodeDAO) CreateUserNode(tx *dbs.Tx, name string, description string, httpJSON []byte, httpsJSON []byte, accessAddrsJSON []byte, isOn bool) (nodeId int64, err error)

CreateUserNode 创建用户节点

func (*UserNodeDAO) DisableUserNode

func (this *UserNodeDAO) DisableUserNode(tx *dbs.Tx, nodeId int64) error

DisableUserNode 禁用条目

func (*UserNodeDAO) EnableUserNode

func (this *UserNodeDAO) EnableUserNode(tx *dbs.Tx, id uint32) error

EnableUserNode 启用条目

func (*UserNodeDAO) FindAllEnabledUserNodes

func (this *UserNodeDAO) FindAllEnabledUserNodes(tx *dbs.Tx) (result []*UserNode, err error)

FindAllEnabledUserNodes 列出所有可用用户节点

func (*UserNodeDAO) FindEnabledUserNode

func (this *UserNodeDAO) FindEnabledUserNode(tx *dbs.Tx, id int64) (*UserNode, error)

FindEnabledUserNode 查找启用中的条目

func (*UserNodeDAO) FindEnabledUserNodeIdWithAddr

func (this *UserNodeDAO) FindEnabledUserNodeIdWithAddr(tx *dbs.Tx, protocol string, host string, port int) (int64, error)

FindEnabledUserNodeIdWithAddr 根据主机名和端口获取ID

func (*UserNodeDAO) FindEnabledUserNodeIdWithUniqueId

func (this *UserNodeDAO) FindEnabledUserNodeIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledUserNodeIdWithUniqueId 根据唯一ID获取节点ID

func (*UserNodeDAO) FindEnabledUserNodeWithUniqueId

func (this *UserNodeDAO) FindEnabledUserNodeWithUniqueId(tx *dbs.Tx, uniqueId string) (*UserNode, error)

FindEnabledUserNodeWithUniqueId 根据唯一ID获取节点信息

func (*UserNodeDAO) FindUserNodeAccessAddr added in v0.5.4

func (this *UserNodeDAO) FindUserNodeAccessAddr(tx *dbs.Tx) (string, error)

FindUserNodeAccessAddr 获取用户节点访问地址

func (*UserNodeDAO) FindUserNodeName

func (this *UserNodeDAO) FindUserNodeName(tx *dbs.Tx, id int64) (string, error)

FindUserNodeName 根据主键查找名称

func (*UserNodeDAO) GenUniqueId

func (this *UserNodeDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*UserNodeDAO) ListEnabledUserNodes

func (this *UserNodeDAO) ListEnabledUserNodes(tx *dbs.Tx, offset int64, size int64) (result []*UserNode, err error)

ListEnabledUserNodes 列出单页的用户节点

func (*UserNodeDAO) UpdateNodeStatus

func (this *UserNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, nodeStatus *nodeconfigs.NodeStatus) error

UpdateNodeStatus 更改节点状态

func (*UserNodeDAO) UpdateUserNode

func (this *UserNodeDAO) UpdateUserNode(tx *dbs.Tx, nodeId int64, name string, description string, httpJSON []byte, httpsJSON []byte, accessAddrsJSON []byte, isOn bool) error

UpdateUserNode 修改用户节点

type UserNodeOperator

type UserNodeOperator struct {
	Id          any // ID
	IsOn        any // 是否启用
	UniqueId    any // 唯一ID
	Secret      any // 密钥
	Name        any // 名称
	Description any // 描述
	Http        any // 监听的HTTP配置
	Https       any // 监听的HTTPS配置
	AccessAddrs any // 外部访问地址
	Order       any // 排序
	State       any // 状态
	CreatedAt   any // 创建时间
	AdminId     any // 管理员ID
	Weight      any // 权重
	Status      any // 运行状态
}

func NewUserNodeOperator

func NewUserNodeOperator() *UserNodeOperator

type UserOperator

type UserOperator struct {
	Id              any // ID
	IsOn            any // 是否启用
	Username        any // 用户名
	Password        any // 密码
	Fullname        any // 真实姓名
	Mobile          any // 手机号
	Tel             any // 联系电话
	Remark          any // 备注
	Email           any // 邮箱地址
	EmailIsVerified any // 邮箱是否已验证
	AvatarFileId    any // 头像文件ID
	CreatedAt       any // 创建时间
	Day             any // YYYYMMDD
	UpdatedAt       any // 修改时间
	State           any // 状态
	Source          any // 来源
	ClusterId       any // 集群ID
	Features        any // 允许操作的特征
	RegisteredIP    any // 注册使用的IP
	IsRejected      any // 是否已拒绝
	RejectReason    any // 拒绝理由
	IsVerified      any // 是否验证通过
	RequirePlans    any // 是否需要购买套餐
	Modules         any // 用户模块
}

func NewUserOperator

func NewUserOperator() *UserOperator

type UserPlan

type UserPlan struct {
	Id     uint64 `field:"id"`     // ID
	UserId uint32 `field:"userId"` // 用户ID
	PlanId uint32 `field:"planId"` // 套餐ID
	IsOn   bool   `field:"isOn"`   // 是否启用
	Name   string `field:"name"`   // 名称
	DayTo  string `field:"dayTo"`  // 结束日期
	State  uint8  `field:"state"`  // 状态
}

UserPlan 用户的套餐

type UserPlanDAO

type UserPlanDAO dbs.DAO
var SharedUserPlanDAO *UserPlanDAO

func NewUserPlanDAO

func NewUserPlanDAO() *UserPlanDAO

func (*UserPlanDAO) CheckUserPlan

func (this *UserPlanDAO) CheckUserPlan(tx *dbs.Tx, userId int64, userPlanId int64) error

CheckUserPlan 检查用户套餐

func (*UserPlanDAO) CountAllEnabledUserPlans

func (this *UserPlanDAO) CountAllEnabledUserPlans(tx *dbs.Tx, userId int64, isAvailable bool, isExpired bool, expiringDays int32) (int64, error)

CountAllEnabledUserPlans 计算套餐数量

func (*UserPlanDAO) CreateUserPlan

func (this *UserPlanDAO) CreateUserPlan(tx *dbs.Tx, userId int64, planId int64, name string, dayTo string) (int64, error)

CreateUserPlan 创建套餐

func (*UserPlanDAO) DisableUserPlan

func (this *UserPlanDAO) DisableUserPlan(tx *dbs.Tx, id int64) error

DisableUserPlan 禁用条目

func (*UserPlanDAO) EnableUserPlan

func (this *UserPlanDAO) EnableUserPlan(tx *dbs.Tx, id uint64) error

EnableUserPlan 启用条目

func (*UserPlanDAO) FindAllEnabledPlansForServer

func (this *UserPlanDAO) FindAllEnabledPlansForServer(tx *dbs.Tx, userId int64, serverId int64) (result []*UserPlan, err error)

FindAllEnabledPlansForServer 列出服务可用的套餐

func (*UserPlanDAO) FindEnabledUserPlan

func (this *UserPlanDAO) FindEnabledUserPlan(tx *dbs.Tx, userPlanId int64, cacheMap *utils.CacheMap) (*UserPlan, error)

FindEnabledUserPlan 查找启用中的条目

func (*UserPlanDAO) FindUserPlanWithoutState

func (this *UserPlanDAO) FindUserPlanWithoutState(tx *dbs.Tx, userPlanId int64, cacheMap *utils.CacheMap) (*UserPlan, error)

FindUserPlanWithoutState 查找套餐,并不检查状态 防止因为删除套餐而导致计费失败

func (*UserPlanDAO) ListEnabledUserPlans

func (this *UserPlanDAO) ListEnabledUserPlans(tx *dbs.Tx, userId int64, isAvailable bool, isExpired bool, expiringDays int32, offset int64, size int64) (result []*UserPlan, err error)

ListEnabledUserPlans 列出单页套餐

func (*UserPlanDAO) NotifyUpdate

func (this *UserPlanDAO) NotifyUpdate(tx *dbs.Tx, userPlanId int64) error

NotifyUpdate 通知更新

func (*UserPlanDAO) UpdateUserPlan

func (this *UserPlanDAO) UpdateUserPlan(tx *dbs.Tx, userPlanId int64, planId int64, name string, dayTo string, isOn bool) error

UpdateUserPlan 修改套餐

func (*UserPlanDAO) UpdateUserPlanDayTo

func (this *UserPlanDAO) UpdateUserPlanDayTo(tx *dbs.Tx, userPlanId int64, dayTo string) error

UpdateUserPlanDayTo 修改套餐日期

type UserPlanOperator

type UserPlanOperator struct {
	Id     interface{} // ID
	UserId interface{} // 用户ID
	PlanId interface{} // 套餐ID
	IsOn   interface{} // 是否启用
	Name   interface{} // 名称
	DayTo  interface{} // 结束日期
	State  interface{} // 状态
}

func NewUserPlanOperator

func NewUserPlanOperator() *UserPlanOperator

type Version

type Version struct {
	Id      uint64 `field:"id"`      // ID
	Version string `field:"version"` //
}

数据库结构版本

type VersionDAO

type VersionDAO dbs.DAO
var SharedVersionDAO *VersionDAO

func NewVersionDAO

func NewVersionDAO() *VersionDAO

type VersionOperator

type VersionOperator struct {
	Id      interface{} // ID
	Version interface{} //
}

func NewVersionOperator

func NewVersionOperator() *VersionOperator

Source Files

Directories

Path Synopsis
dns

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL