【新增】添加接口调用限流

This commit is contained in:
PandaGoAdmin
2022-01-19 17:29:01 +08:00
parent 3d603d8fde
commit c8449e0432
7 changed files with 49 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ type Server struct {
Port int `yaml:"port"`
Model string `yaml:"model"`
Cors bool `yaml:"cors"`
Rate *Rate `yaml:"rate"`
IsInitTable bool `yaml:"isInitTable"`
DbType string `yaml:"db-type"`
ExcelDir string `yaml:"excel-dir"`
@@ -33,3 +34,8 @@ type Tls struct {
KeyFile string `yaml:"key-file"` // 私钥文件路径
CertFile string `yaml:"cert-file"` // 证书文件路径
}
type Rate struct {
IsRate bool `yaml:"is-rate"` // 是否限流
RateNum float64 `yaml:"rate-num"` // 限流数量
}