Skip to content

Commit e3aae23

Browse files
committed
modify the comment
1 parent 78e73f8 commit e3aae23

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

plugins/wasm-go/extensions/cluster-key-rate-limit/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
# 配置说明
88

9-
| 配置项 | 类型 | 必填 | 默认值 | 说明 |
10-
| ----------------------- | ------ | ---- | ------ |--------------------------------------------------------------------------|
11-
| rule_name | string || - | 限流规则名称,根据限流规则名称+限流类型+限流key+限流key对应的实际值来拼装redis key |
12-
| rule_items | array of object || - | 限流规则项,按照rule_items下的排列顺序,匹配第一个rule_item后命中限流规则,后续规则将被忽略 |
9+
| 配置项 | 类型 | 必填 | 默认值 | 说明 |
10+
| ----------------------- | ------ | ---- | ------ |---------------------------------------------------------------------------|
11+
| rule_name | string || - | 限流规则名称,根据限流规则名称+限流类型+限流key名称+限流key对应的实际值来拼装redis key |
12+
| rule_items | array of object || - | 限流规则项,按照rule_items下的排列顺序,匹配第一个rule_item后命中限流规则,后续规则将被忽略 |
1313
| show_limit_quota_header | bool || false | 响应头中是否显示`X-RateLimit-Limit`(限制的总请求数)和`X-RateLimit-Remaining`(剩余还可以发送的请求数) |
14-
| rejected_code | int || 429 | 请求被限流时,返回的HTTP状态码 |
15-
| rejected_msg | string || Too many requests | 请求被限流时,返回的响应体 |
16-
| redis | object || - | redis相关配置 |
14+
| rejected_code | int || 429 | 请求被限流时,返回的HTTP状态码 |
15+
| rejected_msg | string || Too many requests | 请求被限流时,返回的响应体 |
16+
| redis | object || - | redis相关配置 |
1717

1818
`rule_items`中每一项的配置字段说明
1919

plugins/wasm-go/extensions/cluster-key-rate-limit/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ func main() {
3737
}
3838

3939
const (
40-
// ClusterRateLimitFormat redis key生成规则为higress-cluster-key-rate-limit:ruleName:ruleItem.limitType:configItem.key:configItem.key对应的实际值
41-
ClusterRateLimitFormat string = "higress-cluster-key-rate-limit:%s:%s:%s:%s"
40+
ClusterRateLimitFormat string = "higress-cluster-key-rate-limit:%s:%s:%s:%s" // redis key为前缀:限流限流规则名称:限流类型:限流key名称:限流key对应的实际值
4241
FixedWindowScript string = `
4342
local ttl = redis.call('ttl', KEYS[1])
4443
if ttl < 0 then

0 commit comments

Comments
 (0)