refactor(zrpc): prefer static config for zrpc server statinterceptor (#3105)

This commit is contained in:
cong
2023-04-08 21:03:32 +08:00
committed by GitHub
parent 2e6402f4b5
commit 49135fe25e
5 changed files with 171 additions and 15 deletions

View File

@@ -1,5 +1,7 @@
package internal
import "time"
type (
// ClientMiddlewaresConf defines whether to use client middlewares.
ClientMiddlewaresConf struct {
@@ -12,10 +14,12 @@ type (
// ServerMiddlewaresConf defines whether to use server middlewares.
ServerMiddlewaresConf struct {
Trace bool `json:",default=true"`
Recover bool `json:",default=true"`
Stat bool `json:",default=true"`
Prometheus bool `json:",default=true"`
Breaker bool `json:",default=true"`
Trace bool `json:",default=true"`
Recover bool `json:",default=true"`
Stat bool `json:",default=true"`
StatSlowThreshold time.Duration `json:",default=500ms"`
NotLoggingContentMethods []string `json:",optional"`
Prometheus bool `json:",default=true"`
Breaker bool `json:",default=true"`
}
)