Debian Codegraph @

envoy/service/ratelimit/v3/rls_vtproto.pb.go

raw
1 //go:build vtprotobuf
2 // +build vtprotobuf
3
4 // Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
5 // source: envoy/service/ratelimit/v3/rls.proto
6
7 package ratelimitv3
8
9 import (
10 protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
11 durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb"
12 structpb "github.com/planetscale/vtprotobuf/types/known/structpb"
13 timestamppb "github.com/planetscale/vtprotobuf/types/known/timestamppb"
14 proto "google.golang.org/protobuf/proto"
15 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
16 )
17
18 const (
19 // Verify that this generated code is sufficiently up-to-date.
20 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
21 // Verify that runtime/protoimpl is sufficiently up-to-date.
22 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
23 )
24
25 func (m *RateLimitRequest) MarshalVTStrict() (dAtA []byte, err error) {
26 if m == nil {
27 return nil, nil
28 }
29 size := m.SizeVT()
30 dAtA = make([]byte, size)
31 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
32 if err != nil {
33 return nil, err
34 }
35 return dAtA[:n], nil
36 }
37
38 func (m *RateLimitRequest) MarshalToVTStrict(dAtA []byte) (int, error) {
39 size := m.SizeVT()
40 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
41 }
42
43 func (m *RateLimitRequest) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
44 if m == nil {
45 return 0, nil
46 }
47 i := len(dAtA)
48 _ = i
49 var l int
50 _ = l
51 if m.unknownFields != nil {
52 i -= len(m.unknownFields)
53 copy(dAtA[i:], m.unknownFields)
54 }
55 if m.HitsAddend != 0 {
56 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HitsAddend))
57 i--
58 dAtA[i] = 0x18
59 }
60 if len(m.Descriptors) > 0 {
61 for iNdEx := len(m.Descriptors) - 1; iNdEx >= 0; iNdEx-- {
62 if vtmsg, ok := interface{}(m.Descriptors[iNdEx]).(interface {
63 MarshalToSizedBufferVTStrict([]byte) (int, error)
64 }); ok {
65 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
66 if err != nil {
67 return 0, err
68 }
69 i -= size
70 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
71 } else {
72 encoded, err := proto.Marshal(m.Descriptors[iNdEx])
73 if err != nil {
74 return 0, err
75 }
76 i -= len(encoded)
77 copy(dAtA[i:], encoded)
78 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
79 }
80 i--
81 dAtA[i] = 0x12
82 }
83 }
84 if len(m.Domain) > 0 {
85 i -= len(m.Domain)
86 copy(dAtA[i:], m.Domain)
87 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Domain)))
88 i--
89 dAtA[i] = 0xa
90 }
91 return len(dAtA) - i, nil
92 }
93
94 func (m *RateLimitResponse_RateLimit) MarshalVTStrict() (dAtA []byte, err error) {
95 if m == nil {
96 return nil, nil
97 }
98 size := m.SizeVT()
99 dAtA = make([]byte, size)
100 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
101 if err != nil {
102 return nil, err
103 }
104 return dAtA[:n], nil
105 }
106
107 func (m *RateLimitResponse_RateLimit) MarshalToVTStrict(dAtA []byte) (int, error) {
108 size := m.SizeVT()
109 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
110 }
111
112 func (m *RateLimitResponse_RateLimit) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
113 if m == nil {
114 return 0, nil
115 }
116 i := len(dAtA)
117 _ = i
118 var l int
119 _ = l
120 if m.unknownFields != nil {
121 i -= len(m.unknownFields)
122 copy(dAtA[i:], m.unknownFields)
123 }
124 if len(m.Name) > 0 {
125 i -= len(m.Name)
126 copy(dAtA[i:], m.Name)
127 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name)))
128 i--
129 dAtA[i] = 0x1a
130 }
131 if m.Unit != 0 {
132 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Unit))
133 i--
134 dAtA[i] = 0x10
135 }
136 if m.RequestsPerUnit != 0 {
137 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestsPerUnit))
138 i--
139 dAtA[i] = 0x8
140 }
141 return len(dAtA) - i, nil
142 }
143
144 func (m *RateLimitResponse_Quota) MarshalVTStrict() (dAtA []byte, err error) {
145 if m == nil {
146 return nil, nil
147 }
148 size := m.SizeVT()
149 dAtA = make([]byte, size)
150 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
151 if err != nil {
152 return nil, err
153 }
154 return dAtA[:n], nil
155 }
156
157 func (m *RateLimitResponse_Quota) MarshalToVTStrict(dAtA []byte) (int, error) {
158 size := m.SizeVT()
159 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
160 }
161
162 func (m *RateLimitResponse_Quota) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
163 if m == nil {
164 return 0, nil
165 }
166 i := len(dAtA)
167 _ = i
168 var l int
169 _ = l
170 if m.unknownFields != nil {
171 i -= len(m.unknownFields)
172 copy(dAtA[i:], m.unknownFields)
173 }
174 if len(m.Id) > 0 {
175 i -= len(m.Id)
176 copy(dAtA[i:], m.Id)
177 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id)))
178 i--
179 dAtA[i] = 0x1a
180 }
181 if msg, ok := m.ExpirationSpecifier.(*RateLimitResponse_Quota_ValidUntil); ok {
182 size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i])
183 if err != nil {
184 return 0, err
185 }
186 i -= size
187 }
188 if m.Requests != 0 {
189 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Requests))
190 i--
191 dAtA[i] = 0x8
192 }
193 return len(dAtA) - i, nil
194 }
195
196 func (m *RateLimitResponse_Quota_ValidUntil) MarshalToVTStrict(dAtA []byte) (int, error) {
197 size := m.SizeVT()
198 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
199 }
200
201 func (m *RateLimitResponse_Quota_ValidUntil) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
202 i := len(dAtA)
203 if m.ValidUntil != nil {
204 size, err := (*timestamppb.Timestamp)(m.ValidUntil).MarshalToSizedBufferVTStrict(dAtA[:i])
205 if err != nil {
206 return 0, err
207 }
208 i -= size
209 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
210 i--
211 dAtA[i] = 0x12
212 } else {
213 i = protohelpers.EncodeVarint(dAtA, i, 0)
214 i--
215 dAtA[i] = 0x12
216 }
217 return len(dAtA) - i, nil
218 }
219 func (m *RateLimitResponse_DescriptorStatus) MarshalVTStrict() (dAtA []byte, err error) {
220 if m == nil {
221 return nil, nil
222 }
223 size := m.SizeVT()
224 dAtA = make([]byte, size)
225 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
226 if err != nil {
227 return nil, err
228 }
229 return dAtA[:n], nil
230 }
231
232 func (m *RateLimitResponse_DescriptorStatus) MarshalToVTStrict(dAtA []byte) (int, error) {
233 size := m.SizeVT()
234 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
235 }
236
237 func (m *RateLimitResponse_DescriptorStatus) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
238 if m == nil {
239 return 0, nil
240 }
241 i := len(dAtA)
242 _ = i
243 var l int
244 _ = l
245 if m.unknownFields != nil {
246 i -= len(m.unknownFields)
247 copy(dAtA[i:], m.unknownFields)
248 }
249 if m.Quota != nil {
250 size, err := m.Quota.MarshalToSizedBufferVTStrict(dAtA[:i])
251 if err != nil {
252 return 0, err
253 }
254 i -= size
255 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
256 i--
257 dAtA[i] = 0x2a
258 }
259 if m.DurationUntilReset != nil {
260 size, err := (*durationpb.Duration)(m.DurationUntilReset).MarshalToSizedBufferVTStrict(dAtA[:i])
261 if err != nil {
262 return 0, err
263 }
264 i -= size
265 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
266 i--
267 dAtA[i] = 0x22
268 }
269 if m.LimitRemaining != 0 {
270 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LimitRemaining))
271 i--
272 dAtA[i] = 0x18
273 }
274 if m.CurrentLimit != nil {
275 size, err := m.CurrentLimit.MarshalToSizedBufferVTStrict(dAtA[:i])
276 if err != nil {
277 return 0, err
278 }
279 i -= size
280 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
281 i--
282 dAtA[i] = 0x12
283 }
284 if m.Code != 0 {
285 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code))
286 i--
287 dAtA[i] = 0x8
288 }
289 return len(dAtA) - i, nil
290 }
291
292 func (m *RateLimitResponse) MarshalVTStrict() (dAtA []byte, err error) {
293 if m == nil {
294 return nil, nil
295 }
296 size := m.SizeVT()
297 dAtA = make([]byte, size)
298 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
299 if err != nil {
300 return nil, err
301 }
302 return dAtA[:n], nil
303 }
304
305 func (m *RateLimitResponse) MarshalToVTStrict(dAtA []byte) (int, error) {
306 size := m.SizeVT()
307 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
308 }
309
310 func (m *RateLimitResponse) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
311 if m == nil {
312 return 0, nil
313 }
314 i := len(dAtA)
315 _ = i
316 var l int
317 _ = l
318 if m.unknownFields != nil {
319 i -= len(m.unknownFields)
320 copy(dAtA[i:], m.unknownFields)
321 }
322 if m.Quota != nil {
323 size, err := m.Quota.MarshalToSizedBufferVTStrict(dAtA[:i])
324 if err != nil {
325 return 0, err
326 }
327 i -= size
328 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
329 i--
330 dAtA[i] = 0x3a
331 }
332 if m.DynamicMetadata != nil {
333 size, err := (*structpb.Struct)(m.DynamicMetadata).MarshalToSizedBufferVTStrict(dAtA[:i])
334 if err != nil {
335 return 0, err
336 }
337 i -= size
338 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
339 i--
340 dAtA[i] = 0x32
341 }
342 if len(m.RawBody) > 0 {
343 i -= len(m.RawBody)
344 copy(dAtA[i:], m.RawBody)
345 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawBody)))
346 i--
347 dAtA[i] = 0x2a
348 }
349 if len(m.RequestHeadersToAdd) > 0 {
350 for iNdEx := len(m.RequestHeadersToAdd) - 1; iNdEx >= 0; iNdEx-- {
351 if vtmsg, ok := interface{}(m.RequestHeadersToAdd[iNdEx]).(interface {
352 MarshalToSizedBufferVTStrict([]byte) (int, error)
353 }); ok {
354 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
355 if err != nil {
356 return 0, err
357 }
358 i -= size
359 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
360 } else {
361 encoded, err := proto.Marshal(m.RequestHeadersToAdd[iNdEx])
362 if err != nil {
363 return 0, err
364 }
365 i -= len(encoded)
366 copy(dAtA[i:], encoded)
367 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
368 }
369 i--
370 dAtA[i] = 0x22
371 }
372 }
373 if len(m.ResponseHeadersToAdd) > 0 {
374 for iNdEx := len(m.ResponseHeadersToAdd) - 1; iNdEx >= 0; iNdEx-- {
375 if vtmsg, ok := interface{}(m.ResponseHeadersToAdd[iNdEx]).(interface {
376 MarshalToSizedBufferVTStrict([]byte) (int, error)
377 }); ok {
378 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
379 if err != nil {
380 return 0, err
381 }
382 i -= size
383 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
384 } else {
385 encoded, err := proto.Marshal(m.ResponseHeadersToAdd[iNdEx])
386 if err != nil {
387 return 0, err
388 }
389 i -= len(encoded)
390 copy(dAtA[i:], encoded)
391 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
392 }
393 i--
394 dAtA[i] = 0x1a
395 }
396 }
397 if len(m.Statuses) > 0 {
398 for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- {
399 size, err := m.Statuses[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i])
400 if err != nil {
401 return 0, err
402 }
403 i -= size
404 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
405 i--
406 dAtA[i] = 0x12
407 }
408 }
409 if m.OverallCode != 0 {
410 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OverallCode))
411 i--
412 dAtA[i] = 0x8
413 }
414 return len(dAtA) - i, nil
415 }
416
417 func (m *RateLimitRequest) SizeVT() (n int) {
418 if m == nil {
419 return 0
420 }
421 var l int
422 _ = l
423 l = len(m.Domain)
424 if l > 0 {
425 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
426 }
427 if len(m.Descriptors) > 0 {
428 for _, e := range m.Descriptors {
429 if size, ok := interface{}(e).(interface {
430 SizeVT() int
431 }); ok {
432 l = size.SizeVT()
433 } else {
434 l = proto.Size(e)
435 }
436 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
437 }
438 }
439 if m.HitsAddend != 0 {
440 n += 1 + protohelpers.SizeOfVarint(uint64(m.HitsAddend))
441 }
442 n += len(m.unknownFields)
443 return n
444 }
445
446 func (m *RateLimitResponse_RateLimit) SizeVT() (n int) {
447 if m == nil {
448 return 0
449 }
450 var l int
451 _ = l
452 if m.RequestsPerUnit != 0 {
453 n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestsPerUnit))
454 }
455 if m.Unit != 0 {
456 n += 1 + protohelpers.SizeOfVarint(uint64(m.Unit))
457 }
458 l = len(m.Name)
459 if l > 0 {
460 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
461 }
462 n += len(m.unknownFields)
463 return n
464 }
465
466 func (m *RateLimitResponse_Quota) SizeVT() (n int) {
467 if m == nil {
468 return 0
469 }
470 var l int
471 _ = l
472 if m.Requests != 0 {
473 n += 1 + protohelpers.SizeOfVarint(uint64(m.Requests))
474 }
475 if vtmsg, ok := m.ExpirationSpecifier.(interface{ SizeVT() int }); ok {
476 n += vtmsg.SizeVT()
477 }
478 l = len(m.Id)
479 if l > 0 {
480 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
481 }
482 n += len(m.unknownFields)
483 return n
484 }
485
486 func (m *RateLimitResponse_Quota_ValidUntil) SizeVT() (n int) {
487 if m == nil {
488 return 0
489 }
490 var l int
491 _ = l
492 if m.ValidUntil != nil {
493 l = (*timestamppb.Timestamp)(m.ValidUntil).SizeVT()
494 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
495 } else {
496 n += 2
497 }
498 return n
499 }
500 func (m *RateLimitResponse_DescriptorStatus) SizeVT() (n int) {
501 if m == nil {
502 return 0
503 }
504 var l int
505 _ = l
506 if m.Code != 0 {
507 n += 1 + protohelpers.SizeOfVarint(uint64(m.Code))
508 }
509 if m.CurrentLimit != nil {
510 l = m.CurrentLimit.SizeVT()
511 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
512 }
513 if m.LimitRemaining != 0 {
514 n += 1 + protohelpers.SizeOfVarint(uint64(m.LimitRemaining))
515 }
516 if m.DurationUntilReset != nil {
517 l = (*durationpb.Duration)(m.DurationUntilReset).SizeVT()
518 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
519 }
520 if m.Quota != nil {
521 l = m.Quota.SizeVT()
522 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
523 }
524 n += len(m.unknownFields)
525 return n
526 }
527
528 func (m *RateLimitResponse) SizeVT() (n int) {
529 if m == nil {
530 return 0
531 }
532 var l int
533 _ = l
534 if m.OverallCode != 0 {
535 n += 1 + protohelpers.SizeOfVarint(uint64(m.OverallCode))
536 }
537 if len(m.Statuses) > 0 {
538 for _, e := range m.Statuses {
539 l = e.SizeVT()
540 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
541 }
542 }
543 if len(m.ResponseHeadersToAdd) > 0 {
544 for _, e := range m.ResponseHeadersToAdd {
545 if size, ok := interface{}(e).(interface {
546 SizeVT() int
547 }); ok {
548 l = size.SizeVT()
549 } else {
550 l = proto.Size(e)
551 }
552 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
553 }
554 }
555 if len(m.RequestHeadersToAdd) > 0 {
556 for _, e := range m.RequestHeadersToAdd {
557 if size, ok := interface{}(e).(interface {
558 SizeVT() int
559 }); ok {
560 l = size.SizeVT()
561 } else {
562 l = proto.Size(e)
563 }
564 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
565 }
566 }
567 l = len(m.RawBody)
568 if l > 0 {
569 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
570 }
571 if m.DynamicMetadata != nil {
572 l = (*structpb.Struct)(m.DynamicMetadata).SizeVT()
573 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
574 }
575 if m.Quota != nil {
576 l = m.Quota.SizeVT()
577 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
578 }
579 n += len(m.unknownFields)
580 return n
581 }