1
2
3
4
5
6
7 package ratelimitv2
8
9 import (
10 context "context"
11 _ "github.com/cncf/xds/go/udpa/annotations"
12 core "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/api/v2/core"
13 ratelimit "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/api/v2/ratelimit"
14 grpc "google.golang.org/grpc"
15 codes "google.golang.org/grpc/codes"
16 status "google.golang.org/grpc/status"
17 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
18 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
19 reflect "reflect"
20 sync "sync"
21 )
22
23 const (
24
25 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
26
27 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
28 )
29
30 type RateLimitResponse_Code int32
31
32 const (
33
34 RateLimitResponse_UNKNOWN RateLimitResponse_Code = 0
35
36 RateLimitResponse_OK RateLimitResponse_Code = 1
37
38 RateLimitResponse_OVER_LIMIT RateLimitResponse_Code = 2
39 )
40
41
42 var (
43 RateLimitResponse_Code_name = map[int32]string{
44 0: "UNKNOWN",
45 1: "OK",
46 2: "OVER_LIMIT",
47 }
48 RateLimitResponse_Code_value = map[string]int32{
49 "UNKNOWN": 0,
50 "OK": 1,
51 "OVER_LIMIT": 2,
52 }
53 )
54
55 func (x RateLimitResponse_Code) Enum() *RateLimitResponse_Code {
56 p := new(RateLimitResponse_Code)
57 *p = x
58 return p
59 }
60
61 func (x RateLimitResponse_Code) String() string {
62 return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
63 }
64
65 func (RateLimitResponse_Code) Descriptor() protoreflect.EnumDescriptor {
66 return file_envoy_service_ratelimit_v2_rls_proto_enumTypes[0].Descriptor()
67 }
68
69 func (RateLimitResponse_Code) Type() protoreflect.EnumType {
70 return &file_envoy_service_ratelimit_v2_rls_proto_enumTypes[0]
71 }
72
73 func (x RateLimitResponse_Code) Number() protoreflect.EnumNumber {
74 return protoreflect.EnumNumber(x)
75 }
76
77
78 func (RateLimitResponse_Code) EnumDescriptor() ([]byte, []int) {
79 return file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP(), []int{1, 0}
80 }
81
82 type RateLimitResponse_RateLimit_Unit int32
83
84 const (
85
86 RateLimitResponse_RateLimit_UNKNOWN RateLimitResponse_RateLimit_Unit = 0
87
88 RateLimitResponse_RateLimit_SECOND RateLimitResponse_RateLimit_Unit = 1
89
90 RateLimitResponse_RateLimit_MINUTE RateLimitResponse_RateLimit_Unit = 2
91
92 RateLimitResponse_RateLimit_HOUR RateLimitResponse_RateLimit_Unit = 3
93
94 RateLimitResponse_RateLimit_DAY RateLimitResponse_RateLimit_Unit = 4
95 )
96
97
98 var (
99 RateLimitResponse_RateLimit_Unit_name = map[int32]string{
100 0: "UNKNOWN",
101 1: "SECOND",
102 2: "MINUTE",
103 3: "HOUR",
104 4: "DAY",
105 }
106 RateLimitResponse_RateLimit_Unit_value = map[string]int32{
107 "UNKNOWN": 0,
108 "SECOND": 1,
109 "MINUTE": 2,
110 "HOUR": 3,
111 "DAY": 4,
112 }
113 )
114
115 func (x RateLimitResponse_RateLimit_Unit) Enum() *RateLimitResponse_RateLimit_Unit {
116 p := new(RateLimitResponse_RateLimit_Unit)
117 *p = x
118 return p
119 }
120
121 func (x RateLimitResponse_RateLimit_Unit) String() string {
122 return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
123 }
124
125 func (RateLimitResponse_RateLimit_Unit) Descriptor() protoreflect.EnumDescriptor {
126 return file_envoy_service_ratelimit_v2_rls_proto_enumTypes[1].Descriptor()
127 }
128
129 func (RateLimitResponse_RateLimit_Unit) Type() protoreflect.EnumType {
130 return &file_envoy_service_ratelimit_v2_rls_proto_enumTypes[1]
131 }
132
133 func (x RateLimitResponse_RateLimit_Unit) Number() protoreflect.EnumNumber {
134 return protoreflect.EnumNumber(x)
135 }
136
137
138 func (RateLimitResponse_RateLimit_Unit) EnumDescriptor() ([]byte, []int) {
139 return file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP(), []int{1, 0, 0}
140 }
141
142
143
144
145
146
147
148
149 type RateLimitRequest struct {
150 state protoimpl.MessageState
151 sizeCache protoimpl.SizeCache
152 unknownFields protoimpl.UnknownFields
153
154
155
156 Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
157
158
159
160 Descriptors []*ratelimit.RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"`
161
162
163 HitsAddend uint32 `protobuf:"varint,3,opt,name=hits_addend,json=hitsAddend,proto3" json:"hits_addend,omitempty"`
164 }
165
166 func (x *RateLimitRequest) Reset() {
167 *x = RateLimitRequest{}
168 if protoimpl.UnsafeEnabled {
169 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[0]
170 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
171 ms.StoreMessageInfo(mi)
172 }
173 }
174
175 func (x *RateLimitRequest) String() string {
176 return protoimpl.X.MessageStringOf(x)
177 }
178
179 func (*RateLimitRequest) ProtoMessage() {}
180
181 func (x *RateLimitRequest) ProtoReflect() protoreflect.Message {
182 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[0]
183 if protoimpl.UnsafeEnabled && x != nil {
184 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
185 if ms.LoadMessageInfo() == nil {
186 ms.StoreMessageInfo(mi)
187 }
188 return ms
189 }
190 return mi.MessageOf(x)
191 }
192
193
194 func (*RateLimitRequest) Descriptor() ([]byte, []int) {
195 return file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP(), []int{0}
196 }
197
198 func (x *RateLimitRequest) GetDomain() string {
199 if x != nil {
200 return x.Domain
201 }
202 return ""
203 }
204
205 func (x *RateLimitRequest) GetDescriptors() []*ratelimit.RateLimitDescriptor {
206 if x != nil {
207 return x.Descriptors
208 }
209 return nil
210 }
211
212 func (x *RateLimitRequest) GetHitsAddend() uint32 {
213 if x != nil {
214 return x.HitsAddend
215 }
216 return 0
217 }
218
219
220 type RateLimitResponse struct {
221 state protoimpl.MessageState
222 sizeCache protoimpl.SizeCache
223 unknownFields protoimpl.UnknownFields
224
225
226
227 OverallCode RateLimitResponse_Code `protobuf:"varint,1,opt,name=overall_code,json=overallCode,proto3,enum=envoy.service.ratelimit.v2.RateLimitResponse_Code" json:"overall_code,omitempty"`
228
229
230
231 Statuses []*RateLimitResponse_DescriptorStatus `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"`
232
233 Headers []*core.HeaderValue `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"`
234
235 RequestHeadersToAdd []*core.HeaderValue `protobuf:"bytes,4,rep,name=request_headers_to_add,json=requestHeadersToAdd,proto3" json:"request_headers_to_add,omitempty"`
236 }
237
238 func (x *RateLimitResponse) Reset() {
239 *x = RateLimitResponse{}
240 if protoimpl.UnsafeEnabled {
241 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[1]
242 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
243 ms.StoreMessageInfo(mi)
244 }
245 }
246
247 func (x *RateLimitResponse) String() string {
248 return protoimpl.X.MessageStringOf(x)
249 }
250
251 func (*RateLimitResponse) ProtoMessage() {}
252
253 func (x *RateLimitResponse) ProtoReflect() protoreflect.Message {
254 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[1]
255 if protoimpl.UnsafeEnabled && x != nil {
256 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
257 if ms.LoadMessageInfo() == nil {
258 ms.StoreMessageInfo(mi)
259 }
260 return ms
261 }
262 return mi.MessageOf(x)
263 }
264
265
266 func (*RateLimitResponse) Descriptor() ([]byte, []int) {
267 return file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP(), []int{1}
268 }
269
270 func (x *RateLimitResponse) GetOverallCode() RateLimitResponse_Code {
271 if x != nil {
272 return x.OverallCode
273 }
274 return RateLimitResponse_UNKNOWN
275 }
276
277 func (x *RateLimitResponse) GetStatuses() []*RateLimitResponse_DescriptorStatus {
278 if x != nil {
279 return x.Statuses
280 }
281 return nil
282 }
283
284 func (x *RateLimitResponse) GetHeaders() []*core.HeaderValue {
285 if x != nil {
286 return x.Headers
287 }
288 return nil
289 }
290
291 func (x *RateLimitResponse) GetRequestHeadersToAdd() []*core.HeaderValue {
292 if x != nil {
293 return x.RequestHeadersToAdd
294 }
295 return nil
296 }
297
298
299 type RateLimitResponse_RateLimit struct {
300 state protoimpl.MessageState
301 sizeCache protoimpl.SizeCache
302 unknownFields protoimpl.UnknownFields
303
304
305 Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
306
307 RequestsPerUnit uint32 `protobuf:"varint,1,opt,name=requests_per_unit,json=requestsPerUnit,proto3" json:"requests_per_unit,omitempty"`
308
309 Unit RateLimitResponse_RateLimit_Unit `protobuf:"varint,2,opt,name=unit,proto3,enum=envoy.service.ratelimit.v2.RateLimitResponse_RateLimit_Unit" json:"unit,omitempty"`
310 }
311
312 func (x *RateLimitResponse_RateLimit) Reset() {
313 *x = RateLimitResponse_RateLimit{}
314 if protoimpl.UnsafeEnabled {
315 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[2]
316 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
317 ms.StoreMessageInfo(mi)
318 }
319 }
320
321 func (x *RateLimitResponse_RateLimit) String() string {
322 return protoimpl.X.MessageStringOf(x)
323 }
324
325 func (*RateLimitResponse_RateLimit) ProtoMessage() {}
326
327 func (x *RateLimitResponse_RateLimit) ProtoReflect() protoreflect.Message {
328 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[2]
329 if protoimpl.UnsafeEnabled && x != nil {
330 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
331 if ms.LoadMessageInfo() == nil {
332 ms.StoreMessageInfo(mi)
333 }
334 return ms
335 }
336 return mi.MessageOf(x)
337 }
338
339
340 func (*RateLimitResponse_RateLimit) Descriptor() ([]byte, []int) {
341 return file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP(), []int{1, 0}
342 }
343
344 func (x *RateLimitResponse_RateLimit) GetName() string {
345 if x != nil {
346 return x.Name
347 }
348 return ""
349 }
350
351 func (x *RateLimitResponse_RateLimit) GetRequestsPerUnit() uint32 {
352 if x != nil {
353 return x.RequestsPerUnit
354 }
355 return 0
356 }
357
358 func (x *RateLimitResponse_RateLimit) GetUnit() RateLimitResponse_RateLimit_Unit {
359 if x != nil {
360 return x.Unit
361 }
362 return RateLimitResponse_RateLimit_UNKNOWN
363 }
364
365 type RateLimitResponse_DescriptorStatus struct {
366 state protoimpl.MessageState
367 sizeCache protoimpl.SizeCache
368 unknownFields protoimpl.UnknownFields
369
370
371 Code RateLimitResponse_Code `protobuf:"varint,1,opt,name=code,proto3,enum=envoy.service.ratelimit.v2.RateLimitResponse_Code" json:"code,omitempty"`
372
373 CurrentLimit *RateLimitResponse_RateLimit `protobuf:"bytes,2,opt,name=current_limit,json=currentLimit,proto3" json:"current_limit,omitempty"`
374
375 LimitRemaining uint32 `protobuf:"varint,3,opt,name=limit_remaining,json=limitRemaining,proto3" json:"limit_remaining,omitempty"`
376 }
377
378 func (x *RateLimitResponse_DescriptorStatus) Reset() {
379 *x = RateLimitResponse_DescriptorStatus{}
380 if protoimpl.UnsafeEnabled {
381 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[3]
382 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
383 ms.StoreMessageInfo(mi)
384 }
385 }
386
387 func (x *RateLimitResponse_DescriptorStatus) String() string {
388 return protoimpl.X.MessageStringOf(x)
389 }
390
391 func (*RateLimitResponse_DescriptorStatus) ProtoMessage() {}
392
393 func (x *RateLimitResponse_DescriptorStatus) ProtoReflect() protoreflect.Message {
394 mi := &file_envoy_service_ratelimit_v2_rls_proto_msgTypes[3]
395 if protoimpl.UnsafeEnabled && x != nil {
396 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
397 if ms.LoadMessageInfo() == nil {
398 ms.StoreMessageInfo(mi)
399 }
400 return ms
401 }
402 return mi.MessageOf(x)
403 }
404
405
406 func (*RateLimitResponse_DescriptorStatus) Descriptor() ([]byte, []int) {
407 return file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP(), []int{1, 1}
408 }
409
410 func (x *RateLimitResponse_DescriptorStatus) GetCode() RateLimitResponse_Code {
411 if x != nil {
412 return x.Code
413 }
414 return RateLimitResponse_UNKNOWN
415 }
416
417 func (x *RateLimitResponse_DescriptorStatus) GetCurrentLimit() *RateLimitResponse_RateLimit {
418 if x != nil {
419 return x.CurrentLimit
420 }
421 return nil
422 }
423
424 func (x *RateLimitResponse_DescriptorStatus) GetLimitRemaining() uint32 {
425 if x != nil {
426 return x.LimitRemaining
427 }
428 return 0
429 }
430
431 var File_envoy_service_ratelimit_v2_rls_proto protoreflect.FileDescriptor
432
433 var file_envoy_service_ratelimit_v2_rls_proto_rawDesc = []byte{
434 0x0a, 0x24, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f,
435 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x6c, 0x73,
436 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65,
437 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e,
438 0x76, 0x32, 0x1a, 0x1c, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32,
439 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
440 0x1a, 0x26, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72,
441 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d,
442 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61,
443 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61,
444 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61,
445 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75,
446 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65,
447 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06,
448 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f,
449 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x4d, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
450 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x6e, 0x76, 0x6f,
451 0x79, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d,
452 0x69, 0x74, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x73, 0x63,
453 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
454 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x69, 0x74, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x65,
455 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x68, 0x69, 0x74, 0x73, 0x41, 0x64,
456 0x64, 0x65, 0x6e, 0x64, 0x22, 0xe7, 0x06, 0x0a, 0x11, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d,
457 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0c, 0x6f, 0x76,
458 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
459 0x32, 0x32, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
460 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61,
461 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e,
462 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0b, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x64,
463 0x65, 0x12, 0x5a, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20,
464 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76,
465 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32,
466 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
467 0x73, 0x65, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61,
468 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x59, 0x0a,
469 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e,
470 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f,
471 0x72, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1f,
472 0xf2, 0x98, 0xfe, 0x8f, 0x05, 0x19, 0x0a, 0x17, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
473 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x52,
474 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x53, 0x0a, 0x16, 0x72, 0x65, 0x71, 0x75,
475 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61,
476 0x64, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79,
477 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x48, 0x65, 0x61,
478 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
479 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x1a, 0xdd, 0x01,
480 0x0a, 0x09, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
481 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
482 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f,
483 0x75, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75,
484 0x65, 0x73, 0x74, 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x50, 0x0a, 0x04, 0x75,
485 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3c, 0x2e, 0x65, 0x6e, 0x76, 0x6f,
486 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69,
487 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74,
488 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d,
489 0x69, 0x74, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x22, 0x3e, 0x0a,
490 0x04, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e,
491 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a,
492 0x0a, 0x06, 0x4d, 0x49, 0x4e, 0x55, 0x54, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f,
493 0x55, 0x52, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x41, 0x59, 0x10, 0x04, 0x1a, 0xe1, 0x01,
494 0x0a, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74,
495 0x75, 0x73, 0x12, 0x46, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
496 0x32, 0x32, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
497 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61,
498 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e,
499 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x5c, 0x0a, 0x0d, 0x63, 0x75,
500 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
501 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
502 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x52,
503 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
504 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72,
505 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6c, 0x69, 0x6d, 0x69,
506 0x74, 0x5f, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28,
507 0x0d, 0x52, 0x0e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e,
508 0x67, 0x22, 0x2b, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b,
509 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x0e,
510 0x0a, 0x0a, 0x4f, 0x56, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x32, 0x84,
511 0x01, 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76,
512 0x69, 0x63, 0x65, 0x12, 0x70, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x52, 0x61, 0x74,
513 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73,
514 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74,
515 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71,
516 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72,
517 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76,
518 0x32, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
519 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x90, 0x01, 0x0a, 0x28, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76,
520 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65,
521 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e,
522 0x76, 0x32, 0x42, 0x08, 0x52, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d,
523 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79,
524 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
525 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72,
526 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76,
527 0x32, 0x3b, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x76, 0x32, 0x88, 0x01, 0x01,
528 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
529 }
530
531 var (
532 file_envoy_service_ratelimit_v2_rls_proto_rawDescOnce sync.Once
533 file_envoy_service_ratelimit_v2_rls_proto_rawDescData = file_envoy_service_ratelimit_v2_rls_proto_rawDesc
534 )
535
536 func file_envoy_service_ratelimit_v2_rls_proto_rawDescGZIP() []byte {
537 file_envoy_service_ratelimit_v2_rls_proto_rawDescOnce.Do(func() {
538 file_envoy_service_ratelimit_v2_rls_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_service_ratelimit_v2_rls_proto_rawDescData)
539 })
540 return file_envoy_service_ratelimit_v2_rls_proto_rawDescData
541 }
542
543 var file_envoy_service_ratelimit_v2_rls_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
544 var file_envoy_service_ratelimit_v2_rls_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
545 var file_envoy_service_ratelimit_v2_rls_proto_goTypes = []interface{}{
546 (RateLimitResponse_Code)(0),
547 (RateLimitResponse_RateLimit_Unit)(0),
548 (*RateLimitRequest)(nil),
549 (*RateLimitResponse)(nil),
550 (*RateLimitResponse_RateLimit)(nil),
551 (*RateLimitResponse_DescriptorStatus)(nil),
552 (*ratelimit.RateLimitDescriptor)(nil),
553 (*core.HeaderValue)(nil),
554 }
555 var file_envoy_service_ratelimit_v2_rls_proto_depIdxs = []int32{
556 6,
557 0,
558 5,
559 7,
560 7,
561 1,
562 0,
563 4,
564 2,
565 3,
566 9,
567 8,
568 8,
569 8,
570 0,
571 }
572
573 func init() { file_envoy_service_ratelimit_v2_rls_proto_init() }
574 func file_envoy_service_ratelimit_v2_rls_proto_init() {
575 if File_envoy_service_ratelimit_v2_rls_proto != nil {
576 return
577 }
578 if !protoimpl.UnsafeEnabled {
579 file_envoy_service_ratelimit_v2_rls_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
580 switch v := v.(*RateLimitRequest); i {
581 case 0:
582 return &v.state
583 case 1:
584 return &v.sizeCache
585 case 2:
586 return &v.unknownFields
587 default:
588 return nil
589 }
590 }
591 file_envoy_service_ratelimit_v2_rls_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
592 switch v := v.(*RateLimitResponse); i {
593 case 0:
594 return &v.state
595 case 1:
596 return &v.sizeCache
597 case 2:
598 return &v.unknownFields
599 default:
600 return nil
601 }
602 }
603 file_envoy_service_ratelimit_v2_rls_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
604 switch v := v.(*RateLimitResponse_RateLimit); i {
605 case 0:
606 return &v.state
607 case 1:
608 return &v.sizeCache
609 case 2:
610 return &v.unknownFields
611 default:
612 return nil
613 }
614 }
615 file_envoy_service_ratelimit_v2_rls_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
616 switch v := v.(*RateLimitResponse_DescriptorStatus); i {
617 case 0:
618 return &v.state
619 case 1:
620 return &v.sizeCache
621 case 2:
622 return &v.unknownFields
623 default:
624 return nil
625 }
626 }
627 }
628 type x struct{}
629 out := protoimpl.TypeBuilder{
630 File: protoimpl.DescBuilder{
631 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
632 RawDescriptor: file_envoy_service_ratelimit_v2_rls_proto_rawDesc,
633 NumEnums: 2,
634 NumMessages: 4,
635 NumExtensions: 0,
636 NumServices: 1,
637 },
638 GoTypes: file_envoy_service_ratelimit_v2_rls_proto_goTypes,
639 DependencyIndexes: file_envoy_service_ratelimit_v2_rls_proto_depIdxs,
640 EnumInfos: file_envoy_service_ratelimit_v2_rls_proto_enumTypes,
641 MessageInfos: file_envoy_service_ratelimit_v2_rls_proto_msgTypes,
642 }.Build()
643 File_envoy_service_ratelimit_v2_rls_proto = out.File
644 file_envoy_service_ratelimit_v2_rls_proto_rawDesc = nil
645 file_envoy_service_ratelimit_v2_rls_proto_goTypes = nil
646 file_envoy_service_ratelimit_v2_rls_proto_depIdxs = nil
647 }
648
649
650 var _ context.Context
651 var _ grpc.ClientConnInterface
652
653
654
655 const _ = grpc.SupportPackageIsVersion6
656
657
658
659
660 type RateLimitServiceClient interface {
661
662 ShouldRateLimit(ctx context.Context, in *RateLimitRequest, opts ...grpc.CallOption) (*RateLimitResponse, error)
663 }
664
665 type rateLimitServiceClient struct {
666 cc grpc.ClientConnInterface
667 }
668
669 func NewRateLimitServiceClient(cc grpc.ClientConnInterface) RateLimitServiceClient {
670 return &rateLimitServiceClient{cc}
671 }
672
673 func (c *rateLimitServiceClient) ShouldRateLimit(ctx context.Context, in *RateLimitRequest, opts ...grpc.CallOption) (*RateLimitResponse, error) {
674 out := new(RateLimitResponse)
675 err := c.cc.Invoke(ctx, "/envoy.service.ratelimit.v2.RateLimitService/ShouldRateLimit", in, out, opts...)
676 if err != nil {
677 return nil, err
678 }
679 return out, nil
680 }
681
682
683 type RateLimitServiceServer interface {
684
685 ShouldRateLimit(context.Context, *RateLimitRequest) (*RateLimitResponse, error)
686 }
687
688
689 type UnimplementedRateLimitServiceServer struct {
690 }
691
692 func (*UnimplementedRateLimitServiceServer) ShouldRateLimit(context.Context, *RateLimitRequest) (*RateLimitResponse, error) {
693 return nil, status.Errorf(codes.Unimplemented, "method ShouldRateLimit not implemented")
694 }
695
696 func RegisterRateLimitServiceServer(s *grpc.Server, srv RateLimitServiceServer) {
697 s.RegisterService(&_RateLimitService_serviceDesc, srv)
698 }
699
700 func _RateLimitService_ShouldRateLimit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
701 in := new(RateLimitRequest)
702 if err := dec(in); err != nil {
703 return nil, err
704 }
705 if interceptor == nil {
706 return srv.(RateLimitServiceServer).ShouldRateLimit(ctx, in)
707 }
708 info := &grpc.UnaryServerInfo{
709 Server: srv,
710 FullMethod: "/envoy.service.ratelimit.v2.RateLimitService/ShouldRateLimit",
711 }
712 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
713 return srv.(RateLimitServiceServer).ShouldRateLimit(ctx, req.(*RateLimitRequest))
714 }
715 return interceptor(ctx, in, info, handler)
716 }
717
718 var _RateLimitService_serviceDesc = grpc.ServiceDesc{
719 ServiceName: "envoy.service.ratelimit.v2.RateLimitService",
720 HandlerType: (*RateLimitServiceServer)(nil),
721 Methods: []grpc.MethodDesc{
722 {
723 MethodName: "ShouldRateLimit",
724 Handler: _RateLimitService_ShouldRateLimit_Handler,
725 },
726 },
727 Streams: []grpc.StreamDesc{},
728 Metadata: "envoy/service/ratelimit/v2/rls.proto",
729 }
730
View as plain text