-
Notifications
You must be signed in to change notification settings - Fork 0
/
ratio.proto
37 lines (32 loc) · 1007 Bytes
/
ratio.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";
service RateLimitService {
// Provides info about whether the rate limit should apply or not.
rpc RateLimit (RateLimitRequest) returns (RateLimitResponse);
}
// The main request message made to the RateLimitService.
message RateLimitRequest {
// The owner of the target resource. Usually the service name from where
// the request was made. Used for storing the hits in a dedicated bucket
// per service.
//
// Examples:
// 1. my-awesome-service
string owner = 1;
// The target resource behind the rate limit.
//
// Examples:
// 1. /v1/order/pay
// 2. /v1/order/pay#customer123
// 3. graphql_resolver_root
string resource = 2;
}
// The response of RateLimit. Strongly based on Envoy.
// See https://github.com/envoyproxy/envoy/blob/master/api/envoy/service/ratelimit/v2/rls.proto
message RateLimitResponse {
enum Code {
UNKNOWN = 0;
OK = 1;
OVER_LIMIT = 2;
}
Code code = 1;
}