/
token_bucket.proto
37 lines (27 loc) · 1.24 KB
/
token_bucket.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
syntax = "proto3";
package envoy.type.v3;
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.type.v3";
option java_outer_classname = "TokenBucketProto";
option java_multiple_files = true;
// [#protodoc-title: Token bucket]
// Configures a token bucket, typically used for rate limiting.
message TokenBucket {
option (udpa.annotations.versioning).previous_message_type = "envoy.type.TokenBucket";
// The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket
// initially contains.
uint32 max_tokens = 1 [(validate.rules).uint32 = {gt: 0}];
// The number of tokens added to the bucket during each fill interval. If not specified, defaults
// to a single token.
google.protobuf.UInt32Value tokens_per_fill = 2 [(validate.rules).uint32 = {gt: 0}];
// The fill interval that tokens are added to the bucket. During each fill interval
// `tokens_per_fill` are added to the bucket. The bucket will never contain more than
// `max_tokens` tokens.
google.protobuf.Duration fill_interval = 3 [(validate.rules).duration = {
required: true
gt {}
}];
}