From b59b1308697a80926e9e0199c8ca306da1b7797c Mon Sep 17 00:00:00 2001 From: traky Date: Mon, 30 Dec 2024 14:04:45 +0800 Subject: [PATCH] lint --- docs/zh/latest/plugins/limit-count.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/zh/latest/plugins/limit-count.md b/docs/zh/latest/plugins/limit-count.md index 029659252124..3a0ebf4eca9a 100644 --- a/docs/zh/latest/plugins/limit-count.md +++ b/docs/zh/latest/plugins/limit-count.md @@ -48,7 +48,7 @@ description: limit-count 插件使用固定窗口算法,通过给定时间间 | count | integer | 是 | | > 0 | 给定时间间隔内允许的最大请求数。 | | time_window | integer | 是 | | > 0 | 速率限制 `count` 对应的时间间隔(以秒为单位)。 | | key_type | string | 否 | var | ["var","var_combination","constant"] | key 的类型。如果`key_type` 为 `var`,则 `key` 将被解释为变量。如果 `key_type` 为 `var_combination`,则 `key` 将被解释为变量的组合。如果 `key_type` 为 `constant`,则 `key` 将被解释为常量。 | -| key | string | 否 | remote_addr | | 用于计数请求的key 。如果 `key_type` 为 `var`,则 `key` 将被解释为变量。变量不需要以美元符号(`$`)为前缀。如果 `key_type` 为 `var_combination`,则 `key` 会被解释为变量的组合。所有变量都应该以美元符号 (`$`) 为前缀。例如,要配置 `key` 使用两个请求头 `custom-a` 和 `custom-b` 的组合,则 `key` 应该配置为 `$http_custom_a $http_custom_b`。如果 `key_type` 为 `constant`,则 `key` 会被解释为常量值。| +| key | string | 否 | remote_addr | | 用于计数请求的key。如果 `key_type` 为 `var`,则 `key` 将被解释为变量。变量不需要以美元符号(`$`)为前缀。如果 `key_type` 为 `var_combination`,则 `key` 会被解释为变量的组合。所有变量都应该以美元符号 (`$`) 为前缀。例如,要配置 `key` 使用两个请求头 `custom-a` 和 `custom-b` 的组合,则 `key` 应该配置为 `$http_custom_a $http_custom_b`。如果 `key_type` 为 `constant`,则 `key` 会被解释为常量值。| | rejection_code | integer | 否 | 503 | [200,...,599] | 请求因超出阈值而被拒绝时返回的 HTTP 状态代码。| | rejection_msg | string | 否 | | 非空 | 请求因超出阈值而被拒绝时返回的响应主体。| | policy | string | 否 | local | ["local","re​​dis","re​​dis-cluster"] | 速率限制计数器的策略。如果是 `local`,则计数器存储在本地内存中。如果是 `redis`,则计数器存储在 Redis 实例上。如果是 `redis-cluster`,则计数器存储在 Redis 集群中。| @@ -68,7 +68,7 @@ redis_cluster_name | string | 否 | | | | Redis 集群的名称。当 `policy` | redis_cluster_ssl | boolean | 否 | false | | 如果为 `true`,当 `policy` 为 `redis-cluster`时,使用 SSL 连接 Redis 集群。| | redis_cluster_ssl_verify | boolean | 否 | false | | 如果为 `true`,当 `policy` 为 `redis-cluster` 时,验证服务器 SSL 证书。 | -# 示例 +## 示例 下面的示例演示了如何在不同情况下配置 `limit-count` 。 @@ -229,7 +229,7 @@ curl -i "http://127.0.0.1:9080/get" -H 'apikey: john-key' 以下示例通过配置 `limit-count` 插件的 `group` 演示了在多个路由之间共享速率限制配额。 -请注意,同一 `group` 的 `limit-count` 插件的配置应该相同。 为了避免更新异常和重复配置,您可以创建一个带有 `limit-count` 插件和上游的服务,以供路由连接。 +请注意,同一 `group` 的 `limit-count` 插件的配置应该相同。为了避免更新异常和重复配置,您可以创建一个带有 `limit-count` 插件和上游的服务,以供路由连接。 创建服务: @@ -406,7 +406,7 @@ curl -i "http://127.0.0.1:9080/get" 以下示例演示了如何为常规和匿名消费者配置不同的速率限制策略,其中匿名消费者不需要进行身份验证并且配额较少。虽然此示例使用 [`key-auth`](./key-auth.md) 进行身份验证,但匿名消费者也可以使用 [`basic-auth`](./basic-auth.md)、[`jwt-auth`](./jwt-auth.md) 和 [`hmac-auth`](./hmac-auth.md) 进行配置。 -创建一个消费者 `john`,并配置 `limit-count` 插件,以允许30秒内配额为3: +创建一个消费者 `john`,并配置 `limit-count` 插件,以允许 30 秒内配额为 3: ```shell curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \