mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-18 20:00:25 +08:00
实现网络数据包相关统计(商业版本)
This commit is contained in:
@@ -37,7 +37,7 @@ func (this *NodeCluster) DecodeDDoSProtection() *ddosconfigs.ProtectionConfig {
|
||||
return result
|
||||
}
|
||||
|
||||
// HasDDoSProtection 检查是否有DDOS设置
|
||||
// HasDDoSProtection 检查是否有DDoS设置
|
||||
func (this *NodeCluster) HasDDoSProtection() bool {
|
||||
var config = this.DecodeDDoSProtection()
|
||||
if config != nil {
|
||||
@@ -46,6 +46,27 @@ func (this *NodeCluster) HasDDoSProtection() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// HasNetworkSecurityPolicy 检查是否有安全策略设置
|
||||
func (this *NodeCluster) HasNetworkSecurityPolicy() bool {
|
||||
var policy = this.DecodeNetworkSecurityPolicy()
|
||||
if policy != nil {
|
||||
return policy.IsOn()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// DecodeNetworkSecurityPolicy 解析安全策略设置
|
||||
func (this *NodeCluster) DecodeNetworkSecurityPolicy() *nodeconfigs.NetworkSecurityPolicy {
|
||||
var policy = nodeconfigs.NewNetworkSecurityPolicy()
|
||||
if IsNotNull(this.NetworkSecurity) {
|
||||
err := json.Unmarshal(this.NetworkSecurity, policy)
|
||||
if err != nil {
|
||||
remotelogs.Error("NodeCluster.DecodeNetworkSecurityPolicy()", err.Error())
|
||||
}
|
||||
}
|
||||
return policy
|
||||
}
|
||||
|
||||
// DecodeClock 解析时钟配置
|
||||
func (this *NodeCluster) DecodeClock() *nodeconfigs.ClockConfig {
|
||||
var clock = nodeconfigs.DefaultClockConfig()
|
||||
|
||||
Reference in New Issue
Block a user