From 061c4ea619cdf65be3f2b620eba6c9a13ac1ccb3 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 23 May 2023 19:51:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/nodeconfigs/http_cc_policy.go | 5 ++++- pkg/serverconfigs/http_cc_config.go | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pkg/nodeconfigs/http_cc_policy.go b/pkg/nodeconfigs/http_cc_policy.go index 3ef2f27..ec70f2e 100644 --- a/pkg/nodeconfigs/http_cc_policy.go +++ b/pkg/nodeconfigs/http_cc_policy.go @@ -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 { diff --git a/pkg/serverconfigs/http_cc_config.go b/pkg/serverconfigs/http_cc_config.go index 6ee22e6..c90cbbf 100644 --- a/pkg/serverconfigs/http_cc_config.go +++ b/pkg/serverconfigs/http_cc_config.go @@ -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{}