1
2
3
4 package envoy_service_discovery_v3
5
6 import (
7 "bytes"
8 "errors"
9 "fmt"
10 "net"
11 "net/mail"
12 "net/url"
13 "regexp"
14 "strings"
15 "time"
16 "unicode/utf8"
17
18 "github.com/golang/protobuf/ptypes"
19 )
20
21
22 var (
23 _ = bytes.MinRead
24 _ = errors.New("")
25 _ = fmt.Print
26 _ = utf8.UTFMax
27 _ = (*regexp.Regexp)(nil)
28 _ = (*strings.Reader)(nil)
29 _ = net.IPv4len
30 _ = time.Duration(0)
31 _ = (*url.URL)(nil)
32 _ = (*mail.Address)(nil)
33 _ = ptypes.DynamicAny{}
34 )
35
36
37
38
39 func (m *DiscoveryRequest) Validate() error {
40 if m == nil {
41 return nil
42 }
43
44
45
46 if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
47 if err := v.Validate(); err != nil {
48 return DiscoveryRequestValidationError{
49 field: "Node",
50 reason: "embedded message failed validation",
51 cause: err,
52 }
53 }
54 }
55
56
57
58
59
60 if v, ok := interface{}(m.GetErrorDetail()).(interface{ Validate() error }); ok {
61 if err := v.Validate(); err != nil {
62 return DiscoveryRequestValidationError{
63 field: "ErrorDetail",
64 reason: "embedded message failed validation",
65 cause: err,
66 }
67 }
68 }
69
70 return nil
71 }
72
73
74
75 type DiscoveryRequestValidationError struct {
76 field string
77 reason string
78 cause error
79 key bool
80 }
81
82
83 func (e DiscoveryRequestValidationError) Field() string { return e.field }
84
85
86 func (e DiscoveryRequestValidationError) Reason() string { return e.reason }
87
88
89 func (e DiscoveryRequestValidationError) Cause() error { return e.cause }
90
91
92 func (e DiscoveryRequestValidationError) Key() bool { return e.key }
93
94
95 func (e DiscoveryRequestValidationError) ErrorName() string { return "DiscoveryRequestValidationError" }
96
97
98 func (e DiscoveryRequestValidationError) Error() string {
99 cause := ""
100 if e.cause != nil {
101 cause = fmt.Sprintf(" | caused by: %v", e.cause)
102 }
103
104 key := ""
105 if e.key {
106 key = "key for "
107 }
108
109 return fmt.Sprintf(
110 "invalid %sDiscoveryRequest.%s: %s%s",
111 key,
112 e.field,
113 e.reason,
114 cause)
115 }
116
117 var _ error = DiscoveryRequestValidationError{}
118
119 var _ interface {
120 Field() string
121 Reason() string
122 Key() bool
123 Cause() error
124 ErrorName() string
125 } = DiscoveryRequestValidationError{}
126
127
128
129
130 func (m *DiscoveryResponse) Validate() error {
131 if m == nil {
132 return nil
133 }
134
135
136
137 for idx, item := range m.GetResources() {
138 _, _ = idx, item
139
140 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
141 if err := v.Validate(); err != nil {
142 return DiscoveryResponseValidationError{
143 field: fmt.Sprintf("Resources[%v]", idx),
144 reason: "embedded message failed validation",
145 cause: err,
146 }
147 }
148 }
149
150 }
151
152
153
154
155
156
157
158 if v, ok := interface{}(m.GetControlPlane()).(interface{ Validate() error }); ok {
159 if err := v.Validate(); err != nil {
160 return DiscoveryResponseValidationError{
161 field: "ControlPlane",
162 reason: "embedded message failed validation",
163 cause: err,
164 }
165 }
166 }
167
168 return nil
169 }
170
171
172
173 type DiscoveryResponseValidationError struct {
174 field string
175 reason string
176 cause error
177 key bool
178 }
179
180
181 func (e DiscoveryResponseValidationError) Field() string { return e.field }
182
183
184 func (e DiscoveryResponseValidationError) Reason() string { return e.reason }
185
186
187 func (e DiscoveryResponseValidationError) Cause() error { return e.cause }
188
189
190 func (e DiscoveryResponseValidationError) Key() bool { return e.key }
191
192
193 func (e DiscoveryResponseValidationError) ErrorName() string {
194 return "DiscoveryResponseValidationError"
195 }
196
197
198 func (e DiscoveryResponseValidationError) Error() string {
199 cause := ""
200 if e.cause != nil {
201 cause = fmt.Sprintf(" | caused by: %v", e.cause)
202 }
203
204 key := ""
205 if e.key {
206 key = "key for "
207 }
208
209 return fmt.Sprintf(
210 "invalid %sDiscoveryResponse.%s: %s%s",
211 key,
212 e.field,
213 e.reason,
214 cause)
215 }
216
217 var _ error = DiscoveryResponseValidationError{}
218
219 var _ interface {
220 Field() string
221 Reason() string
222 Key() bool
223 Cause() error
224 ErrorName() string
225 } = DiscoveryResponseValidationError{}
226
227
228
229
230 func (m *DeltaDiscoveryRequest) Validate() error {
231 if m == nil {
232 return nil
233 }
234
235 if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
236 if err := v.Validate(); err != nil {
237 return DeltaDiscoveryRequestValidationError{
238 field: "Node",
239 reason: "embedded message failed validation",
240 cause: err,
241 }
242 }
243 }
244
245
246
247
248
249
250
251 if v, ok := interface{}(m.GetErrorDetail()).(interface{ Validate() error }); ok {
252 if err := v.Validate(); err != nil {
253 return DeltaDiscoveryRequestValidationError{
254 field: "ErrorDetail",
255 reason: "embedded message failed validation",
256 cause: err,
257 }
258 }
259 }
260
261 return nil
262 }
263
264
265
266 type DeltaDiscoveryRequestValidationError struct {
267 field string
268 reason string
269 cause error
270 key bool
271 }
272
273
274 func (e DeltaDiscoveryRequestValidationError) Field() string { return e.field }
275
276
277 func (e DeltaDiscoveryRequestValidationError) Reason() string { return e.reason }
278
279
280 func (e DeltaDiscoveryRequestValidationError) Cause() error { return e.cause }
281
282
283 func (e DeltaDiscoveryRequestValidationError) Key() bool { return e.key }
284
285
286 func (e DeltaDiscoveryRequestValidationError) ErrorName() string {
287 return "DeltaDiscoveryRequestValidationError"
288 }
289
290
291 func (e DeltaDiscoveryRequestValidationError) Error() string {
292 cause := ""
293 if e.cause != nil {
294 cause = fmt.Sprintf(" | caused by: %v", e.cause)
295 }
296
297 key := ""
298 if e.key {
299 key = "key for "
300 }
301
302 return fmt.Sprintf(
303 "invalid %sDeltaDiscoveryRequest.%s: %s%s",
304 key,
305 e.field,
306 e.reason,
307 cause)
308 }
309
310 var _ error = DeltaDiscoveryRequestValidationError{}
311
312 var _ interface {
313 Field() string
314 Reason() string
315 Key() bool
316 Cause() error
317 ErrorName() string
318 } = DeltaDiscoveryRequestValidationError{}
319
320
321
322
323 func (m *DeltaDiscoveryResponse) Validate() error {
324 if m == nil {
325 return nil
326 }
327
328
329
330 for idx, item := range m.GetResources() {
331 _, _ = idx, item
332
333 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
334 if err := v.Validate(); err != nil {
335 return DeltaDiscoveryResponseValidationError{
336 field: fmt.Sprintf("Resources[%v]", idx),
337 reason: "embedded message failed validation",
338 cause: err,
339 }
340 }
341 }
342
343 }
344
345
346
347
348
349 return nil
350 }
351
352
353
354 type DeltaDiscoveryResponseValidationError struct {
355 field string
356 reason string
357 cause error
358 key bool
359 }
360
361
362 func (e DeltaDiscoveryResponseValidationError) Field() string { return e.field }
363
364
365 func (e DeltaDiscoveryResponseValidationError) Reason() string { return e.reason }
366
367
368 func (e DeltaDiscoveryResponseValidationError) Cause() error { return e.cause }
369
370
371 func (e DeltaDiscoveryResponseValidationError) Key() bool { return e.key }
372
373
374 func (e DeltaDiscoveryResponseValidationError) ErrorName() string {
375 return "DeltaDiscoveryResponseValidationError"
376 }
377
378
379 func (e DeltaDiscoveryResponseValidationError) Error() string {
380 cause := ""
381 if e.cause != nil {
382 cause = fmt.Sprintf(" | caused by: %v", e.cause)
383 }
384
385 key := ""
386 if e.key {
387 key = "key for "
388 }
389
390 return fmt.Sprintf(
391 "invalid %sDeltaDiscoveryResponse.%s: %s%s",
392 key,
393 e.field,
394 e.reason,
395 cause)
396 }
397
398 var _ error = DeltaDiscoveryResponseValidationError{}
399
400 var _ interface {
401 Field() string
402 Reason() string
403 Key() bool
404 Cause() error
405 ErrorName() string
406 } = DeltaDiscoveryResponseValidationError{}
407
408
409
410 func (m *Resource) Validate() error {
411 if m == nil {
412 return nil
413 }
414
415
416
417
418
419 if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
420 if err := v.Validate(); err != nil {
421 return ResourceValidationError{
422 field: "Resource",
423 reason: "embedded message failed validation",
424 cause: err,
425 }
426 }
427 }
428
429 if v, ok := interface{}(m.GetTtl()).(interface{ Validate() error }); ok {
430 if err := v.Validate(); err != nil {
431 return ResourceValidationError{
432 field: "Ttl",
433 reason: "embedded message failed validation",
434 cause: err,
435 }
436 }
437 }
438
439 if v, ok := interface{}(m.GetCacheControl()).(interface{ Validate() error }); ok {
440 if err := v.Validate(); err != nil {
441 return ResourceValidationError{
442 field: "CacheControl",
443 reason: "embedded message failed validation",
444 cause: err,
445 }
446 }
447 }
448
449 return nil
450 }
451
452
453
454 type ResourceValidationError struct {
455 field string
456 reason string
457 cause error
458 key bool
459 }
460
461
462 func (e ResourceValidationError) Field() string { return e.field }
463
464
465 func (e ResourceValidationError) Reason() string { return e.reason }
466
467
468 func (e ResourceValidationError) Cause() error { return e.cause }
469
470
471 func (e ResourceValidationError) Key() bool { return e.key }
472
473
474 func (e ResourceValidationError) ErrorName() string { return "ResourceValidationError" }
475
476
477 func (e ResourceValidationError) Error() string {
478 cause := ""
479 if e.cause != nil {
480 cause = fmt.Sprintf(" | caused by: %v", e.cause)
481 }
482
483 key := ""
484 if e.key {
485 key = "key for "
486 }
487
488 return fmt.Sprintf(
489 "invalid %sResource.%s: %s%s",
490 key,
491 e.field,
492 e.reason,
493 cause)
494 }
495
496 var _ error = ResourceValidationError{}
497
498 var _ interface {
499 Field() string
500 Reason() string
501 Key() bool
502 Cause() error
503 ErrorName() string
504 } = ResourceValidationError{}
505
506
507
508
509 func (m *Resource_CacheControl) Validate() error {
510 if m == nil {
511 return nil
512 }
513
514
515
516 return nil
517 }
518
519
520
521 type Resource_CacheControlValidationError struct {
522 field string
523 reason string
524 cause error
525 key bool
526 }
527
528
529 func (e Resource_CacheControlValidationError) Field() string { return e.field }
530
531
532 func (e Resource_CacheControlValidationError) Reason() string { return e.reason }
533
534
535 func (e Resource_CacheControlValidationError) Cause() error { return e.cause }
536
537
538 func (e Resource_CacheControlValidationError) Key() bool { return e.key }
539
540
541 func (e Resource_CacheControlValidationError) ErrorName() string {
542 return "Resource_CacheControlValidationError"
543 }
544
545
546 func (e Resource_CacheControlValidationError) Error() string {
547 cause := ""
548 if e.cause != nil {
549 cause = fmt.Sprintf(" | caused by: %v", e.cause)
550 }
551
552 key := ""
553 if e.key {
554 key = "key for "
555 }
556
557 return fmt.Sprintf(
558 "invalid %sResource_CacheControl.%s: %s%s",
559 key,
560 e.field,
561 e.reason,
562 cause)
563 }
564
565 var _ error = Resource_CacheControlValidationError{}
566
567 var _ interface {
568 Field() string
569 Reason() string
570 Key() bool
571 Cause() error
572 ErrorName() string
573 } = Resource_CacheControlValidationError{}
574
View as plain text