-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ads: support envoy filter local ratelimit.
Signed-off-by: yuan <[email protected]>
- Loading branch information
1 parent
53caaa8
commit 5964c91
Showing
10 changed files
with
389 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
syntax = "proto3"; | ||
|
||
package filter; | ||
option go_package = "kmesh.net/kmesh/api/filter;filter"; | ||
|
||
/* | ||
TokenBucket defines parameters for a token bucket rate limiter. | ||
https://www.envoyproxy.io/docs/envoy/latest/api-v3/type/v3/token_bucket.proto#envoy-v3-api-msg-type-v3-tokenbucket | ||
{ | ||
"max_tokens": ..., | ||
"tokens_per_fill": {...}, | ||
"fill_interval": {...} | ||
} | ||
*/ | ||
message TokenBucket { | ||
// The maximum number of tokens in the bucket. | ||
int64 max_tokens = 1; | ||
|
||
// The number of tokens added to the bucket during each fill interval. | ||
int64 tokens_per_fill = 2; | ||
|
||
// The interval at which the bucket is refilled in nanoseconds. | ||
int64 fill_interval = 3; | ||
} | ||
|
||
|
||
/* | ||
LocalRateLimit defines parameters for local rate limiting. | ||
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto#envoy-v3-api-msg-extensions-filters-http-local-ratelimit-v3-localratelimit | ||
{ | ||
"stat_prefix": ..., | ||
"status": {...}, | ||
"token_bucket": {...}, | ||
"filter_enabled": {...}, | ||
"filter_enforced": {...}, | ||
"request_headers_to_add_when_not_enforced": [], | ||
"response_headers_to_add": [], | ||
"descriptors": [], | ||
"stage": ..., | ||
"local_rate_limit_per_downstream_connection": ..., | ||
"local_cluster_rate_limit": {...}, | ||
"enable_x_ratelimit_headers": ..., | ||
"vh_rate_limits": ..., | ||
"always_consume_default_token_bucket": {...}, | ||
"rate_limited_as_resource_exhausted": ... | ||
} | ||
*/ | ||
message LocalRateLimit { | ||
reserved 1 to 2; | ||
|
||
// The token bucket configuration for the rate limiter. | ||
TokenBucket token_bucket = 3; | ||
|
||
// Reserved field numbers for future use | ||
reserved 4 to 15; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.