优化代码

This commit is contained in:
GoEdgeLab
2023-05-23 19:51:28 +08:00
parent e95175bc12
commit 061c4ea619
2 changed files with 26 additions and 1 deletions

View File

@@ -3,9 +3,12 @@
package nodeconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
// HTTPCCPolicy CC策略
type HTTPCCPolicy struct {
IsOn bool `json:"isOn" yaml:"isOn"`
IsOn bool `json:"isOn" yaml:"isOn"`
Thresholds []*serverconfigs.HTTPCCThreshold `json:"thresholds" yaml:"thresholds"` // 阈值
}
func NewHTTPCCPolicy() *HTTPCCPolicy {

View File

@@ -3,6 +3,28 @@
package serverconfigs
type HTTPCCThreshold struct {
// stub
}
func NewHTTPCCThreshold() *HTTPCCThreshold {
return &HTTPCCThreshold{}
}
func (this *HTTPCCThreshold) Merge(threshold *HTTPCCThreshold) {
// stub
}
func (this *HTTPCCThreshold) MergeIfEmpty(threshold *HTTPCCThreshold) {
// stub
}
func (this *HTTPCCThreshold) Clone() *HTTPCCThreshold {
return &HTTPCCThreshold{}
}
var DefaultHTTPCCThresholds = []*HTTPCCThreshold{} // stub
// DefaultHTTPCCConfig 默认的CC配置
func DefaultHTTPCCConfig() *HTTPCCConfig {
return &HTTPCCConfig{}