Debian Codegraph @

envoy/config/bootstrap/v3/bootstrap.pb.validate.go

raw
1 //go:build !disable_pgv
2 // Code generated by protoc-gen-validate. DO NOT EDIT.
3 // source: envoy/config/bootstrap/v3/bootstrap.proto
4
5 package bootstrapv3
6
7 import (
8 "bytes"
9 "errors"
10 "fmt"
11 "net"
12 "net/mail"
13 "net/url"
14 "regexp"
15 "sort"
16 "strings"
17 "time"
18 "unicode/utf8"
19
20 "google.golang.org/protobuf/types/known/anypb"
21 )
22
23 // ensure the imports are used
24 var (
25 _ = bytes.MinRead
26 _ = errors.New("")
27 _ = fmt.Print
28 _ = utf8.UTFMax
29 _ = (*regexp.Regexp)(nil)
30 _ = (*strings.Reader)(nil)
31 _ = net.IPv4len
32 _ = time.Duration(0)
33 _ = (*url.URL)(nil)
34 _ = (*mail.Address)(nil)
35 _ = anypb.Any{}
36 _ = sort.Sort
37 )
38
39 // Validate checks the field values on Bootstrap with the rules defined in the
40 // proto definition for this message. If any rules are violated, the first
41 // error encountered is returned, or nil if there are no violations.
42 func (m *Bootstrap) Validate() error {
43 return m.validate(false)
44 }
45
46 // ValidateAll checks the field values on Bootstrap with the rules defined in
47 // the proto definition for this message. If any rules are violated, the
48 // result is a list of violation errors wrapped in BootstrapMultiError, or nil
49 // if none found.
50 func (m *Bootstrap) ValidateAll() error {
51 return m.validate(true)
52 }
53
54 func (m *Bootstrap) validate(all bool) error {
55 if m == nil {
56 return nil
57 }
58
59 var errors []error
60
61 if all {
62 switch v := interface{}(m.GetNode()).(type) {
63 case interface{ ValidateAll() error }:
64 if err := v.ValidateAll(); err != nil {
65 errors = append(errors, BootstrapValidationError{
66 field: "Node",
67 reason: "embedded message failed validation",
68 cause: err,
69 })
70 }
71 case interface{ Validate() error }:
72 if err := v.Validate(); err != nil {
73 errors = append(errors, BootstrapValidationError{
74 field: "Node",
75 reason: "embedded message failed validation",
76 cause: err,
77 })
78 }
79 }
80 } else if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
81 if err := v.Validate(); err != nil {
82 return BootstrapValidationError{
83 field: "Node",
84 reason: "embedded message failed validation",
85 cause: err,
86 }
87 }
88 }
89
90 if all {
91 switch v := interface{}(m.GetStaticResources()).(type) {
92 case interface{ ValidateAll() error }:
93 if err := v.ValidateAll(); err != nil {
94 errors = append(errors, BootstrapValidationError{
95 field: "StaticResources",
96 reason: "embedded message failed validation",
97 cause: err,
98 })
99 }
100 case interface{ Validate() error }:
101 if err := v.Validate(); err != nil {
102 errors = append(errors, BootstrapValidationError{
103 field: "StaticResources",
104 reason: "embedded message failed validation",
105 cause: err,
106 })
107 }
108 }
109 } else if v, ok := interface{}(m.GetStaticResources()).(interface{ Validate() error }); ok {
110 if err := v.Validate(); err != nil {
111 return BootstrapValidationError{
112 field: "StaticResources",
113 reason: "embedded message failed validation",
114 cause: err,
115 }
116 }
117 }
118
119 if all {
120 switch v := interface{}(m.GetDynamicResources()).(type) {
121 case interface{ ValidateAll() error }:
122 if err := v.ValidateAll(); err != nil {
123 errors = append(errors, BootstrapValidationError{
124 field: "DynamicResources",
125 reason: "embedded message failed validation",
126 cause: err,
127 })
128 }
129 case interface{ Validate() error }:
130 if err := v.Validate(); err != nil {
131 errors = append(errors, BootstrapValidationError{
132 field: "DynamicResources",
133 reason: "embedded message failed validation",
134 cause: err,
135 })
136 }
137 }
138 } else if v, ok := interface{}(m.GetDynamicResources()).(interface{ Validate() error }); ok {
139 if err := v.Validate(); err != nil {
140 return BootstrapValidationError{
141 field: "DynamicResources",
142 reason: "embedded message failed validation",
143 cause: err,
144 }
145 }
146 }
147
148 if all {
149 switch v := interface{}(m.GetClusterManager()).(type) {
150 case interface{ ValidateAll() error }:
151 if err := v.ValidateAll(); err != nil {
152 errors = append(errors, BootstrapValidationError{
153 field: "ClusterManager",
154 reason: "embedded message failed validation",
155 cause: err,
156 })
157 }
158 case interface{ Validate() error }:
159 if err := v.Validate(); err != nil {
160 errors = append(errors, BootstrapValidationError{
161 field: "ClusterManager",
162 reason: "embedded message failed validation",
163 cause: err,
164 })
165 }
166 }
167 } else if v, ok := interface{}(m.GetClusterManager()).(interface{ Validate() error }); ok {
168 if err := v.Validate(); err != nil {
169 return BootstrapValidationError{
170 field: "ClusterManager",
171 reason: "embedded message failed validation",
172 cause: err,
173 }
174 }
175 }
176
177 if all {
178 switch v := interface{}(m.GetHdsConfig()).(type) {
179 case interface{ ValidateAll() error }:
180 if err := v.ValidateAll(); err != nil {
181 errors = append(errors, BootstrapValidationError{
182 field: "HdsConfig",
183 reason: "embedded message failed validation",
184 cause: err,
185 })
186 }
187 case interface{ Validate() error }:
188 if err := v.Validate(); err != nil {
189 errors = append(errors, BootstrapValidationError{
190 field: "HdsConfig",
191 reason: "embedded message failed validation",
192 cause: err,
193 })
194 }
195 }
196 } else if v, ok := interface{}(m.GetHdsConfig()).(interface{ Validate() error }); ok {
197 if err := v.Validate(); err != nil {
198 return BootstrapValidationError{
199 field: "HdsConfig",
200 reason: "embedded message failed validation",
201 cause: err,
202 }
203 }
204 }
205
206 // no validation rules for FlagsPath
207
208 for idx, item := range m.GetStatsSinks() {
209 _, _ = idx, item
210
211 if all {
212 switch v := interface{}(item).(type) {
213 case interface{ ValidateAll() error }:
214 if err := v.ValidateAll(); err != nil {
215 errors = append(errors, BootstrapValidationError{
216 field: fmt.Sprintf("StatsSinks[%v]", idx),
217 reason: "embedded message failed validation",
218 cause: err,
219 })
220 }
221 case interface{ Validate() error }:
222 if err := v.Validate(); err != nil {
223 errors = append(errors, BootstrapValidationError{
224 field: fmt.Sprintf("StatsSinks[%v]", idx),
225 reason: "embedded message failed validation",
226 cause: err,
227 })
228 }
229 }
230 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
231 if err := v.Validate(); err != nil {
232 return BootstrapValidationError{
233 field: fmt.Sprintf("StatsSinks[%v]", idx),
234 reason: "embedded message failed validation",
235 cause: err,
236 }
237 }
238 }
239
240 }
241
242 if all {
243 switch v := interface{}(m.GetDeferredStatOptions()).(type) {
244 case interface{ ValidateAll() error }:
245 if err := v.ValidateAll(); err != nil {
246 errors = append(errors, BootstrapValidationError{
247 field: "DeferredStatOptions",
248 reason: "embedded message failed validation",
249 cause: err,
250 })
251 }
252 case interface{ Validate() error }:
253 if err := v.Validate(); err != nil {
254 errors = append(errors, BootstrapValidationError{
255 field: "DeferredStatOptions",
256 reason: "embedded message failed validation",
257 cause: err,
258 })
259 }
260 }
261 } else if v, ok := interface{}(m.GetDeferredStatOptions()).(interface{ Validate() error }); ok {
262 if err := v.Validate(); err != nil {
263 return BootstrapValidationError{
264 field: "DeferredStatOptions",
265 reason: "embedded message failed validation",
266 cause: err,
267 }
268 }
269 }
270
271 if all {
272 switch v := interface{}(m.GetStatsConfig()).(type) {
273 case interface{ ValidateAll() error }:
274 if err := v.ValidateAll(); err != nil {
275 errors = append(errors, BootstrapValidationError{
276 field: "StatsConfig",
277 reason: "embedded message failed validation",
278 cause: err,
279 })
280 }
281 case interface{ Validate() error }:
282 if err := v.Validate(); err != nil {
283 errors = append(errors, BootstrapValidationError{
284 field: "StatsConfig",
285 reason: "embedded message failed validation",
286 cause: err,
287 })
288 }
289 }
290 } else if v, ok := interface{}(m.GetStatsConfig()).(interface{ Validate() error }); ok {
291 if err := v.Validate(); err != nil {
292 return BootstrapValidationError{
293 field: "StatsConfig",
294 reason: "embedded message failed validation",
295 cause: err,
296 }
297 }
298 }
299
300 if d := m.GetStatsFlushInterval(); d != nil {
301 dur, err := d.AsDuration(), d.CheckValid()
302 if err != nil {
303 err = BootstrapValidationError{
304 field: "StatsFlushInterval",
305 reason: "value is not a valid duration",
306 cause: err,
307 }
308 if !all {
309 return err
310 }
311 errors = append(errors, err)
312 } else {
313
314 lt := time.Duration(300*time.Second + 0*time.Nanosecond)
315 gte := time.Duration(0*time.Second + 1000000*time.Nanosecond)
316
317 if dur < gte || dur >= lt {
318 err := BootstrapValidationError{
319 field: "StatsFlushInterval",
320 reason: "value must be inside range [1ms, 5m0s)",
321 }
322 if !all {
323 return err
324 }
325 errors = append(errors, err)
326 }
327
328 }
329 }
330
331 if all {
332 switch v := interface{}(m.GetWatchdog()).(type) {
333 case interface{ ValidateAll() error }:
334 if err := v.ValidateAll(); err != nil {
335 errors = append(errors, BootstrapValidationError{
336 field: "Watchdog",
337 reason: "embedded message failed validation",
338 cause: err,
339 })
340 }
341 case interface{ Validate() error }:
342 if err := v.Validate(); err != nil {
343 errors = append(errors, BootstrapValidationError{
344 field: "Watchdog",
345 reason: "embedded message failed validation",
346 cause: err,
347 })
348 }
349 }
350 } else if v, ok := interface{}(m.GetWatchdog()).(interface{ Validate() error }); ok {
351 if err := v.Validate(); err != nil {
352 return BootstrapValidationError{
353 field: "Watchdog",
354 reason: "embedded message failed validation",
355 cause: err,
356 }
357 }
358 }
359
360 if all {
361 switch v := interface{}(m.GetWatchdogs()).(type) {
362 case interface{ ValidateAll() error }:
363 if err := v.ValidateAll(); err != nil {
364 errors = append(errors, BootstrapValidationError{
365 field: "Watchdogs",
366 reason: "embedded message failed validation",
367 cause: err,
368 })
369 }
370 case interface{ Validate() error }:
371 if err := v.Validate(); err != nil {
372 errors = append(errors, BootstrapValidationError{
373 field: "Watchdogs",
374 reason: "embedded message failed validation",
375 cause: err,
376 })
377 }
378 }
379 } else if v, ok := interface{}(m.GetWatchdogs()).(interface{ Validate() error }); ok {
380 if err := v.Validate(); err != nil {
381 return BootstrapValidationError{
382 field: "Watchdogs",
383 reason: "embedded message failed validation",
384 cause: err,
385 }
386 }
387 }
388
389 if all {
390 switch v := interface{}(m.GetTracing()).(type) {
391 case interface{ ValidateAll() error }:
392 if err := v.ValidateAll(); err != nil {
393 errors = append(errors, BootstrapValidationError{
394 field: "Tracing",
395 reason: "embedded message failed validation",
396 cause: err,
397 })
398 }
399 case interface{ Validate() error }:
400 if err := v.Validate(); err != nil {
401 errors = append(errors, BootstrapValidationError{
402 field: "Tracing",
403 reason: "embedded message failed validation",
404 cause: err,
405 })
406 }
407 }
408 } else if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
409 if err := v.Validate(); err != nil {
410 return BootstrapValidationError{
411 field: "Tracing",
412 reason: "embedded message failed validation",
413 cause: err,
414 }
415 }
416 }
417
418 if all {
419 switch v := interface{}(m.GetLayeredRuntime()).(type) {
420 case interface{ ValidateAll() error }:
421 if err := v.ValidateAll(); err != nil {
422 errors = append(errors, BootstrapValidationError{
423 field: "LayeredRuntime",
424 reason: "embedded message failed validation",
425 cause: err,
426 })
427 }
428 case interface{ Validate() error }:
429 if err := v.Validate(); err != nil {
430 errors = append(errors, BootstrapValidationError{
431 field: "LayeredRuntime",
432 reason: "embedded message failed validation",
433 cause: err,
434 })
435 }
436 }
437 } else if v, ok := interface{}(m.GetLayeredRuntime()).(interface{ Validate() error }); ok {
438 if err := v.Validate(); err != nil {
439 return BootstrapValidationError{
440 field: "LayeredRuntime",
441 reason: "embedded message failed validation",
442 cause: err,
443 }
444 }
445 }
446
447 if all {
448 switch v := interface{}(m.GetAdmin()).(type) {
449 case interface{ ValidateAll() error }:
450 if err := v.ValidateAll(); err != nil {
451 errors = append(errors, BootstrapValidationError{
452 field: "Admin",
453 reason: "embedded message failed validation",
454 cause: err,
455 })
456 }
457 case interface{ Validate() error }:
458 if err := v.Validate(); err != nil {
459 errors = append(errors, BootstrapValidationError{
460 field: "Admin",
461 reason: "embedded message failed validation",
462 cause: err,
463 })
464 }
465 }
466 } else if v, ok := interface{}(m.GetAdmin()).(interface{ Validate() error }); ok {
467 if err := v.Validate(); err != nil {
468 return BootstrapValidationError{
469 field: "Admin",
470 reason: "embedded message failed validation",
471 cause: err,
472 }
473 }
474 }
475
476 if all {
477 switch v := interface{}(m.GetOverloadManager()).(type) {
478 case interface{ ValidateAll() error }:
479 if err := v.ValidateAll(); err != nil {
480 errors = append(errors, BootstrapValidationError{
481 field: "OverloadManager",
482 reason: "embedded message failed validation",
483 cause: err,
484 })
485 }
486 case interface{ Validate() error }:
487 if err := v.Validate(); err != nil {
488 errors = append(errors, BootstrapValidationError{
489 field: "OverloadManager",
490 reason: "embedded message failed validation",
491 cause: err,
492 })
493 }
494 }
495 } else if v, ok := interface{}(m.GetOverloadManager()).(interface{ Validate() error }); ok {
496 if err := v.Validate(); err != nil {
497 return BootstrapValidationError{
498 field: "OverloadManager",
499 reason: "embedded message failed validation",
500 cause: err,
501 }
502 }
503 }
504
505 // no validation rules for EnableDispatcherStats
506
507 // no validation rules for HeaderPrefix
508
509 if all {
510 switch v := interface{}(m.GetStatsServerVersionOverride()).(type) {
511 case interface{ ValidateAll() error }:
512 if err := v.ValidateAll(); err != nil {
513 errors = append(errors, BootstrapValidationError{
514 field: "StatsServerVersionOverride",
515 reason: "embedded message failed validation",
516 cause: err,
517 })
518 }
519 case interface{ Validate() error }:
520 if err := v.Validate(); err != nil {
521 errors = append(errors, BootstrapValidationError{
522 field: "StatsServerVersionOverride",
523 reason: "embedded message failed validation",
524 cause: err,
525 })
526 }
527 }
528 } else if v, ok := interface{}(m.GetStatsServerVersionOverride()).(interface{ Validate() error }); ok {
529 if err := v.Validate(); err != nil {
530 return BootstrapValidationError{
531 field: "StatsServerVersionOverride",
532 reason: "embedded message failed validation",
533 cause: err,
534 }
535 }
536 }
537
538 // no validation rules for UseTcpForDnsLookups
539
540 if all {
541 switch v := interface{}(m.GetDnsResolutionConfig()).(type) {
542 case interface{ ValidateAll() error }:
543 if err := v.ValidateAll(); err != nil {
544 errors = append(errors, BootstrapValidationError{
545 field: "DnsResolutionConfig",
546 reason: "embedded message failed validation",
547 cause: err,
548 })
549 }
550 case interface{ Validate() error }:
551 if err := v.Validate(); err != nil {
552 errors = append(errors, BootstrapValidationError{
553 field: "DnsResolutionConfig",
554 reason: "embedded message failed validation",
555 cause: err,
556 })
557 }
558 }
559 } else if v, ok := interface{}(m.GetDnsResolutionConfig()).(interface{ Validate() error }); ok {
560 if err := v.Validate(); err != nil {
561 return BootstrapValidationError{
562 field: "DnsResolutionConfig",
563 reason: "embedded message failed validation",
564 cause: err,
565 }
566 }
567 }
568
569 if all {
570 switch v := interface{}(m.GetTypedDnsResolverConfig()).(type) {
571 case interface{ ValidateAll() error }:
572 if err := v.ValidateAll(); err != nil {
573 errors = append(errors, BootstrapValidationError{
574 field: "TypedDnsResolverConfig",
575 reason: "embedded message failed validation",
576 cause: err,
577 })
578 }
579 case interface{ Validate() error }:
580 if err := v.Validate(); err != nil {
581 errors = append(errors, BootstrapValidationError{
582 field: "TypedDnsResolverConfig",
583 reason: "embedded message failed validation",
584 cause: err,
585 })
586 }
587 }
588 } else if v, ok := interface{}(m.GetTypedDnsResolverConfig()).(interface{ Validate() error }); ok {
589 if err := v.Validate(); err != nil {
590 return BootstrapValidationError{
591 field: "TypedDnsResolverConfig",
592 reason: "embedded message failed validation",
593 cause: err,
594 }
595 }
596 }
597
598 for idx, item := range m.GetBootstrapExtensions() {
599 _, _ = idx, item
600
601 if all {
602 switch v := interface{}(item).(type) {
603 case interface{ ValidateAll() error }:
604 if err := v.ValidateAll(); err != nil {
605 errors = append(errors, BootstrapValidationError{
606 field: fmt.Sprintf("BootstrapExtensions[%v]", idx),
607 reason: "embedded message failed validation",
608 cause: err,
609 })
610 }
611 case interface{ Validate() error }:
612 if err := v.Validate(); err != nil {
613 errors = append(errors, BootstrapValidationError{
614 field: fmt.Sprintf("BootstrapExtensions[%v]", idx),
615 reason: "embedded message failed validation",
616 cause: err,
617 })
618 }
619 }
620 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
621 if err := v.Validate(); err != nil {
622 return BootstrapValidationError{
623 field: fmt.Sprintf("BootstrapExtensions[%v]", idx),
624 reason: "embedded message failed validation",
625 cause: err,
626 }
627 }
628 }
629
630 }
631
632 for idx, item := range m.GetFatalActions() {
633 _, _ = idx, item
634
635 if all {
636 switch v := interface{}(item).(type) {
637 case interface{ ValidateAll() error }:
638 if err := v.ValidateAll(); err != nil {
639 errors = append(errors, BootstrapValidationError{
640 field: fmt.Sprintf("FatalActions[%v]", idx),
641 reason: "embedded message failed validation",
642 cause: err,
643 })
644 }
645 case interface{ Validate() error }:
646 if err := v.Validate(); err != nil {
647 errors = append(errors, BootstrapValidationError{
648 field: fmt.Sprintf("FatalActions[%v]", idx),
649 reason: "embedded message failed validation",
650 cause: err,
651 })
652 }
653 }
654 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
655 if err := v.Validate(); err != nil {
656 return BootstrapValidationError{
657 field: fmt.Sprintf("FatalActions[%v]", idx),
658 reason: "embedded message failed validation",
659 cause: err,
660 }
661 }
662 }
663
664 }
665
666 for idx, item := range m.GetConfigSources() {
667 _, _ = idx, item
668
669 if all {
670 switch v := interface{}(item).(type) {
671 case interface{ ValidateAll() error }:
672 if err := v.ValidateAll(); err != nil {
673 errors = append(errors, BootstrapValidationError{
674 field: fmt.Sprintf("ConfigSources[%v]", idx),
675 reason: "embedded message failed validation",
676 cause: err,
677 })
678 }
679 case interface{ Validate() error }:
680 if err := v.Validate(); err != nil {
681 errors = append(errors, BootstrapValidationError{
682 field: fmt.Sprintf("ConfigSources[%v]", idx),
683 reason: "embedded message failed validation",
684 cause: err,
685 })
686 }
687 }
688 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
689 if err := v.Validate(); err != nil {
690 return BootstrapValidationError{
691 field: fmt.Sprintf("ConfigSources[%v]", idx),
692 reason: "embedded message failed validation",
693 cause: err,
694 }
695 }
696 }
697
698 }
699
700 if all {
701 switch v := interface{}(m.GetDefaultConfigSource()).(type) {
702 case interface{ ValidateAll() error }:
703 if err := v.ValidateAll(); err != nil {
704 errors = append(errors, BootstrapValidationError{
705 field: "DefaultConfigSource",
706 reason: "embedded message failed validation",
707 cause: err,
708 })
709 }
710 case interface{ Validate() error }:
711 if err := v.Validate(); err != nil {
712 errors = append(errors, BootstrapValidationError{
713 field: "DefaultConfigSource",
714 reason: "embedded message failed validation",
715 cause: err,
716 })
717 }
718 }
719 } else if v, ok := interface{}(m.GetDefaultConfigSource()).(interface{ Validate() error }); ok {
720 if err := v.Validate(); err != nil {
721 return BootstrapValidationError{
722 field: "DefaultConfigSource",
723 reason: "embedded message failed validation",
724 cause: err,
725 }
726 }
727 }
728
729 // no validation rules for DefaultSocketInterface
730
731 {
732 sorted_keys := make([]string, len(m.GetCertificateProviderInstances()))
733 i := 0
734 for key := range m.GetCertificateProviderInstances() {
735 sorted_keys[i] = key
736 i++
737 }
738 sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
739 for _, key := range sorted_keys {
740 val := m.GetCertificateProviderInstances()[key]
741 _ = val
742
743 // no validation rules for CertificateProviderInstances[key]
744
745 if all {
746 switch v := interface{}(val).(type) {
747 case interface{ ValidateAll() error }:
748 if err := v.ValidateAll(); err != nil {
749 errors = append(errors, BootstrapValidationError{
750 field: fmt.Sprintf("CertificateProviderInstances[%v]", key),
751 reason: "embedded message failed validation",
752 cause: err,
753 })
754 }
755 case interface{ Validate() error }:
756 if err := v.Validate(); err != nil {
757 errors = append(errors, BootstrapValidationError{
758 field: fmt.Sprintf("CertificateProviderInstances[%v]", key),
759 reason: "embedded message failed validation",
760 cause: err,
761 })
762 }
763 }
764 } else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
765 if err := v.Validate(); err != nil {
766 return BootstrapValidationError{
767 field: fmt.Sprintf("CertificateProviderInstances[%v]", key),
768 reason: "embedded message failed validation",
769 cause: err,
770 }
771 }
772 }
773
774 }
775 }
776
777 for idx, item := range m.GetInlineHeaders() {
778 _, _ = idx, item
779
780 if all {
781 switch v := interface{}(item).(type) {
782 case interface{ ValidateAll() error }:
783 if err := v.ValidateAll(); err != nil {
784 errors = append(errors, BootstrapValidationError{
785 field: fmt.Sprintf("InlineHeaders[%v]", idx),
786 reason: "embedded message failed validation",
787 cause: err,
788 })
789 }
790 case interface{ Validate() error }:
791 if err := v.Validate(); err != nil {
792 errors = append(errors, BootstrapValidationError{
793 field: fmt.Sprintf("InlineHeaders[%v]", idx),
794 reason: "embedded message failed validation",
795 cause: err,
796 })
797 }
798 }
799 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
800 if err := v.Validate(); err != nil {
801 return BootstrapValidationError{
802 field: fmt.Sprintf("InlineHeaders[%v]", idx),
803 reason: "embedded message failed validation",
804 cause: err,
805 }
806 }
807 }
808
809 }
810
811 // no validation rules for PerfTracingFilePath
812
813 if all {
814 switch v := interface{}(m.GetDefaultRegexEngine()).(type) {
815 case interface{ ValidateAll() error }:
816 if err := v.ValidateAll(); err != nil {
817 errors = append(errors, BootstrapValidationError{
818 field: "DefaultRegexEngine",
819 reason: "embedded message failed validation",
820 cause: err,
821 })
822 }
823 case interface{ Validate() error }:
824 if err := v.Validate(); err != nil {
825 errors = append(errors, BootstrapValidationError{
826 field: "DefaultRegexEngine",
827 reason: "embedded message failed validation",
828 cause: err,
829 })
830 }
831 }
832 } else if v, ok := interface{}(m.GetDefaultRegexEngine()).(interface{ Validate() error }); ok {
833 if err := v.Validate(); err != nil {
834 return BootstrapValidationError{
835 field: "DefaultRegexEngine",
836 reason: "embedded message failed validation",
837 cause: err,
838 }
839 }
840 }
841
842 if all {
843 switch v := interface{}(m.GetXdsDelegateExtension()).(type) {
844 case interface{ ValidateAll() error }:
845 if err := v.ValidateAll(); err != nil {
846 errors = append(errors, BootstrapValidationError{
847 field: "XdsDelegateExtension",
848 reason: "embedded message failed validation",
849 cause: err,
850 })
851 }
852 case interface{ Validate() error }:
853 if err := v.Validate(); err != nil {
854 errors = append(errors, BootstrapValidationError{
855 field: "XdsDelegateExtension",
856 reason: "embedded message failed validation",
857 cause: err,
858 })
859 }
860 }
861 } else if v, ok := interface{}(m.GetXdsDelegateExtension()).(interface{ Validate() error }); ok {
862 if err := v.Validate(); err != nil {
863 return BootstrapValidationError{
864 field: "XdsDelegateExtension",
865 reason: "embedded message failed validation",
866 cause: err,
867 }
868 }
869 }
870
871 if all {
872 switch v := interface{}(m.GetXdsConfigTrackerExtension()).(type) {
873 case interface{ ValidateAll() error }:
874 if err := v.ValidateAll(); err != nil {
875 errors = append(errors, BootstrapValidationError{
876 field: "XdsConfigTrackerExtension",
877 reason: "embedded message failed validation",
878 cause: err,
879 })
880 }
881 case interface{ Validate() error }:
882 if err := v.Validate(); err != nil {
883 errors = append(errors, BootstrapValidationError{
884 field: "XdsConfigTrackerExtension",
885 reason: "embedded message failed validation",
886 cause: err,
887 })
888 }
889 }
890 } else if v, ok := interface{}(m.GetXdsConfigTrackerExtension()).(interface{ Validate() error }); ok {
891 if err := v.Validate(); err != nil {
892 return BootstrapValidationError{
893 field: "XdsConfigTrackerExtension",
894 reason: "embedded message failed validation",
895 cause: err,
896 }
897 }
898 }
899
900 if all {
901 switch v := interface{}(m.GetListenerManager()).(type) {
902 case interface{ ValidateAll() error }:
903 if err := v.ValidateAll(); err != nil {
904 errors = append(errors, BootstrapValidationError{
905 field: "ListenerManager",
906 reason: "embedded message failed validation",
907 cause: err,
908 })
909 }
910 case interface{ Validate() error }:
911 if err := v.Validate(); err != nil {
912 errors = append(errors, BootstrapValidationError{
913 field: "ListenerManager",
914 reason: "embedded message failed validation",
915 cause: err,
916 })
917 }
918 }
919 } else if v, ok := interface{}(m.GetListenerManager()).(interface{ Validate() error }); ok {
920 if err := v.Validate(); err != nil {
921 return BootstrapValidationError{
922 field: "ListenerManager",
923 reason: "embedded message failed validation",
924 cause: err,
925 }
926 }
927 }
928
929 if all {
930 switch v := interface{}(m.GetApplicationLogConfig()).(type) {
931 case interface{ ValidateAll() error }:
932 if err := v.ValidateAll(); err != nil {
933 errors = append(errors, BootstrapValidationError{
934 field: "ApplicationLogConfig",
935 reason: "embedded message failed validation",
936 cause: err,
937 })
938 }
939 case interface{ Validate() error }:
940 if err := v.Validate(); err != nil {
941 errors = append(errors, BootstrapValidationError{
942 field: "ApplicationLogConfig",
943 reason: "embedded message failed validation",
944 cause: err,
945 })
946 }
947 }
948 } else if v, ok := interface{}(m.GetApplicationLogConfig()).(interface{ Validate() error }); ok {
949 if err := v.Validate(); err != nil {
950 return BootstrapValidationError{
951 field: "ApplicationLogConfig",
952 reason: "embedded message failed validation",
953 cause: err,
954 }
955 }
956 }
957
958 if all {
959 switch v := interface{}(m.GetGrpcAsyncClientManagerConfig()).(type) {
960 case interface{ ValidateAll() error }:
961 if err := v.ValidateAll(); err != nil {
962 errors = append(errors, BootstrapValidationError{
963 field: "GrpcAsyncClientManagerConfig",
964 reason: "embedded message failed validation",
965 cause: err,
966 })
967 }
968 case interface{ Validate() error }:
969 if err := v.Validate(); err != nil {
970 errors = append(errors, BootstrapValidationError{
971 field: "GrpcAsyncClientManagerConfig",
972 reason: "embedded message failed validation",
973 cause: err,
974 })
975 }
976 }
977 } else if v, ok := interface{}(m.GetGrpcAsyncClientManagerConfig()).(interface{ Validate() error }); ok {
978 if err := v.Validate(); err != nil {
979 return BootstrapValidationError{
980 field: "GrpcAsyncClientManagerConfig",
981 reason: "embedded message failed validation",
982 cause: err,
983 }
984 }
985 }
986
987 if all {
988 switch v := interface{}(m.GetMemoryAllocatorManager()).(type) {
989 case interface{ ValidateAll() error }:
990 if err := v.ValidateAll(); err != nil {
991 errors = append(errors, BootstrapValidationError{
992 field: "MemoryAllocatorManager",
993 reason: "embedded message failed validation",
994 cause: err,
995 })
996 }
997 case interface{ Validate() error }:
998 if err := v.Validate(); err != nil {
999 errors = append(errors, BootstrapValidationError{
1000 field: "MemoryAllocatorManager",
1001 reason: "embedded message failed validation",
1002 cause: err,
1003 })
1004 }
1005 }
1006 } else if v, ok := interface{}(m.GetMemoryAllocatorManager()).(interface{ Validate() error }); ok {
1007 if err := v.Validate(); err != nil {
1008 return BootstrapValidationError{
1009 field: "MemoryAllocatorManager",
1010 reason: "embedded message failed validation",
1011 cause: err,
1012 }
1013 }
1014 }
1015
1016 switch v := m.StatsFlush.(type) {
1017 case *Bootstrap_StatsFlushOnAdmin:
1018 if v == nil {
1019 err := BootstrapValidationError{
1020 field: "StatsFlush",
1021 reason: "oneof value cannot be a typed-nil",
1022 }
1023 if !all {
1024 return err
1025 }
1026 errors = append(errors, err)
1027 }
1028
1029 if m.GetStatsFlushOnAdmin() != true {
1030 err := BootstrapValidationError{
1031 field: "StatsFlushOnAdmin",
1032 reason: "value must equal true",
1033 }
1034 if !all {
1035 return err
1036 }
1037 errors = append(errors, err)
1038 }
1039
1040 default:
1041 _ = v // ensures v is used
1042 }
1043
1044 if len(errors) > 0 {
1045 return BootstrapMultiError(errors)
1046 }
1047
1048 return nil
1049 }
1050
1051 // BootstrapMultiError is an error wrapping multiple validation errors returned
1052 // by Bootstrap.ValidateAll() if the designated constraints aren't met.
1053 type BootstrapMultiError []error
1054
1055 // Error returns a concatenation of all the error messages it wraps.
1056 func (m BootstrapMultiError) Error() string {
1057 var msgs []string
1058 for _, err := range m {
1059 msgs = append(msgs, err.Error())
1060 }
1061 return strings.Join(msgs, "; ")
1062 }
1063
1064 // AllErrors returns a list of validation violation errors.
1065 func (m BootstrapMultiError) AllErrors() []error { return m }
1066
1067 // BootstrapValidationError is the validation error returned by
1068 // Bootstrap.Validate if the designated constraints aren't met.
1069 type BootstrapValidationError struct {
1070 field string
1071 reason string
1072 cause error
1073 key bool
1074 }
1075
1076 // Field function returns field value.
1077 func (e BootstrapValidationError) Field() string { return e.field }
1078
1079 // Reason function returns reason value.
1080 func (e BootstrapValidationError) Reason() string { return e.reason }
1081
1082 // Cause function returns cause value.
1083 func (e BootstrapValidationError) Cause() error { return e.cause }
1084
1085 // Key function returns key value.
1086 func (e BootstrapValidationError) Key() bool { return e.key }
1087
1088 // ErrorName returns error name.
1089 func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" }
1090
1091 // Error satisfies the builtin error interface
1092 func (e BootstrapValidationError) Error() string {
1093 cause := ""
1094 if e.cause != nil {
1095 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1096 }
1097
1098 key := ""
1099 if e.key {
1100 key = "key for "
1101 }
1102
1103 return fmt.Sprintf(
1104 "invalid %sBootstrap.%s: %s%s",
1105 key,
1106 e.field,
1107 e.reason,
1108 cause)
1109 }
1110
1111 var _ error = BootstrapValidationError{}
1112
1113 var _ interface {
1114 Field() string
1115 Reason() string
1116 Key() bool
1117 Cause() error
1118 ErrorName() string
1119 } = BootstrapValidationError{}
1120
1121 // Validate checks the field values on Admin with the rules defined in the
1122 // proto definition for this message. If any rules are violated, the first
1123 // error encountered is returned, or nil if there are no violations.
1124 func (m *Admin) Validate() error {
1125 return m.validate(false)
1126 }
1127
1128 // ValidateAll checks the field values on Admin with the rules defined in the
1129 // proto definition for this message. If any rules are violated, the result is
1130 // a list of violation errors wrapped in AdminMultiError, or nil if none found.
1131 func (m *Admin) ValidateAll() error {
1132 return m.validate(true)
1133 }
1134
1135 func (m *Admin) validate(all bool) error {
1136 if m == nil {
1137 return nil
1138 }
1139
1140 var errors []error
1141
1142 for idx, item := range m.GetAccessLog() {
1143 _, _ = idx, item
1144
1145 if all {
1146 switch v := interface{}(item).(type) {
1147 case interface{ ValidateAll() error }:
1148 if err := v.ValidateAll(); err != nil {
1149 errors = append(errors, AdminValidationError{
1150 field: fmt.Sprintf("AccessLog[%v]", idx),
1151 reason: "embedded message failed validation",
1152 cause: err,
1153 })
1154 }
1155 case interface{ Validate() error }:
1156 if err := v.Validate(); err != nil {
1157 errors = append(errors, AdminValidationError{
1158 field: fmt.Sprintf("AccessLog[%v]", idx),
1159 reason: "embedded message failed validation",
1160 cause: err,
1161 })
1162 }
1163 }
1164 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1165 if err := v.Validate(); err != nil {
1166 return AdminValidationError{
1167 field: fmt.Sprintf("AccessLog[%v]", idx),
1168 reason: "embedded message failed validation",
1169 cause: err,
1170 }
1171 }
1172 }
1173
1174 }
1175
1176 // no validation rules for AccessLogPath
1177
1178 // no validation rules for ProfilePath
1179
1180 if all {
1181 switch v := interface{}(m.GetAddress()).(type) {
1182 case interface{ ValidateAll() error }:
1183 if err := v.ValidateAll(); err != nil {
1184 errors = append(errors, AdminValidationError{
1185 field: "Address",
1186 reason: "embedded message failed validation",
1187 cause: err,
1188 })
1189 }
1190 case interface{ Validate() error }:
1191 if err := v.Validate(); err != nil {
1192 errors = append(errors, AdminValidationError{
1193 field: "Address",
1194 reason: "embedded message failed validation",
1195 cause: err,
1196 })
1197 }
1198 }
1199 } else if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
1200 if err := v.Validate(); err != nil {
1201 return AdminValidationError{
1202 field: "Address",
1203 reason: "embedded message failed validation",
1204 cause: err,
1205 }
1206 }
1207 }
1208
1209 for idx, item := range m.GetSocketOptions() {
1210 _, _ = idx, item
1211
1212 if all {
1213 switch v := interface{}(item).(type) {
1214 case interface{ ValidateAll() error }:
1215 if err := v.ValidateAll(); err != nil {
1216 errors = append(errors, AdminValidationError{
1217 field: fmt.Sprintf("SocketOptions[%v]", idx),
1218 reason: "embedded message failed validation",
1219 cause: err,
1220 })
1221 }
1222 case interface{ Validate() error }:
1223 if err := v.Validate(); err != nil {
1224 errors = append(errors, AdminValidationError{
1225 field: fmt.Sprintf("SocketOptions[%v]", idx),
1226 reason: "embedded message failed validation",
1227 cause: err,
1228 })
1229 }
1230 }
1231 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1232 if err := v.Validate(); err != nil {
1233 return AdminValidationError{
1234 field: fmt.Sprintf("SocketOptions[%v]", idx),
1235 reason: "embedded message failed validation",
1236 cause: err,
1237 }
1238 }
1239 }
1240
1241 }
1242
1243 // no validation rules for IgnoreGlobalConnLimit
1244
1245 if len(errors) > 0 {
1246 return AdminMultiError(errors)
1247 }
1248
1249 return nil
1250 }
1251
1252 // AdminMultiError is an error wrapping multiple validation errors returned by
1253 // Admin.ValidateAll() if the designated constraints aren't met.
1254 type AdminMultiError []error
1255
1256 // Error returns a concatenation of all the error messages it wraps.
1257 func (m AdminMultiError) Error() string {
1258 var msgs []string
1259 for _, err := range m {
1260 msgs = append(msgs, err.Error())
1261 }
1262 return strings.Join(msgs, "; ")
1263 }
1264
1265 // AllErrors returns a list of validation violation errors.
1266 func (m AdminMultiError) AllErrors() []error { return m }
1267
1268 // AdminValidationError is the validation error returned by Admin.Validate if
1269 // the designated constraints aren't met.
1270 type AdminValidationError struct {
1271 field string
1272 reason string
1273 cause error
1274 key bool
1275 }
1276
1277 // Field function returns field value.
1278 func (e AdminValidationError) Field() string { return e.field }
1279
1280 // Reason function returns reason value.
1281 func (e AdminValidationError) Reason() string { return e.reason }
1282
1283 // Cause function returns cause value.
1284 func (e AdminValidationError) Cause() error { return e.cause }
1285
1286 // Key function returns key value.
1287 func (e AdminValidationError) Key() bool { return e.key }
1288
1289 // ErrorName returns error name.
1290 func (e AdminValidationError) ErrorName() string { return "AdminValidationError" }
1291
1292 // Error satisfies the builtin error interface
1293 func (e AdminValidationError) Error() string {
1294 cause := ""
1295 if e.cause != nil {
1296 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1297 }
1298
1299 key := ""
1300 if e.key {
1301 key = "key for "
1302 }
1303
1304 return fmt.Sprintf(
1305 "invalid %sAdmin.%s: %s%s",
1306 key,
1307 e.field,
1308 e.reason,
1309 cause)
1310 }
1311
1312 var _ error = AdminValidationError{}
1313
1314 var _ interface {
1315 Field() string
1316 Reason() string
1317 Key() bool
1318 Cause() error
1319 ErrorName() string
1320 } = AdminValidationError{}
1321
1322 // Validate checks the field values on ClusterManager with the rules defined in
1323 // the proto definition for this message. If any rules are violated, the first
1324 // error encountered is returned, or nil if there are no violations.
1325 func (m *ClusterManager) Validate() error {
1326 return m.validate(false)
1327 }
1328
1329 // ValidateAll checks the field values on ClusterManager with the rules defined
1330 // in the proto definition for this message. If any rules are violated, the
1331 // result is a list of violation errors wrapped in ClusterManagerMultiError,
1332 // or nil if none found.
1333 func (m *ClusterManager) ValidateAll() error {
1334 return m.validate(true)
1335 }
1336
1337 func (m *ClusterManager) validate(all bool) error {
1338 if m == nil {
1339 return nil
1340 }
1341
1342 var errors []error
1343
1344 // no validation rules for LocalClusterName
1345
1346 if all {
1347 switch v := interface{}(m.GetOutlierDetection()).(type) {
1348 case interface{ ValidateAll() error }:
1349 if err := v.ValidateAll(); err != nil {
1350 errors = append(errors, ClusterManagerValidationError{
1351 field: "OutlierDetection",
1352 reason: "embedded message failed validation",
1353 cause: err,
1354 })
1355 }
1356 case interface{ Validate() error }:
1357 if err := v.Validate(); err != nil {
1358 errors = append(errors, ClusterManagerValidationError{
1359 field: "OutlierDetection",
1360 reason: "embedded message failed validation",
1361 cause: err,
1362 })
1363 }
1364 }
1365 } else if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok {
1366 if err := v.Validate(); err != nil {
1367 return ClusterManagerValidationError{
1368 field: "OutlierDetection",
1369 reason: "embedded message failed validation",
1370 cause: err,
1371 }
1372 }
1373 }
1374
1375 if all {
1376 switch v := interface{}(m.GetUpstreamBindConfig()).(type) {
1377 case interface{ ValidateAll() error }:
1378 if err := v.ValidateAll(); err != nil {
1379 errors = append(errors, ClusterManagerValidationError{
1380 field: "UpstreamBindConfig",
1381 reason: "embedded message failed validation",
1382 cause: err,
1383 })
1384 }
1385 case interface{ Validate() error }:
1386 if err := v.Validate(); err != nil {
1387 errors = append(errors, ClusterManagerValidationError{
1388 field: "UpstreamBindConfig",
1389 reason: "embedded message failed validation",
1390 cause: err,
1391 })
1392 }
1393 }
1394 } else if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok {
1395 if err := v.Validate(); err != nil {
1396 return ClusterManagerValidationError{
1397 field: "UpstreamBindConfig",
1398 reason: "embedded message failed validation",
1399 cause: err,
1400 }
1401 }
1402 }
1403
1404 if all {
1405 switch v := interface{}(m.GetLoadStatsConfig()).(type) {
1406 case interface{ ValidateAll() error }:
1407 if err := v.ValidateAll(); err != nil {
1408 errors = append(errors, ClusterManagerValidationError{
1409 field: "LoadStatsConfig",
1410 reason: "embedded message failed validation",
1411 cause: err,
1412 })
1413 }
1414 case interface{ Validate() error }:
1415 if err := v.Validate(); err != nil {
1416 errors = append(errors, ClusterManagerValidationError{
1417 field: "LoadStatsConfig",
1418 reason: "embedded message failed validation",
1419 cause: err,
1420 })
1421 }
1422 }
1423 } else if v, ok := interface{}(m.GetLoadStatsConfig()).(interface{ Validate() error }); ok {
1424 if err := v.Validate(); err != nil {
1425 return ClusterManagerValidationError{
1426 field: "LoadStatsConfig",
1427 reason: "embedded message failed validation",
1428 cause: err,
1429 }
1430 }
1431 }
1432
1433 // no validation rules for EnableDeferredClusterCreation
1434
1435 if len(errors) > 0 {
1436 return ClusterManagerMultiError(errors)
1437 }
1438
1439 return nil
1440 }
1441
1442 // ClusterManagerMultiError is an error wrapping multiple validation errors
1443 // returned by ClusterManager.ValidateAll() if the designated constraints
1444 // aren't met.
1445 type ClusterManagerMultiError []error
1446
1447 // Error returns a concatenation of all the error messages it wraps.
1448 func (m ClusterManagerMultiError) Error() string {
1449 var msgs []string
1450 for _, err := range m {
1451 msgs = append(msgs, err.Error())
1452 }
1453 return strings.Join(msgs, "; ")
1454 }
1455
1456 // AllErrors returns a list of validation violation errors.
1457 func (m ClusterManagerMultiError) AllErrors() []error { return m }
1458
1459 // ClusterManagerValidationError is the validation error returned by
1460 // ClusterManager.Validate if the designated constraints aren't met.
1461 type ClusterManagerValidationError struct {
1462 field string
1463 reason string
1464 cause error
1465 key bool
1466 }
1467
1468 // Field function returns field value.
1469 func (e ClusterManagerValidationError) Field() string { return e.field }
1470
1471 // Reason function returns reason value.
1472 func (e ClusterManagerValidationError) Reason() string { return e.reason }
1473
1474 // Cause function returns cause value.
1475 func (e ClusterManagerValidationError) Cause() error { return e.cause }
1476
1477 // Key function returns key value.
1478 func (e ClusterManagerValidationError) Key() bool { return e.key }
1479
1480 // ErrorName returns error name.
1481 func (e ClusterManagerValidationError) ErrorName() string { return "ClusterManagerValidationError" }
1482
1483 // Error satisfies the builtin error interface
1484 func (e ClusterManagerValidationError) Error() string {
1485 cause := ""
1486 if e.cause != nil {
1487 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1488 }
1489
1490 key := ""
1491 if e.key {
1492 key = "key for "
1493 }
1494
1495 return fmt.Sprintf(
1496 "invalid %sClusterManager.%s: %s%s",
1497 key,
1498 e.field,
1499 e.reason,
1500 cause)
1501 }
1502
1503 var _ error = ClusterManagerValidationError{}
1504
1505 var _ interface {
1506 Field() string
1507 Reason() string
1508 Key() bool
1509 Cause() error
1510 ErrorName() string
1511 } = ClusterManagerValidationError{}
1512
1513 // Validate checks the field values on Watchdogs with the rules defined in the
1514 // proto definition for this message. If any rules are violated, the first
1515 // error encountered is returned, or nil if there are no violations.
1516 func (m *Watchdogs) Validate() error {
1517 return m.validate(false)
1518 }
1519
1520 // ValidateAll checks the field values on Watchdogs with the rules defined in
1521 // the proto definition for this message. If any rules are violated, the
1522 // result is a list of violation errors wrapped in WatchdogsMultiError, or nil
1523 // if none found.
1524 func (m *Watchdogs) ValidateAll() error {
1525 return m.validate(true)
1526 }
1527
1528 func (m *Watchdogs) validate(all bool) error {
1529 if m == nil {
1530 return nil
1531 }
1532
1533 var errors []error
1534
1535 if all {
1536 switch v := interface{}(m.GetMainThreadWatchdog()).(type) {
1537 case interface{ ValidateAll() error }:
1538 if err := v.ValidateAll(); err != nil {
1539 errors = append(errors, WatchdogsValidationError{
1540 field: "MainThreadWatchdog",
1541 reason: "embedded message failed validation",
1542 cause: err,
1543 })
1544 }
1545 case interface{ Validate() error }:
1546 if err := v.Validate(); err != nil {
1547 errors = append(errors, WatchdogsValidationError{
1548 field: "MainThreadWatchdog",
1549 reason: "embedded message failed validation",
1550 cause: err,
1551 })
1552 }
1553 }
1554 } else if v, ok := interface{}(m.GetMainThreadWatchdog()).(interface{ Validate() error }); ok {
1555 if err := v.Validate(); err != nil {
1556 return WatchdogsValidationError{
1557 field: "MainThreadWatchdog",
1558 reason: "embedded message failed validation",
1559 cause: err,
1560 }
1561 }
1562 }
1563
1564 if all {
1565 switch v := interface{}(m.GetWorkerWatchdog()).(type) {
1566 case interface{ ValidateAll() error }:
1567 if err := v.ValidateAll(); err != nil {
1568 errors = append(errors, WatchdogsValidationError{
1569 field: "WorkerWatchdog",
1570 reason: "embedded message failed validation",
1571 cause: err,
1572 })
1573 }
1574 case interface{ Validate() error }:
1575 if err := v.Validate(); err != nil {
1576 errors = append(errors, WatchdogsValidationError{
1577 field: "WorkerWatchdog",
1578 reason: "embedded message failed validation",
1579 cause: err,
1580 })
1581 }
1582 }
1583 } else if v, ok := interface{}(m.GetWorkerWatchdog()).(interface{ Validate() error }); ok {
1584 if err := v.Validate(); err != nil {
1585 return WatchdogsValidationError{
1586 field: "WorkerWatchdog",
1587 reason: "embedded message failed validation",
1588 cause: err,
1589 }
1590 }
1591 }
1592
1593 if len(errors) > 0 {
1594 return WatchdogsMultiError(errors)
1595 }
1596
1597 return nil
1598 }
1599
1600 // WatchdogsMultiError is an error wrapping multiple validation errors returned
1601 // by Watchdogs.ValidateAll() if the designated constraints aren't met.
1602 type WatchdogsMultiError []error
1603
1604 // Error returns a concatenation of all the error messages it wraps.
1605 func (m WatchdogsMultiError) Error() string {
1606 var msgs []string
1607 for _, err := range m {
1608 msgs = append(msgs, err.Error())
1609 }
1610 return strings.Join(msgs, "; ")
1611 }
1612
1613 // AllErrors returns a list of validation violation errors.
1614 func (m WatchdogsMultiError) AllErrors() []error { return m }
1615
1616 // WatchdogsValidationError is the validation error returned by
1617 // Watchdogs.Validate if the designated constraints aren't met.
1618 type WatchdogsValidationError struct {
1619 field string
1620 reason string
1621 cause error
1622 key bool
1623 }
1624
1625 // Field function returns field value.
1626 func (e WatchdogsValidationError) Field() string { return e.field }
1627
1628 // Reason function returns reason value.
1629 func (e WatchdogsValidationError) Reason() string { return e.reason }
1630
1631 // Cause function returns cause value.
1632 func (e WatchdogsValidationError) Cause() error { return e.cause }
1633
1634 // Key function returns key value.
1635 func (e WatchdogsValidationError) Key() bool { return e.key }
1636
1637 // ErrorName returns error name.
1638 func (e WatchdogsValidationError) ErrorName() string { return "WatchdogsValidationError" }
1639
1640 // Error satisfies the builtin error interface
1641 func (e WatchdogsValidationError) Error() string {
1642 cause := ""
1643 if e.cause != nil {
1644 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1645 }
1646
1647 key := ""
1648 if e.key {
1649 key = "key for "
1650 }
1651
1652 return fmt.Sprintf(
1653 "invalid %sWatchdogs.%s: %s%s",
1654 key,
1655 e.field,
1656 e.reason,
1657 cause)
1658 }
1659
1660 var _ error = WatchdogsValidationError{}
1661
1662 var _ interface {
1663 Field() string
1664 Reason() string
1665 Key() bool
1666 Cause() error
1667 ErrorName() string
1668 } = WatchdogsValidationError{}
1669
1670 // Validate checks the field values on Watchdog with the rules defined in the
1671 // proto definition for this message. If any rules are violated, the first
1672 // error encountered is returned, or nil if there are no violations.
1673 func (m *Watchdog) Validate() error {
1674 return m.validate(false)
1675 }
1676
1677 // ValidateAll checks the field values on Watchdog with the rules defined in
1678 // the proto definition for this message. If any rules are violated, the
1679 // result is a list of violation errors wrapped in WatchdogMultiError, or nil
1680 // if none found.
1681 func (m *Watchdog) ValidateAll() error {
1682 return m.validate(true)
1683 }
1684
1685 func (m *Watchdog) validate(all bool) error {
1686 if m == nil {
1687 return nil
1688 }
1689
1690 var errors []error
1691
1692 for idx, item := range m.GetActions() {
1693 _, _ = idx, item
1694
1695 if all {
1696 switch v := interface{}(item).(type) {
1697 case interface{ ValidateAll() error }:
1698 if err := v.ValidateAll(); err != nil {
1699 errors = append(errors, WatchdogValidationError{
1700 field: fmt.Sprintf("Actions[%v]", idx),
1701 reason: "embedded message failed validation",
1702 cause: err,
1703 })
1704 }
1705 case interface{ Validate() error }:
1706 if err := v.Validate(); err != nil {
1707 errors = append(errors, WatchdogValidationError{
1708 field: fmt.Sprintf("Actions[%v]", idx),
1709 reason: "embedded message failed validation",
1710 cause: err,
1711 })
1712 }
1713 }
1714 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1715 if err := v.Validate(); err != nil {
1716 return WatchdogValidationError{
1717 field: fmt.Sprintf("Actions[%v]", idx),
1718 reason: "embedded message failed validation",
1719 cause: err,
1720 }
1721 }
1722 }
1723
1724 }
1725
1726 if all {
1727 switch v := interface{}(m.GetMissTimeout()).(type) {
1728 case interface{ ValidateAll() error }:
1729 if err := v.ValidateAll(); err != nil {
1730 errors = append(errors, WatchdogValidationError{
1731 field: "MissTimeout",
1732 reason: "embedded message failed validation",
1733 cause: err,
1734 })
1735 }
1736 case interface{ Validate() error }:
1737 if err := v.Validate(); err != nil {
1738 errors = append(errors, WatchdogValidationError{
1739 field: "MissTimeout",
1740 reason: "embedded message failed validation",
1741 cause: err,
1742 })
1743 }
1744 }
1745 } else if v, ok := interface{}(m.GetMissTimeout()).(interface{ Validate() error }); ok {
1746 if err := v.Validate(); err != nil {
1747 return WatchdogValidationError{
1748 field: "MissTimeout",
1749 reason: "embedded message failed validation",
1750 cause: err,
1751 }
1752 }
1753 }
1754
1755 if all {
1756 switch v := interface{}(m.GetMegamissTimeout()).(type) {
1757 case interface{ ValidateAll() error }:
1758 if err := v.ValidateAll(); err != nil {
1759 errors = append(errors, WatchdogValidationError{
1760 field: "MegamissTimeout",
1761 reason: "embedded message failed validation",
1762 cause: err,
1763 })
1764 }
1765 case interface{ Validate() error }:
1766 if err := v.Validate(); err != nil {
1767 errors = append(errors, WatchdogValidationError{
1768 field: "MegamissTimeout",
1769 reason: "embedded message failed validation",
1770 cause: err,
1771 })
1772 }
1773 }
1774 } else if v, ok := interface{}(m.GetMegamissTimeout()).(interface{ Validate() error }); ok {
1775 if err := v.Validate(); err != nil {
1776 return WatchdogValidationError{
1777 field: "MegamissTimeout",
1778 reason: "embedded message failed validation",
1779 cause: err,
1780 }
1781 }
1782 }
1783
1784 if all {
1785 switch v := interface{}(m.GetKillTimeout()).(type) {
1786 case interface{ ValidateAll() error }:
1787 if err := v.ValidateAll(); err != nil {
1788 errors = append(errors, WatchdogValidationError{
1789 field: "KillTimeout",
1790 reason: "embedded message failed validation",
1791 cause: err,
1792 })
1793 }
1794 case interface{ Validate() error }:
1795 if err := v.Validate(); err != nil {
1796 errors = append(errors, WatchdogValidationError{
1797 field: "KillTimeout",
1798 reason: "embedded message failed validation",
1799 cause: err,
1800 })
1801 }
1802 }
1803 } else if v, ok := interface{}(m.GetKillTimeout()).(interface{ Validate() error }); ok {
1804 if err := v.Validate(); err != nil {
1805 return WatchdogValidationError{
1806 field: "KillTimeout",
1807 reason: "embedded message failed validation",
1808 cause: err,
1809 }
1810 }
1811 }
1812
1813 if d := m.GetMaxKillTimeoutJitter(); d != nil {
1814 dur, err := d.AsDuration(), d.CheckValid()
1815 if err != nil {
1816 err = WatchdogValidationError{
1817 field: "MaxKillTimeoutJitter",
1818 reason: "value is not a valid duration",
1819 cause: err,
1820 }
1821 if !all {
1822 return err
1823 }
1824 errors = append(errors, err)
1825 } else {
1826
1827 gte := time.Duration(0*time.Second + 0*time.Nanosecond)
1828
1829 if dur < gte {
1830 err := WatchdogValidationError{
1831 field: "MaxKillTimeoutJitter",
1832 reason: "value must be greater than or equal to 0s",
1833 }
1834 if !all {
1835 return err
1836 }
1837 errors = append(errors, err)
1838 }
1839
1840 }
1841 }
1842
1843 if all {
1844 switch v := interface{}(m.GetMultikillTimeout()).(type) {
1845 case interface{ ValidateAll() error }:
1846 if err := v.ValidateAll(); err != nil {
1847 errors = append(errors, WatchdogValidationError{
1848 field: "MultikillTimeout",
1849 reason: "embedded message failed validation",
1850 cause: err,
1851 })
1852 }
1853 case interface{ Validate() error }:
1854 if err := v.Validate(); err != nil {
1855 errors = append(errors, WatchdogValidationError{
1856 field: "MultikillTimeout",
1857 reason: "embedded message failed validation",
1858 cause: err,
1859 })
1860 }
1861 }
1862 } else if v, ok := interface{}(m.GetMultikillTimeout()).(interface{ Validate() error }); ok {
1863 if err := v.Validate(); err != nil {
1864 return WatchdogValidationError{
1865 field: "MultikillTimeout",
1866 reason: "embedded message failed validation",
1867 cause: err,
1868 }
1869 }
1870 }
1871
1872 if all {
1873 switch v := interface{}(m.GetMultikillThreshold()).(type) {
1874 case interface{ ValidateAll() error }:
1875 if err := v.ValidateAll(); err != nil {
1876 errors = append(errors, WatchdogValidationError{
1877 field: "MultikillThreshold",
1878 reason: "embedded message failed validation",
1879 cause: err,
1880 })
1881 }
1882 case interface{ Validate() error }:
1883 if err := v.Validate(); err != nil {
1884 errors = append(errors, WatchdogValidationError{
1885 field: "MultikillThreshold",
1886 reason: "embedded message failed validation",
1887 cause: err,
1888 })
1889 }
1890 }
1891 } else if v, ok := interface{}(m.GetMultikillThreshold()).(interface{ Validate() error }); ok {
1892 if err := v.Validate(); err != nil {
1893 return WatchdogValidationError{
1894 field: "MultikillThreshold",
1895 reason: "embedded message failed validation",
1896 cause: err,
1897 }
1898 }
1899 }
1900
1901 if len(errors) > 0 {
1902 return WatchdogMultiError(errors)
1903 }
1904
1905 return nil
1906 }
1907
1908 // WatchdogMultiError is an error wrapping multiple validation errors returned
1909 // by Watchdog.ValidateAll() if the designated constraints aren't met.
1910 type WatchdogMultiError []error
1911
1912 // Error returns a concatenation of all the error messages it wraps.
1913 func (m WatchdogMultiError) Error() string {
1914 var msgs []string
1915 for _, err := range m {
1916 msgs = append(msgs, err.Error())
1917 }
1918 return strings.Join(msgs, "; ")
1919 }
1920
1921 // AllErrors returns a list of validation violation errors.
1922 func (m WatchdogMultiError) AllErrors() []error { return m }
1923
1924 // WatchdogValidationError is the validation error returned by
1925 // Watchdog.Validate if the designated constraints aren't met.
1926 type WatchdogValidationError struct {
1927 field string
1928 reason string
1929 cause error
1930 key bool
1931 }
1932
1933 // Field function returns field value.
1934 func (e WatchdogValidationError) Field() string { return e.field }
1935
1936 // Reason function returns reason value.
1937 func (e WatchdogValidationError) Reason() string { return e.reason }
1938
1939 // Cause function returns cause value.
1940 func (e WatchdogValidationError) Cause() error { return e.cause }
1941
1942 // Key function returns key value.
1943 func (e WatchdogValidationError) Key() bool { return e.key }
1944
1945 // ErrorName returns error name.
1946 func (e WatchdogValidationError) ErrorName() string { return "WatchdogValidationError" }
1947
1948 // Error satisfies the builtin error interface
1949 func (e WatchdogValidationError) Error() string {
1950 cause := ""
1951 if e.cause != nil {
1952 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1953 }
1954
1955 key := ""
1956 if e.key {
1957 key = "key for "
1958 }
1959
1960 return fmt.Sprintf(
1961 "invalid %sWatchdog.%s: %s%s",
1962 key,
1963 e.field,
1964 e.reason,
1965 cause)
1966 }
1967
1968 var _ error = WatchdogValidationError{}
1969
1970 var _ interface {
1971 Field() string
1972 Reason() string
1973 Key() bool
1974 Cause() error
1975 ErrorName() string
1976 } = WatchdogValidationError{}
1977
1978 // Validate checks the field values on FatalAction with the rules defined in
1979 // the proto definition for this message. If any rules are violated, the first
1980 // error encountered is returned, or nil if there are no violations.
1981 func (m *FatalAction) Validate() error {
1982 return m.validate(false)
1983 }
1984
1985 // ValidateAll checks the field values on FatalAction with the rules defined in
1986 // the proto definition for this message. If any rules are violated, the
1987 // result is a list of violation errors wrapped in FatalActionMultiError, or
1988 // nil if none found.
1989 func (m *FatalAction) ValidateAll() error {
1990 return m.validate(true)
1991 }
1992
1993 func (m *FatalAction) validate(all bool) error {
1994 if m == nil {
1995 return nil
1996 }
1997
1998 var errors []error
1999
2000 if all {
2001 switch v := interface{}(m.GetConfig()).(type) {
2002 case interface{ ValidateAll() error }:
2003 if err := v.ValidateAll(); err != nil {
2004 errors = append(errors, FatalActionValidationError{
2005 field: "Config",
2006 reason: "embedded message failed validation",
2007 cause: err,
2008 })
2009 }
2010 case interface{ Validate() error }:
2011 if err := v.Validate(); err != nil {
2012 errors = append(errors, FatalActionValidationError{
2013 field: "Config",
2014 reason: "embedded message failed validation",
2015 cause: err,
2016 })
2017 }
2018 }
2019 } else if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
2020 if err := v.Validate(); err != nil {
2021 return FatalActionValidationError{
2022 field: "Config",
2023 reason: "embedded message failed validation",
2024 cause: err,
2025 }
2026 }
2027 }
2028
2029 if len(errors) > 0 {
2030 return FatalActionMultiError(errors)
2031 }
2032
2033 return nil
2034 }
2035
2036 // FatalActionMultiError is an error wrapping multiple validation errors
2037 // returned by FatalAction.ValidateAll() if the designated constraints aren't met.
2038 type FatalActionMultiError []error
2039
2040 // Error returns a concatenation of all the error messages it wraps.
2041 func (m FatalActionMultiError) Error() string {
2042 var msgs []string
2043 for _, err := range m {
2044 msgs = append(msgs, err.Error())
2045 }
2046 return strings.Join(msgs, "; ")
2047 }
2048
2049 // AllErrors returns a list of validation violation errors.
2050 func (m FatalActionMultiError) AllErrors() []error { return m }
2051
2052 // FatalActionValidationError is the validation error returned by
2053 // FatalAction.Validate if the designated constraints aren't met.
2054 type FatalActionValidationError struct {
2055 field string
2056 reason string
2057 cause error
2058 key bool
2059 }
2060
2061 // Field function returns field value.
2062 func (e FatalActionValidationError) Field() string { return e.field }
2063
2064 // Reason function returns reason value.
2065 func (e FatalActionValidationError) Reason() string { return e.reason }
2066
2067 // Cause function returns cause value.
2068 func (e FatalActionValidationError) Cause() error { return e.cause }
2069
2070 // Key function returns key value.
2071 func (e FatalActionValidationError) Key() bool { return e.key }
2072
2073 // ErrorName returns error name.
2074 func (e FatalActionValidationError) ErrorName() string { return "FatalActionValidationError" }
2075
2076 // Error satisfies the builtin error interface
2077 func (e FatalActionValidationError) Error() string {
2078 cause := ""
2079 if e.cause != nil {
2080 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2081 }
2082
2083 key := ""
2084 if e.key {
2085 key = "key for "
2086 }
2087
2088 return fmt.Sprintf(
2089 "invalid %sFatalAction.%s: %s%s",
2090 key,
2091 e.field,
2092 e.reason,
2093 cause)
2094 }
2095
2096 var _ error = FatalActionValidationError{}
2097
2098 var _ interface {
2099 Field() string
2100 Reason() string
2101 Key() bool
2102 Cause() error
2103 ErrorName() string
2104 } = FatalActionValidationError{}
2105
2106 // Validate checks the field values on Runtime with the rules defined in the
2107 // proto definition for this message. If any rules are violated, the first
2108 // error encountered is returned, or nil if there are no violations.
2109 func (m *Runtime) Validate() error {
2110 return m.validate(false)
2111 }
2112
2113 // ValidateAll checks the field values on Runtime with the rules defined in the
2114 // proto definition for this message. If any rules are violated, the result is
2115 // a list of violation errors wrapped in RuntimeMultiError, or nil if none found.
2116 func (m *Runtime) ValidateAll() error {
2117 return m.validate(true)
2118 }
2119
2120 func (m *Runtime) validate(all bool) error {
2121 if m == nil {
2122 return nil
2123 }
2124
2125 var errors []error
2126
2127 // no validation rules for SymlinkRoot
2128
2129 // no validation rules for Subdirectory
2130
2131 // no validation rules for OverrideSubdirectory
2132
2133 if all {
2134 switch v := interface{}(m.GetBase()).(type) {
2135 case interface{ ValidateAll() error }:
2136 if err := v.ValidateAll(); err != nil {
2137 errors = append(errors, RuntimeValidationError{
2138 field: "Base",
2139 reason: "embedded message failed validation",
2140 cause: err,
2141 })
2142 }
2143 case interface{ Validate() error }:
2144 if err := v.Validate(); err != nil {
2145 errors = append(errors, RuntimeValidationError{
2146 field: "Base",
2147 reason: "embedded message failed validation",
2148 cause: err,
2149 })
2150 }
2151 }
2152 } else if v, ok := interface{}(m.GetBase()).(interface{ Validate() error }); ok {
2153 if err := v.Validate(); err != nil {
2154 return RuntimeValidationError{
2155 field: "Base",
2156 reason: "embedded message failed validation",
2157 cause: err,
2158 }
2159 }
2160 }
2161
2162 if len(errors) > 0 {
2163 return RuntimeMultiError(errors)
2164 }
2165
2166 return nil
2167 }
2168
2169 // RuntimeMultiError is an error wrapping multiple validation errors returned
2170 // by Runtime.ValidateAll() if the designated constraints aren't met.
2171 type RuntimeMultiError []error
2172
2173 // Error returns a concatenation of all the error messages it wraps.
2174 func (m RuntimeMultiError) Error() string {
2175 var msgs []string
2176 for _, err := range m {
2177 msgs = append(msgs, err.Error())
2178 }
2179 return strings.Join(msgs, "; ")
2180 }
2181
2182 // AllErrors returns a list of validation violation errors.
2183 func (m RuntimeMultiError) AllErrors() []error { return m }
2184
2185 // RuntimeValidationError is the validation error returned by Runtime.Validate
2186 // if the designated constraints aren't met.
2187 type RuntimeValidationError struct {
2188 field string
2189 reason string
2190 cause error
2191 key bool
2192 }
2193
2194 // Field function returns field value.
2195 func (e RuntimeValidationError) Field() string { return e.field }
2196
2197 // Reason function returns reason value.
2198 func (e RuntimeValidationError) Reason() string { return e.reason }
2199
2200 // Cause function returns cause value.
2201 func (e RuntimeValidationError) Cause() error { return e.cause }
2202
2203 // Key function returns key value.
2204 func (e RuntimeValidationError) Key() bool { return e.key }
2205
2206 // ErrorName returns error name.
2207 func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" }
2208
2209 // Error satisfies the builtin error interface
2210 func (e RuntimeValidationError) Error() string {
2211 cause := ""
2212 if e.cause != nil {
2213 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2214 }
2215
2216 key := ""
2217 if e.key {
2218 key = "key for "
2219 }
2220
2221 return fmt.Sprintf(
2222 "invalid %sRuntime.%s: %s%s",
2223 key,
2224 e.field,
2225 e.reason,
2226 cause)
2227 }
2228
2229 var _ error = RuntimeValidationError{}
2230
2231 var _ interface {
2232 Field() string
2233 Reason() string
2234 Key() bool
2235 Cause() error
2236 ErrorName() string
2237 } = RuntimeValidationError{}
2238
2239 // Validate checks the field values on RuntimeLayer with the rules defined in
2240 // the proto definition for this message. If any rules are violated, the first
2241 // error encountered is returned, or nil if there are no violations.
2242 func (m *RuntimeLayer) Validate() error {
2243 return m.validate(false)
2244 }
2245
2246 // ValidateAll checks the field values on RuntimeLayer with the rules defined
2247 // in the proto definition for this message. If any rules are violated, the
2248 // result is a list of violation errors wrapped in RuntimeLayerMultiError, or
2249 // nil if none found.
2250 func (m *RuntimeLayer) ValidateAll() error {
2251 return m.validate(true)
2252 }
2253
2254 func (m *RuntimeLayer) validate(all bool) error {
2255 if m == nil {
2256 return nil
2257 }
2258
2259 var errors []error
2260
2261 if utf8.RuneCountInString(m.GetName()) < 1 {
2262 err := RuntimeLayerValidationError{
2263 field: "Name",
2264 reason: "value length must be at least 1 runes",
2265 }
2266 if !all {
2267 return err
2268 }
2269 errors = append(errors, err)
2270 }
2271
2272 oneofLayerSpecifierPresent := false
2273 switch v := m.LayerSpecifier.(type) {
2274 case *RuntimeLayer_StaticLayer:
2275 if v == nil {
2276 err := RuntimeLayerValidationError{
2277 field: "LayerSpecifier",
2278 reason: "oneof value cannot be a typed-nil",
2279 }
2280 if !all {
2281 return err
2282 }
2283 errors = append(errors, err)
2284 }
2285 oneofLayerSpecifierPresent = true
2286
2287 if all {
2288 switch v := interface{}(m.GetStaticLayer()).(type) {
2289 case interface{ ValidateAll() error }:
2290 if err := v.ValidateAll(); err != nil {
2291 errors = append(errors, RuntimeLayerValidationError{
2292 field: "StaticLayer",
2293 reason: "embedded message failed validation",
2294 cause: err,
2295 })
2296 }
2297 case interface{ Validate() error }:
2298 if err := v.Validate(); err != nil {
2299 errors = append(errors, RuntimeLayerValidationError{
2300 field: "StaticLayer",
2301 reason: "embedded message failed validation",
2302 cause: err,
2303 })
2304 }
2305 }
2306 } else if v, ok := interface{}(m.GetStaticLayer()).(interface{ Validate() error }); ok {
2307 if err := v.Validate(); err != nil {
2308 return RuntimeLayerValidationError{
2309 field: "StaticLayer",
2310 reason: "embedded message failed validation",
2311 cause: err,
2312 }
2313 }
2314 }
2315
2316 case *RuntimeLayer_DiskLayer_:
2317 if v == nil {
2318 err := RuntimeLayerValidationError{
2319 field: "LayerSpecifier",
2320 reason: "oneof value cannot be a typed-nil",
2321 }
2322 if !all {
2323 return err
2324 }
2325 errors = append(errors, err)
2326 }
2327 oneofLayerSpecifierPresent = true
2328
2329 if all {
2330 switch v := interface{}(m.GetDiskLayer()).(type) {
2331 case interface{ ValidateAll() error }:
2332 if err := v.ValidateAll(); err != nil {
2333 errors = append(errors, RuntimeLayerValidationError{
2334 field: "DiskLayer",
2335 reason: "embedded message failed validation",
2336 cause: err,
2337 })
2338 }
2339 case interface{ Validate() error }:
2340 if err := v.Validate(); err != nil {
2341 errors = append(errors, RuntimeLayerValidationError{
2342 field: "DiskLayer",
2343 reason: "embedded message failed validation",
2344 cause: err,
2345 })
2346 }
2347 }
2348 } else if v, ok := interface{}(m.GetDiskLayer()).(interface{ Validate() error }); ok {
2349 if err := v.Validate(); err != nil {
2350 return RuntimeLayerValidationError{
2351 field: "DiskLayer",
2352 reason: "embedded message failed validation",
2353 cause: err,
2354 }
2355 }
2356 }
2357
2358 case *RuntimeLayer_AdminLayer_:
2359 if v == nil {
2360 err := RuntimeLayerValidationError{
2361 field: "LayerSpecifier",
2362 reason: "oneof value cannot be a typed-nil",
2363 }
2364 if !all {
2365 return err
2366 }
2367 errors = append(errors, err)
2368 }
2369 oneofLayerSpecifierPresent = true
2370
2371 if all {
2372 switch v := interface{}(m.GetAdminLayer()).(type) {
2373 case interface{ ValidateAll() error }:
2374 if err := v.ValidateAll(); err != nil {
2375 errors = append(errors, RuntimeLayerValidationError{
2376 field: "AdminLayer",
2377 reason: "embedded message failed validation",
2378 cause: err,
2379 })
2380 }
2381 case interface{ Validate() error }:
2382 if err := v.Validate(); err != nil {
2383 errors = append(errors, RuntimeLayerValidationError{
2384 field: "AdminLayer",
2385 reason: "embedded message failed validation",
2386 cause: err,
2387 })
2388 }
2389 }
2390 } else if v, ok := interface{}(m.GetAdminLayer()).(interface{ Validate() error }); ok {
2391 if err := v.Validate(); err != nil {
2392 return RuntimeLayerValidationError{
2393 field: "AdminLayer",
2394 reason: "embedded message failed validation",
2395 cause: err,
2396 }
2397 }
2398 }
2399
2400 case *RuntimeLayer_RtdsLayer_:
2401 if v == nil {
2402 err := RuntimeLayerValidationError{
2403 field: "LayerSpecifier",
2404 reason: "oneof value cannot be a typed-nil",
2405 }
2406 if !all {
2407 return err
2408 }
2409 errors = append(errors, err)
2410 }
2411 oneofLayerSpecifierPresent = true
2412
2413 if all {
2414 switch v := interface{}(m.GetRtdsLayer()).(type) {
2415 case interface{ ValidateAll() error }:
2416 if err := v.ValidateAll(); err != nil {
2417 errors = append(errors, RuntimeLayerValidationError{
2418 field: "RtdsLayer",
2419 reason: "embedded message failed validation",
2420 cause: err,
2421 })
2422 }
2423 case interface{ Validate() error }:
2424 if err := v.Validate(); err != nil {
2425 errors = append(errors, RuntimeLayerValidationError{
2426 field: "RtdsLayer",
2427 reason: "embedded message failed validation",
2428 cause: err,
2429 })
2430 }
2431 }
2432 } else if v, ok := interface{}(m.GetRtdsLayer()).(interface{ Validate() error }); ok {
2433 if err := v.Validate(); err != nil {
2434 return RuntimeLayerValidationError{
2435 field: "RtdsLayer",
2436 reason: "embedded message failed validation",
2437 cause: err,
2438 }
2439 }
2440 }
2441
2442 default:
2443 _ = v // ensures v is used
2444 }
2445 if !oneofLayerSpecifierPresent {
2446 err := RuntimeLayerValidationError{
2447 field: "LayerSpecifier",
2448 reason: "value is required",
2449 }
2450 if !all {
2451 return err
2452 }
2453 errors = append(errors, err)
2454 }
2455
2456 if len(errors) > 0 {
2457 return RuntimeLayerMultiError(errors)
2458 }
2459
2460 return nil
2461 }
2462
2463 // RuntimeLayerMultiError is an error wrapping multiple validation errors
2464 // returned by RuntimeLayer.ValidateAll() if the designated constraints aren't met.
2465 type RuntimeLayerMultiError []error
2466
2467 // Error returns a concatenation of all the error messages it wraps.
2468 func (m RuntimeLayerMultiError) Error() string {
2469 var msgs []string
2470 for _, err := range m {
2471 msgs = append(msgs, err.Error())
2472 }
2473 return strings.Join(msgs, "; ")
2474 }
2475
2476 // AllErrors returns a list of validation violation errors.
2477 func (m RuntimeLayerMultiError) AllErrors() []error { return m }
2478
2479 // RuntimeLayerValidationError is the validation error returned by
2480 // RuntimeLayer.Validate if the designated constraints aren't met.
2481 type RuntimeLayerValidationError struct {
2482 field string
2483 reason string
2484 cause error
2485 key bool
2486 }
2487
2488 // Field function returns field value.
2489 func (e RuntimeLayerValidationError) Field() string { return e.field }
2490
2491 // Reason function returns reason value.
2492 func (e RuntimeLayerValidationError) Reason() string { return e.reason }
2493
2494 // Cause function returns cause value.
2495 func (e RuntimeLayerValidationError) Cause() error { return e.cause }
2496
2497 // Key function returns key value.
2498 func (e RuntimeLayerValidationError) Key() bool { return e.key }
2499
2500 // ErrorName returns error name.
2501 func (e RuntimeLayerValidationError) ErrorName() string { return "RuntimeLayerValidationError" }
2502
2503 // Error satisfies the builtin error interface
2504 func (e RuntimeLayerValidationError) Error() string {
2505 cause := ""
2506 if e.cause != nil {
2507 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2508 }
2509
2510 key := ""
2511 if e.key {
2512 key = "key for "
2513 }
2514
2515 return fmt.Sprintf(
2516 "invalid %sRuntimeLayer.%s: %s%s",
2517 key,
2518 e.field,
2519 e.reason,
2520 cause)
2521 }
2522
2523 var _ error = RuntimeLayerValidationError{}
2524
2525 var _ interface {
2526 Field() string
2527 Reason() string
2528 Key() bool
2529 Cause() error
2530 ErrorName() string
2531 } = RuntimeLayerValidationError{}
2532
2533 // Validate checks the field values on LayeredRuntime with the rules defined in
2534 // the proto definition for this message. If any rules are violated, the first
2535 // error encountered is returned, or nil if there are no violations.
2536 func (m *LayeredRuntime) Validate() error {
2537 return m.validate(false)
2538 }
2539
2540 // ValidateAll checks the field values on LayeredRuntime with the rules defined
2541 // in the proto definition for this message. If any rules are violated, the
2542 // result is a list of violation errors wrapped in LayeredRuntimeMultiError,
2543 // or nil if none found.
2544 func (m *LayeredRuntime) ValidateAll() error {
2545 return m.validate(true)
2546 }
2547
2548 func (m *LayeredRuntime) validate(all bool) error {
2549 if m == nil {
2550 return nil
2551 }
2552
2553 var errors []error
2554
2555 for idx, item := range m.GetLayers() {
2556 _, _ = idx, item
2557
2558 if all {
2559 switch v := interface{}(item).(type) {
2560 case interface{ ValidateAll() error }:
2561 if err := v.ValidateAll(); err != nil {
2562 errors = append(errors, LayeredRuntimeValidationError{
2563 field: fmt.Sprintf("Layers[%v]", idx),
2564 reason: "embedded message failed validation",
2565 cause: err,
2566 })
2567 }
2568 case interface{ Validate() error }:
2569 if err := v.Validate(); err != nil {
2570 errors = append(errors, LayeredRuntimeValidationError{
2571 field: fmt.Sprintf("Layers[%v]", idx),
2572 reason: "embedded message failed validation",
2573 cause: err,
2574 })
2575 }
2576 }
2577 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
2578 if err := v.Validate(); err != nil {
2579 return LayeredRuntimeValidationError{
2580 field: fmt.Sprintf("Layers[%v]", idx),
2581 reason: "embedded message failed validation",
2582 cause: err,
2583 }
2584 }
2585 }
2586
2587 }
2588
2589 if len(errors) > 0 {
2590 return LayeredRuntimeMultiError(errors)
2591 }
2592
2593 return nil
2594 }
2595
2596 // LayeredRuntimeMultiError is an error wrapping multiple validation errors
2597 // returned by LayeredRuntime.ValidateAll() if the designated constraints
2598 // aren't met.
2599 type LayeredRuntimeMultiError []error
2600
2601 // Error returns a concatenation of all the error messages it wraps.
2602 func (m LayeredRuntimeMultiError) Error() string {
2603 var msgs []string
2604 for _, err := range m {
2605 msgs = append(msgs, err.Error())
2606 }
2607 return strings.Join(msgs, "; ")
2608 }
2609
2610 // AllErrors returns a list of validation violation errors.
2611 func (m LayeredRuntimeMultiError) AllErrors() []error { return m }
2612
2613 // LayeredRuntimeValidationError is the validation error returned by
2614 // LayeredRuntime.Validate if the designated constraints aren't met.
2615 type LayeredRuntimeValidationError struct {
2616 field string
2617 reason string
2618 cause error
2619 key bool
2620 }
2621
2622 // Field function returns field value.
2623 func (e LayeredRuntimeValidationError) Field() string { return e.field }
2624
2625 // Reason function returns reason value.
2626 func (e LayeredRuntimeValidationError) Reason() string { return e.reason }
2627
2628 // Cause function returns cause value.
2629 func (e LayeredRuntimeValidationError) Cause() error { return e.cause }
2630
2631 // Key function returns key value.
2632 func (e LayeredRuntimeValidationError) Key() bool { return e.key }
2633
2634 // ErrorName returns error name.
2635 func (e LayeredRuntimeValidationError) ErrorName() string { return "LayeredRuntimeValidationError" }
2636
2637 // Error satisfies the builtin error interface
2638 func (e LayeredRuntimeValidationError) Error() string {
2639 cause := ""
2640 if e.cause != nil {
2641 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2642 }
2643
2644 key := ""
2645 if e.key {
2646 key = "key for "
2647 }
2648
2649 return fmt.Sprintf(
2650 "invalid %sLayeredRuntime.%s: %s%s",
2651 key,
2652 e.field,
2653 e.reason,
2654 cause)
2655 }
2656
2657 var _ error = LayeredRuntimeValidationError{}
2658
2659 var _ interface {
2660 Field() string
2661 Reason() string
2662 Key() bool
2663 Cause() error
2664 ErrorName() string
2665 } = LayeredRuntimeValidationError{}
2666
2667 // Validate checks the field values on CustomInlineHeader with the rules
2668 // defined in the proto definition for this message. If any rules are
2669 // violated, the first error encountered is returned, or nil if there are no violations.
2670 func (m *CustomInlineHeader) Validate() error {
2671 return m.validate(false)
2672 }
2673
2674 // ValidateAll checks the field values on CustomInlineHeader with the rules
2675 // defined in the proto definition for this message. If any rules are
2676 // violated, the result is a list of violation errors wrapped in
2677 // CustomInlineHeaderMultiError, or nil if none found.
2678 func (m *CustomInlineHeader) ValidateAll() error {
2679 return m.validate(true)
2680 }
2681
2682 func (m *CustomInlineHeader) validate(all bool) error {
2683 if m == nil {
2684 return nil
2685 }
2686
2687 var errors []error
2688
2689 if utf8.RuneCountInString(m.GetInlineHeaderName()) < 1 {
2690 err := CustomInlineHeaderValidationError{
2691 field: "InlineHeaderName",
2692 reason: "value length must be at least 1 runes",
2693 }
2694 if !all {
2695 return err
2696 }
2697 errors = append(errors, err)
2698 }
2699
2700 if !_CustomInlineHeader_InlineHeaderName_Pattern.MatchString(m.GetInlineHeaderName()) {
2701 err := CustomInlineHeaderValidationError{
2702 field: "InlineHeaderName",
2703 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
2704 }
2705 if !all {
2706 return err
2707 }
2708 errors = append(errors, err)
2709 }
2710
2711 if _, ok := CustomInlineHeader_InlineHeaderType_name[int32(m.GetInlineHeaderType())]; !ok {
2712 err := CustomInlineHeaderValidationError{
2713 field: "InlineHeaderType",
2714 reason: "value must be one of the defined enum values",
2715 }
2716 if !all {
2717 return err
2718 }
2719 errors = append(errors, err)
2720 }
2721
2722 if len(errors) > 0 {
2723 return CustomInlineHeaderMultiError(errors)
2724 }
2725
2726 return nil
2727 }
2728
2729 // CustomInlineHeaderMultiError is an error wrapping multiple validation errors
2730 // returned by CustomInlineHeader.ValidateAll() if the designated constraints
2731 // aren't met.
2732 type CustomInlineHeaderMultiError []error
2733
2734 // Error returns a concatenation of all the error messages it wraps.
2735 func (m CustomInlineHeaderMultiError) Error() string {
2736 var msgs []string
2737 for _, err := range m {
2738 msgs = append(msgs, err.Error())
2739 }
2740 return strings.Join(msgs, "; ")
2741 }
2742
2743 // AllErrors returns a list of validation violation errors.
2744 func (m CustomInlineHeaderMultiError) AllErrors() []error { return m }
2745
2746 // CustomInlineHeaderValidationError is the validation error returned by
2747 // CustomInlineHeader.Validate if the designated constraints aren't met.
2748 type CustomInlineHeaderValidationError struct {
2749 field string
2750 reason string
2751 cause error
2752 key bool
2753 }
2754
2755 // Field function returns field value.
2756 func (e CustomInlineHeaderValidationError) Field() string { return e.field }
2757
2758 // Reason function returns reason value.
2759 func (e CustomInlineHeaderValidationError) Reason() string { return e.reason }
2760
2761 // Cause function returns cause value.
2762 func (e CustomInlineHeaderValidationError) Cause() error { return e.cause }
2763
2764 // Key function returns key value.
2765 func (e CustomInlineHeaderValidationError) Key() bool { return e.key }
2766
2767 // ErrorName returns error name.
2768 func (e CustomInlineHeaderValidationError) ErrorName() string {
2769 return "CustomInlineHeaderValidationError"
2770 }
2771
2772 // Error satisfies the builtin error interface
2773 func (e CustomInlineHeaderValidationError) Error() string {
2774 cause := ""
2775 if e.cause != nil {
2776 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2777 }
2778
2779 key := ""
2780 if e.key {
2781 key = "key for "
2782 }
2783
2784 return fmt.Sprintf(
2785 "invalid %sCustomInlineHeader.%s: %s%s",
2786 key,
2787 e.field,
2788 e.reason,
2789 cause)
2790 }
2791
2792 var _ error = CustomInlineHeaderValidationError{}
2793
2794 var _ interface {
2795 Field() string
2796 Reason() string
2797 Key() bool
2798 Cause() error
2799 ErrorName() string
2800 } = CustomInlineHeaderValidationError{}
2801
2802 var _CustomInlineHeader_InlineHeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
2803
2804 // Validate checks the field values on MemoryAllocatorManager with the rules
2805 // defined in the proto definition for this message. If any rules are
2806 // violated, the first error encountered is returned, or nil if there are no violations.
2807 func (m *MemoryAllocatorManager) Validate() error {
2808 return m.validate(false)
2809 }
2810
2811 // ValidateAll checks the field values on MemoryAllocatorManager with the rules
2812 // defined in the proto definition for this message. If any rules are
2813 // violated, the result is a list of violation errors wrapped in
2814 // MemoryAllocatorManagerMultiError, or nil if none found.
2815 func (m *MemoryAllocatorManager) ValidateAll() error {
2816 return m.validate(true)
2817 }
2818
2819 func (m *MemoryAllocatorManager) validate(all bool) error {
2820 if m == nil {
2821 return nil
2822 }
2823
2824 var errors []error
2825
2826 // no validation rules for BytesToRelease
2827
2828 if all {
2829 switch v := interface{}(m.GetMemoryReleaseInterval()).(type) {
2830 case interface{ ValidateAll() error }:
2831 if err := v.ValidateAll(); err != nil {
2832 errors = append(errors, MemoryAllocatorManagerValidationError{
2833 field: "MemoryReleaseInterval",
2834 reason: "embedded message failed validation",
2835 cause: err,
2836 })
2837 }
2838 case interface{ Validate() error }:
2839 if err := v.Validate(); err != nil {
2840 errors = append(errors, MemoryAllocatorManagerValidationError{
2841 field: "MemoryReleaseInterval",
2842 reason: "embedded message failed validation",
2843 cause: err,
2844 })
2845 }
2846 }
2847 } else if v, ok := interface{}(m.GetMemoryReleaseInterval()).(interface{ Validate() error }); ok {
2848 if err := v.Validate(); err != nil {
2849 return MemoryAllocatorManagerValidationError{
2850 field: "MemoryReleaseInterval",
2851 reason: "embedded message failed validation",
2852 cause: err,
2853 }
2854 }
2855 }
2856
2857 if len(errors) > 0 {
2858 return MemoryAllocatorManagerMultiError(errors)
2859 }
2860
2861 return nil
2862 }
2863
2864 // MemoryAllocatorManagerMultiError is an error wrapping multiple validation
2865 // errors returned by MemoryAllocatorManager.ValidateAll() if the designated
2866 // constraints aren't met.
2867 type MemoryAllocatorManagerMultiError []error
2868
2869 // Error returns a concatenation of all the error messages it wraps.
2870 func (m MemoryAllocatorManagerMultiError) Error() string {
2871 var msgs []string
2872 for _, err := range m {
2873 msgs = append(msgs, err.Error())
2874 }
2875 return strings.Join(msgs, "; ")
2876 }
2877
2878 // AllErrors returns a list of validation violation errors.
2879 func (m MemoryAllocatorManagerMultiError) AllErrors() []error { return m }
2880
2881 // MemoryAllocatorManagerValidationError is the validation error returned by
2882 // MemoryAllocatorManager.Validate if the designated constraints aren't met.
2883 type MemoryAllocatorManagerValidationError struct {
2884 field string
2885 reason string
2886 cause error
2887 key bool
2888 }
2889
2890 // Field function returns field value.
2891 func (e MemoryAllocatorManagerValidationError) Field() string { return e.field }
2892
2893 // Reason function returns reason value.
2894 func (e MemoryAllocatorManagerValidationError) Reason() string { return e.reason }
2895
2896 // Cause function returns cause value.
2897 func (e MemoryAllocatorManagerValidationError) Cause() error { return e.cause }
2898
2899 // Key function returns key value.
2900 func (e MemoryAllocatorManagerValidationError) Key() bool { return e.key }
2901
2902 // ErrorName returns error name.
2903 func (e MemoryAllocatorManagerValidationError) ErrorName() string {
2904 return "MemoryAllocatorManagerValidationError"
2905 }
2906
2907 // Error satisfies the builtin error interface
2908 func (e MemoryAllocatorManagerValidationError) Error() string {
2909 cause := ""
2910 if e.cause != nil {
2911 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2912 }
2913
2914 key := ""
2915 if e.key {
2916 key = "key for "
2917 }
2918
2919 return fmt.Sprintf(
2920 "invalid %sMemoryAllocatorManager.%s: %s%s",
2921 key,
2922 e.field,
2923 e.reason,
2924 cause)
2925 }
2926
2927 var _ error = MemoryAllocatorManagerValidationError{}
2928
2929 var _ interface {
2930 Field() string
2931 Reason() string
2932 Key() bool
2933 Cause() error
2934 ErrorName() string
2935 } = MemoryAllocatorManagerValidationError{}
2936
2937 // Validate checks the field values on Bootstrap_StaticResources with the rules
2938 // defined in the proto definition for this message. If any rules are
2939 // violated, the first error encountered is returned, or nil if there are no violations.
2940 func (m *Bootstrap_StaticResources) Validate() error {
2941 return m.validate(false)
2942 }
2943
2944 // ValidateAll checks the field values on Bootstrap_StaticResources with the
2945 // rules defined in the proto definition for this message. If any rules are
2946 // violated, the result is a list of violation errors wrapped in
2947 // Bootstrap_StaticResourcesMultiError, or nil if none found.
2948 func (m *Bootstrap_StaticResources) ValidateAll() error {
2949 return m.validate(true)
2950 }
2951
2952 func (m *Bootstrap_StaticResources) validate(all bool) error {
2953 if m == nil {
2954 return nil
2955 }
2956
2957 var errors []error
2958
2959 for idx, item := range m.GetListeners() {
2960 _, _ = idx, item
2961
2962 if all {
2963 switch v := interface{}(item).(type) {
2964 case interface{ ValidateAll() error }:
2965 if err := v.ValidateAll(); err != nil {
2966 errors = append(errors, Bootstrap_StaticResourcesValidationError{
2967 field: fmt.Sprintf("Listeners[%v]", idx),
2968 reason: "embedded message failed validation",
2969 cause: err,
2970 })
2971 }
2972 case interface{ Validate() error }:
2973 if err := v.Validate(); err != nil {
2974 errors = append(errors, Bootstrap_StaticResourcesValidationError{
2975 field: fmt.Sprintf("Listeners[%v]", idx),
2976 reason: "embedded message failed validation",
2977 cause: err,
2978 })
2979 }
2980 }
2981 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
2982 if err := v.Validate(); err != nil {
2983 return Bootstrap_StaticResourcesValidationError{
2984 field: fmt.Sprintf("Listeners[%v]", idx),
2985 reason: "embedded message failed validation",
2986 cause: err,
2987 }
2988 }
2989 }
2990
2991 }
2992
2993 for idx, item := range m.GetClusters() {
2994 _, _ = idx, item
2995
2996 if all {
2997 switch v := interface{}(item).(type) {
2998 case interface{ ValidateAll() error }:
2999 if err := v.ValidateAll(); err != nil {
3000 errors = append(errors, Bootstrap_StaticResourcesValidationError{
3001 field: fmt.Sprintf("Clusters[%v]", idx),
3002 reason: "embedded message failed validation",
3003 cause: err,
3004 })
3005 }
3006 case interface{ Validate() error }:
3007 if err := v.Validate(); err != nil {
3008 errors = append(errors, Bootstrap_StaticResourcesValidationError{
3009 field: fmt.Sprintf("Clusters[%v]", idx),
3010 reason: "embedded message failed validation",
3011 cause: err,
3012 })
3013 }
3014 }
3015 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
3016 if err := v.Validate(); err != nil {
3017 return Bootstrap_StaticResourcesValidationError{
3018 field: fmt.Sprintf("Clusters[%v]", idx),
3019 reason: "embedded message failed validation",
3020 cause: err,
3021 }
3022 }
3023 }
3024
3025 }
3026
3027 for idx, item := range m.GetSecrets() {
3028 _, _ = idx, item
3029
3030 if all {
3031 switch v := interface{}(item).(type) {
3032 case interface{ ValidateAll() error }:
3033 if err := v.ValidateAll(); err != nil {
3034 errors = append(errors, Bootstrap_StaticResourcesValidationError{
3035 field: fmt.Sprintf("Secrets[%v]", idx),
3036 reason: "embedded message failed validation",
3037 cause: err,
3038 })
3039 }
3040 case interface{ Validate() error }:
3041 if err := v.Validate(); err != nil {
3042 errors = append(errors, Bootstrap_StaticResourcesValidationError{
3043 field: fmt.Sprintf("Secrets[%v]", idx),
3044 reason: "embedded message failed validation",
3045 cause: err,
3046 })
3047 }
3048 }
3049 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
3050 if err := v.Validate(); err != nil {
3051 return Bootstrap_StaticResourcesValidationError{
3052 field: fmt.Sprintf("Secrets[%v]", idx),
3053 reason: "embedded message failed validation",
3054 cause: err,
3055 }
3056 }
3057 }
3058
3059 }
3060
3061 if len(errors) > 0 {
3062 return Bootstrap_StaticResourcesMultiError(errors)
3063 }
3064
3065 return nil
3066 }
3067
3068 // Bootstrap_StaticResourcesMultiError is an error wrapping multiple validation
3069 // errors returned by Bootstrap_StaticResources.ValidateAll() if the
3070 // designated constraints aren't met.
3071 type Bootstrap_StaticResourcesMultiError []error
3072
3073 // Error returns a concatenation of all the error messages it wraps.
3074 func (m Bootstrap_StaticResourcesMultiError) Error() string {
3075 var msgs []string
3076 for _, err := range m {
3077 msgs = append(msgs, err.Error())
3078 }
3079 return strings.Join(msgs, "; ")
3080 }
3081
3082 // AllErrors returns a list of validation violation errors.
3083 func (m Bootstrap_StaticResourcesMultiError) AllErrors() []error { return m }
3084
3085 // Bootstrap_StaticResourcesValidationError is the validation error returned by
3086 // Bootstrap_StaticResources.Validate if the designated constraints aren't met.
3087 type Bootstrap_StaticResourcesValidationError struct {
3088 field string
3089 reason string
3090 cause error
3091 key bool
3092 }
3093
3094 // Field function returns field value.
3095 func (e Bootstrap_StaticResourcesValidationError) Field() string { return e.field }
3096
3097 // Reason function returns reason value.
3098 func (e Bootstrap_StaticResourcesValidationError) Reason() string { return e.reason }
3099
3100 // Cause function returns cause value.
3101 func (e Bootstrap_StaticResourcesValidationError) Cause() error { return e.cause }
3102
3103 // Key function returns key value.
3104 func (e Bootstrap_StaticResourcesValidationError) Key() bool { return e.key }
3105
3106 // ErrorName returns error name.
3107 func (e Bootstrap_StaticResourcesValidationError) ErrorName() string {
3108 return "Bootstrap_StaticResourcesValidationError"
3109 }
3110
3111 // Error satisfies the builtin error interface
3112 func (e Bootstrap_StaticResourcesValidationError) Error() string {
3113 cause := ""
3114 if e.cause != nil {
3115 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3116 }
3117
3118 key := ""
3119 if e.key {
3120 key = "key for "
3121 }
3122
3123 return fmt.Sprintf(
3124 "invalid %sBootstrap_StaticResources.%s: %s%s",
3125 key,
3126 e.field,
3127 e.reason,
3128 cause)
3129 }
3130
3131 var _ error = Bootstrap_StaticResourcesValidationError{}
3132
3133 var _ interface {
3134 Field() string
3135 Reason() string
3136 Key() bool
3137 Cause() error
3138 ErrorName() string
3139 } = Bootstrap_StaticResourcesValidationError{}
3140
3141 // Validate checks the field values on Bootstrap_DynamicResources with the
3142 // rules defined in the proto definition for this message. If any rules are
3143 // violated, the first error encountered is returned, or nil if there are no violations.
3144 func (m *Bootstrap_DynamicResources) Validate() error {
3145 return m.validate(false)
3146 }
3147
3148 // ValidateAll checks the field values on Bootstrap_DynamicResources with the
3149 // rules defined in the proto definition for this message. If any rules are
3150 // violated, the result is a list of violation errors wrapped in
3151 // Bootstrap_DynamicResourcesMultiError, or nil if none found.
3152 func (m *Bootstrap_DynamicResources) ValidateAll() error {
3153 return m.validate(true)
3154 }
3155
3156 func (m *Bootstrap_DynamicResources) validate(all bool) error {
3157 if m == nil {
3158 return nil
3159 }
3160
3161 var errors []error
3162
3163 if all {
3164 switch v := interface{}(m.GetLdsConfig()).(type) {
3165 case interface{ ValidateAll() error }:
3166 if err := v.ValidateAll(); err != nil {
3167 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
3168 field: "LdsConfig",
3169 reason: "embedded message failed validation",
3170 cause: err,
3171 })
3172 }
3173 case interface{ Validate() error }:
3174 if err := v.Validate(); err != nil {
3175 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
3176 field: "LdsConfig",
3177 reason: "embedded message failed validation",
3178 cause: err,
3179 })
3180 }
3181 }
3182 } else if v, ok := interface{}(m.GetLdsConfig()).(interface{ Validate() error }); ok {
3183 if err := v.Validate(); err != nil {
3184 return Bootstrap_DynamicResourcesValidationError{
3185 field: "LdsConfig",
3186 reason: "embedded message failed validation",
3187 cause: err,
3188 }
3189 }
3190 }
3191
3192 // no validation rules for LdsResourcesLocator
3193
3194 if all {
3195 switch v := interface{}(m.GetCdsConfig()).(type) {
3196 case interface{ ValidateAll() error }:
3197 if err := v.ValidateAll(); err != nil {
3198 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
3199 field: "CdsConfig",
3200 reason: "embedded message failed validation",
3201 cause: err,
3202 })
3203 }
3204 case interface{ Validate() error }:
3205 if err := v.Validate(); err != nil {
3206 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
3207 field: "CdsConfig",
3208 reason: "embedded message failed validation",
3209 cause: err,
3210 })
3211 }
3212 }
3213 } else if v, ok := interface{}(m.GetCdsConfig()).(interface{ Validate() error }); ok {
3214 if err := v.Validate(); err != nil {
3215 return Bootstrap_DynamicResourcesValidationError{
3216 field: "CdsConfig",
3217 reason: "embedded message failed validation",
3218 cause: err,
3219 }
3220 }
3221 }
3222
3223 // no validation rules for CdsResourcesLocator
3224
3225 if all {
3226 switch v := interface{}(m.GetAdsConfig()).(type) {
3227 case interface{ ValidateAll() error }:
3228 if err := v.ValidateAll(); err != nil {
3229 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
3230 field: "AdsConfig",
3231 reason: "embedded message failed validation",
3232 cause: err,
3233 })
3234 }
3235 case interface{ Validate() error }:
3236 if err := v.Validate(); err != nil {
3237 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
3238 field: "AdsConfig",
3239 reason: "embedded message failed validation",
3240 cause: err,
3241 })
3242 }
3243 }
3244 } else if v, ok := interface{}(m.GetAdsConfig()).(interface{ Validate() error }); ok {
3245 if err := v.Validate(); err != nil {
3246 return Bootstrap_DynamicResourcesValidationError{
3247 field: "AdsConfig",
3248 reason: "embedded message failed validation",
3249 cause: err,
3250 }
3251 }
3252 }
3253
3254 if len(errors) > 0 {
3255 return Bootstrap_DynamicResourcesMultiError(errors)
3256 }
3257
3258 return nil
3259 }
3260
3261 // Bootstrap_DynamicResourcesMultiError is an error wrapping multiple
3262 // validation errors returned by Bootstrap_DynamicResources.ValidateAll() if
3263 // the designated constraints aren't met.
3264 type Bootstrap_DynamicResourcesMultiError []error
3265
3266 // Error returns a concatenation of all the error messages it wraps.
3267 func (m Bootstrap_DynamicResourcesMultiError) Error() string {
3268 var msgs []string
3269 for _, err := range m {
3270 msgs = append(msgs, err.Error())
3271 }
3272 return strings.Join(msgs, "; ")
3273 }
3274
3275 // AllErrors returns a list of validation violation errors.
3276 func (m Bootstrap_DynamicResourcesMultiError) AllErrors() []error { return m }
3277
3278 // Bootstrap_DynamicResourcesValidationError is the validation error returned
3279 // by Bootstrap_DynamicResources.Validate if the designated constraints aren't met.
3280 type Bootstrap_DynamicResourcesValidationError struct {
3281 field string
3282 reason string
3283 cause error
3284 key bool
3285 }
3286
3287 // Field function returns field value.
3288 func (e Bootstrap_DynamicResourcesValidationError) Field() string { return e.field }
3289
3290 // Reason function returns reason value.
3291 func (e Bootstrap_DynamicResourcesValidationError) Reason() string { return e.reason }
3292
3293 // Cause function returns cause value.
3294 func (e Bootstrap_DynamicResourcesValidationError) Cause() error { return e.cause }
3295
3296 // Key function returns key value.
3297 func (e Bootstrap_DynamicResourcesValidationError) Key() bool { return e.key }
3298
3299 // ErrorName returns error name.
3300 func (e Bootstrap_DynamicResourcesValidationError) ErrorName() string {
3301 return "Bootstrap_DynamicResourcesValidationError"
3302 }
3303
3304 // Error satisfies the builtin error interface
3305 func (e Bootstrap_DynamicResourcesValidationError) Error() string {
3306 cause := ""
3307 if e.cause != nil {
3308 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3309 }
3310
3311 key := ""
3312 if e.key {
3313 key = "key for "
3314 }
3315
3316 return fmt.Sprintf(
3317 "invalid %sBootstrap_DynamicResources.%s: %s%s",
3318 key,
3319 e.field,
3320 e.reason,
3321 cause)
3322 }
3323
3324 var _ error = Bootstrap_DynamicResourcesValidationError{}
3325
3326 var _ interface {
3327 Field() string
3328 Reason() string
3329 Key() bool
3330 Cause() error
3331 ErrorName() string
3332 } = Bootstrap_DynamicResourcesValidationError{}
3333
3334 // Validate checks the field values on Bootstrap_ApplicationLogConfig with the
3335 // rules defined in the proto definition for this message. If any rules are
3336 // violated, the first error encountered is returned, or nil if there are no violations.
3337 func (m *Bootstrap_ApplicationLogConfig) Validate() error {
3338 return m.validate(false)
3339 }
3340
3341 // ValidateAll checks the field values on Bootstrap_ApplicationLogConfig with
3342 // the rules defined in the proto definition for this message. If any rules
3343 // are violated, the result is a list of violation errors wrapped in
3344 // Bootstrap_ApplicationLogConfigMultiError, or nil if none found.
3345 func (m *Bootstrap_ApplicationLogConfig) ValidateAll() error {
3346 return m.validate(true)
3347 }
3348
3349 func (m *Bootstrap_ApplicationLogConfig) validate(all bool) error {
3350 if m == nil {
3351 return nil
3352 }
3353
3354 var errors []error
3355
3356 if all {
3357 switch v := interface{}(m.GetLogFormat()).(type) {
3358 case interface{ ValidateAll() error }:
3359 if err := v.ValidateAll(); err != nil {
3360 errors = append(errors, Bootstrap_ApplicationLogConfigValidationError{
3361 field: "LogFormat",
3362 reason: "embedded message failed validation",
3363 cause: err,
3364 })
3365 }
3366 case interface{ Validate() error }:
3367 if err := v.Validate(); err != nil {
3368 errors = append(errors, Bootstrap_ApplicationLogConfigValidationError{
3369 field: "LogFormat",
3370 reason: "embedded message failed validation",
3371 cause: err,
3372 })
3373 }
3374 }
3375 } else if v, ok := interface{}(m.GetLogFormat()).(interface{ Validate() error }); ok {
3376 if err := v.Validate(); err != nil {
3377 return Bootstrap_ApplicationLogConfigValidationError{
3378 field: "LogFormat",
3379 reason: "embedded message failed validation",
3380 cause: err,
3381 }
3382 }
3383 }
3384
3385 if len(errors) > 0 {
3386 return Bootstrap_ApplicationLogConfigMultiError(errors)
3387 }
3388
3389 return nil
3390 }
3391
3392 // Bootstrap_ApplicationLogConfigMultiError is an error wrapping multiple
3393 // validation errors returned by Bootstrap_ApplicationLogConfig.ValidateAll()
3394 // if the designated constraints aren't met.
3395 type Bootstrap_ApplicationLogConfigMultiError []error
3396
3397 // Error returns a concatenation of all the error messages it wraps.
3398 func (m Bootstrap_ApplicationLogConfigMultiError) Error() string {
3399 var msgs []string
3400 for _, err := range m {
3401 msgs = append(msgs, err.Error())
3402 }
3403 return strings.Join(msgs, "; ")
3404 }
3405
3406 // AllErrors returns a list of validation violation errors.
3407 func (m Bootstrap_ApplicationLogConfigMultiError) AllErrors() []error { return m }
3408
3409 // Bootstrap_ApplicationLogConfigValidationError is the validation error
3410 // returned by Bootstrap_ApplicationLogConfig.Validate if the designated
3411 // constraints aren't met.
3412 type Bootstrap_ApplicationLogConfigValidationError struct {
3413 field string
3414 reason string
3415 cause error
3416 key bool
3417 }
3418
3419 // Field function returns field value.
3420 func (e Bootstrap_ApplicationLogConfigValidationError) Field() string { return e.field }
3421
3422 // Reason function returns reason value.
3423 func (e Bootstrap_ApplicationLogConfigValidationError) Reason() string { return e.reason }
3424
3425 // Cause function returns cause value.
3426 func (e Bootstrap_ApplicationLogConfigValidationError) Cause() error { return e.cause }
3427
3428 // Key function returns key value.
3429 func (e Bootstrap_ApplicationLogConfigValidationError) Key() bool { return e.key }
3430
3431 // ErrorName returns error name.
3432 func (e Bootstrap_ApplicationLogConfigValidationError) ErrorName() string {
3433 return "Bootstrap_ApplicationLogConfigValidationError"
3434 }
3435
3436 // Error satisfies the builtin error interface
3437 func (e Bootstrap_ApplicationLogConfigValidationError) Error() string {
3438 cause := ""
3439 if e.cause != nil {
3440 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3441 }
3442
3443 key := ""
3444 if e.key {
3445 key = "key for "
3446 }
3447
3448 return fmt.Sprintf(
3449 "invalid %sBootstrap_ApplicationLogConfig.%s: %s%s",
3450 key,
3451 e.field,
3452 e.reason,
3453 cause)
3454 }
3455
3456 var _ error = Bootstrap_ApplicationLogConfigValidationError{}
3457
3458 var _ interface {
3459 Field() string
3460 Reason() string
3461 Key() bool
3462 Cause() error
3463 ErrorName() string
3464 } = Bootstrap_ApplicationLogConfigValidationError{}
3465
3466 // Validate checks the field values on Bootstrap_DeferredStatOptions with the
3467 // rules defined in the proto definition for this message. If any rules are
3468 // violated, the first error encountered is returned, or nil if there are no violations.
3469 func (m *Bootstrap_DeferredStatOptions) Validate() error {
3470 return m.validate(false)
3471 }
3472
3473 // ValidateAll checks the field values on Bootstrap_DeferredStatOptions with
3474 // the rules defined in the proto definition for this message. If any rules
3475 // are violated, the result is a list of violation errors wrapped in
3476 // Bootstrap_DeferredStatOptionsMultiError, or nil if none found.
3477 func (m *Bootstrap_DeferredStatOptions) ValidateAll() error {
3478 return m.validate(true)
3479 }
3480
3481 func (m *Bootstrap_DeferredStatOptions) validate(all bool) error {
3482 if m == nil {
3483 return nil
3484 }
3485
3486 var errors []error
3487
3488 // no validation rules for EnableDeferredCreationStats
3489
3490 if len(errors) > 0 {
3491 return Bootstrap_DeferredStatOptionsMultiError(errors)
3492 }
3493
3494 return nil
3495 }
3496
3497 // Bootstrap_DeferredStatOptionsMultiError is an error wrapping multiple
3498 // validation errors returned by Bootstrap_DeferredStatOptions.ValidateAll()
3499 // if the designated constraints aren't met.
3500 type Bootstrap_DeferredStatOptionsMultiError []error
3501
3502 // Error returns a concatenation of all the error messages it wraps.
3503 func (m Bootstrap_DeferredStatOptionsMultiError) Error() string {
3504 var msgs []string
3505 for _, err := range m {
3506 msgs = append(msgs, err.Error())
3507 }
3508 return strings.Join(msgs, "; ")
3509 }
3510
3511 // AllErrors returns a list of validation violation errors.
3512 func (m Bootstrap_DeferredStatOptionsMultiError) AllErrors() []error { return m }
3513
3514 // Bootstrap_DeferredStatOptionsValidationError is the validation error
3515 // returned by Bootstrap_DeferredStatOptions.Validate if the designated
3516 // constraints aren't met.
3517 type Bootstrap_DeferredStatOptionsValidationError struct {
3518 field string
3519 reason string
3520 cause error
3521 key bool
3522 }
3523
3524 // Field function returns field value.
3525 func (e Bootstrap_DeferredStatOptionsValidationError) Field() string { return e.field }
3526
3527 // Reason function returns reason value.
3528 func (e Bootstrap_DeferredStatOptionsValidationError) Reason() string { return e.reason }
3529
3530 // Cause function returns cause value.
3531 func (e Bootstrap_DeferredStatOptionsValidationError) Cause() error { return e.cause }
3532
3533 // Key function returns key value.
3534 func (e Bootstrap_DeferredStatOptionsValidationError) Key() bool { return e.key }
3535
3536 // ErrorName returns error name.
3537 func (e Bootstrap_DeferredStatOptionsValidationError) ErrorName() string {
3538 return "Bootstrap_DeferredStatOptionsValidationError"
3539 }
3540
3541 // Error satisfies the builtin error interface
3542 func (e Bootstrap_DeferredStatOptionsValidationError) Error() string {
3543 cause := ""
3544 if e.cause != nil {
3545 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3546 }
3547
3548 key := ""
3549 if e.key {
3550 key = "key for "
3551 }
3552
3553 return fmt.Sprintf(
3554 "invalid %sBootstrap_DeferredStatOptions.%s: %s%s",
3555 key,
3556 e.field,
3557 e.reason,
3558 cause)
3559 }
3560
3561 var _ error = Bootstrap_DeferredStatOptionsValidationError{}
3562
3563 var _ interface {
3564 Field() string
3565 Reason() string
3566 Key() bool
3567 Cause() error
3568 ErrorName() string
3569 } = Bootstrap_DeferredStatOptionsValidationError{}
3570
3571 // Validate checks the field values on Bootstrap_GrpcAsyncClientManagerConfig
3572 // with the rules defined in the proto definition for this message. If any
3573 // rules are violated, the first error encountered is returned, or nil if
3574 // there are no violations.
3575 func (m *Bootstrap_GrpcAsyncClientManagerConfig) Validate() error {
3576 return m.validate(false)
3577 }
3578
3579 // ValidateAll checks the field values on
3580 // Bootstrap_GrpcAsyncClientManagerConfig with the rules defined in the proto
3581 // definition for this message. If any rules are violated, the result is a
3582 // list of violation errors wrapped in
3583 // Bootstrap_GrpcAsyncClientManagerConfigMultiError, or nil if none found.
3584 func (m *Bootstrap_GrpcAsyncClientManagerConfig) ValidateAll() error {
3585 return m.validate(true)
3586 }
3587
3588 func (m *Bootstrap_GrpcAsyncClientManagerConfig) validate(all bool) error {
3589 if m == nil {
3590 return nil
3591 }
3592
3593 var errors []error
3594
3595 if d := m.GetMaxCachedEntryIdleDuration(); d != nil {
3596 dur, err := d.AsDuration(), d.CheckValid()
3597 if err != nil {
3598 err = Bootstrap_GrpcAsyncClientManagerConfigValidationError{
3599 field: "MaxCachedEntryIdleDuration",
3600 reason: "value is not a valid duration",
3601 cause: err,
3602 }
3603 if !all {
3604 return err
3605 }
3606 errors = append(errors, err)
3607 } else {
3608
3609 gte := time.Duration(5*time.Second + 0*time.Nanosecond)
3610
3611 if dur < gte {
3612 err := Bootstrap_GrpcAsyncClientManagerConfigValidationError{
3613 field: "MaxCachedEntryIdleDuration",
3614 reason: "value must be greater than or equal to 5s",
3615 }
3616 if !all {
3617 return err
3618 }
3619 errors = append(errors, err)
3620 }
3621
3622 }
3623 }
3624
3625 if len(errors) > 0 {
3626 return Bootstrap_GrpcAsyncClientManagerConfigMultiError(errors)
3627 }
3628
3629 return nil
3630 }
3631
3632 // Bootstrap_GrpcAsyncClientManagerConfigMultiError is an error wrapping
3633 // multiple validation errors returned by
3634 // Bootstrap_GrpcAsyncClientManagerConfig.ValidateAll() if the designated
3635 // constraints aren't met.
3636 type Bootstrap_GrpcAsyncClientManagerConfigMultiError []error
3637
3638 // Error returns a concatenation of all the error messages it wraps.
3639 func (m Bootstrap_GrpcAsyncClientManagerConfigMultiError) Error() string {
3640 var msgs []string
3641 for _, err := range m {
3642 msgs = append(msgs, err.Error())
3643 }
3644 return strings.Join(msgs, "; ")
3645 }
3646
3647 // AllErrors returns a list of validation violation errors.
3648 func (m Bootstrap_GrpcAsyncClientManagerConfigMultiError) AllErrors() []error { return m }
3649
3650 // Bootstrap_GrpcAsyncClientManagerConfigValidationError is the validation
3651 // error returned by Bootstrap_GrpcAsyncClientManagerConfig.Validate if the
3652 // designated constraints aren't met.
3653 type Bootstrap_GrpcAsyncClientManagerConfigValidationError struct {
3654 field string
3655 reason string
3656 cause error
3657 key bool
3658 }
3659
3660 // Field function returns field value.
3661 func (e Bootstrap_GrpcAsyncClientManagerConfigValidationError) Field() string { return e.field }
3662
3663 // Reason function returns reason value.
3664 func (e Bootstrap_GrpcAsyncClientManagerConfigValidationError) Reason() string { return e.reason }
3665
3666 // Cause function returns cause value.
3667 func (e Bootstrap_GrpcAsyncClientManagerConfigValidationError) Cause() error { return e.cause }
3668
3669 // Key function returns key value.
3670 func (e Bootstrap_GrpcAsyncClientManagerConfigValidationError) Key() bool { return e.key }
3671
3672 // ErrorName returns error name.
3673 func (e Bootstrap_GrpcAsyncClientManagerConfigValidationError) ErrorName() string {
3674 return "Bootstrap_GrpcAsyncClientManagerConfigValidationError"
3675 }
3676
3677 // Error satisfies the builtin error interface
3678 func (e Bootstrap_GrpcAsyncClientManagerConfigValidationError) Error() string {
3679 cause := ""
3680 if e.cause != nil {
3681 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3682 }
3683
3684 key := ""
3685 if e.key {
3686 key = "key for "
3687 }
3688
3689 return fmt.Sprintf(
3690 "invalid %sBootstrap_GrpcAsyncClientManagerConfig.%s: %s%s",
3691 key,
3692 e.field,
3693 e.reason,
3694 cause)
3695 }
3696
3697 var _ error = Bootstrap_GrpcAsyncClientManagerConfigValidationError{}
3698
3699 var _ interface {
3700 Field() string
3701 Reason() string
3702 Key() bool
3703 Cause() error
3704 ErrorName() string
3705 } = Bootstrap_GrpcAsyncClientManagerConfigValidationError{}
3706
3707 // Validate checks the field values on Bootstrap_ApplicationLogConfig_LogFormat
3708 // with the rules defined in the proto definition for this message. If any
3709 // rules are violated, the first error encountered is returned, or nil if
3710 // there are no violations.
3711 func (m *Bootstrap_ApplicationLogConfig_LogFormat) Validate() error {
3712 return m.validate(false)
3713 }
3714
3715 // ValidateAll checks the field values on
3716 // Bootstrap_ApplicationLogConfig_LogFormat with the rules defined in the
3717 // proto definition for this message. If any rules are violated, the result is
3718 // a list of violation errors wrapped in
3719 // Bootstrap_ApplicationLogConfig_LogFormatMultiError, or nil if none found.
3720 func (m *Bootstrap_ApplicationLogConfig_LogFormat) ValidateAll() error {
3721 return m.validate(true)
3722 }
3723
3724 func (m *Bootstrap_ApplicationLogConfig_LogFormat) validate(all bool) error {
3725 if m == nil {
3726 return nil
3727 }
3728
3729 var errors []error
3730
3731 oneofLogFormatPresent := false
3732 switch v := m.LogFormat.(type) {
3733 case *Bootstrap_ApplicationLogConfig_LogFormat_JsonFormat:
3734 if v == nil {
3735 err := Bootstrap_ApplicationLogConfig_LogFormatValidationError{
3736 field: "LogFormat",
3737 reason: "oneof value cannot be a typed-nil",
3738 }
3739 if !all {
3740 return err
3741 }
3742 errors = append(errors, err)
3743 }
3744 oneofLogFormatPresent = true
3745
3746 if all {
3747 switch v := interface{}(m.GetJsonFormat()).(type) {
3748 case interface{ ValidateAll() error }:
3749 if err := v.ValidateAll(); err != nil {
3750 errors = append(errors, Bootstrap_ApplicationLogConfig_LogFormatValidationError{
3751 field: "JsonFormat",
3752 reason: "embedded message failed validation",
3753 cause: err,
3754 })
3755 }
3756 case interface{ Validate() error }:
3757 if err := v.Validate(); err != nil {
3758 errors = append(errors, Bootstrap_ApplicationLogConfig_LogFormatValidationError{
3759 field: "JsonFormat",
3760 reason: "embedded message failed validation",
3761 cause: err,
3762 })
3763 }
3764 }
3765 } else if v, ok := interface{}(m.GetJsonFormat()).(interface{ Validate() error }); ok {
3766 if err := v.Validate(); err != nil {
3767 return Bootstrap_ApplicationLogConfig_LogFormatValidationError{
3768 field: "JsonFormat",
3769 reason: "embedded message failed validation",
3770 cause: err,
3771 }
3772 }
3773 }
3774
3775 case *Bootstrap_ApplicationLogConfig_LogFormat_TextFormat:
3776 if v == nil {
3777 err := Bootstrap_ApplicationLogConfig_LogFormatValidationError{
3778 field: "LogFormat",
3779 reason: "oneof value cannot be a typed-nil",
3780 }
3781 if !all {
3782 return err
3783 }
3784 errors = append(errors, err)
3785 }
3786 oneofLogFormatPresent = true
3787 // no validation rules for TextFormat
3788 default:
3789 _ = v // ensures v is used
3790 }
3791 if !oneofLogFormatPresent {
3792 err := Bootstrap_ApplicationLogConfig_LogFormatValidationError{
3793 field: "LogFormat",
3794 reason: "value is required",
3795 }
3796 if !all {
3797 return err
3798 }
3799 errors = append(errors, err)
3800 }
3801
3802 if len(errors) > 0 {
3803 return Bootstrap_ApplicationLogConfig_LogFormatMultiError(errors)
3804 }
3805
3806 return nil
3807 }
3808
3809 // Bootstrap_ApplicationLogConfig_LogFormatMultiError is an error wrapping
3810 // multiple validation errors returned by
3811 // Bootstrap_ApplicationLogConfig_LogFormat.ValidateAll() if the designated
3812 // constraints aren't met.
3813 type Bootstrap_ApplicationLogConfig_LogFormatMultiError []error
3814
3815 // Error returns a concatenation of all the error messages it wraps.
3816 func (m Bootstrap_ApplicationLogConfig_LogFormatMultiError) Error() string {
3817 var msgs []string
3818 for _, err := range m {
3819 msgs = append(msgs, err.Error())
3820 }
3821 return strings.Join(msgs, "; ")
3822 }
3823
3824 // AllErrors returns a list of validation violation errors.
3825 func (m Bootstrap_ApplicationLogConfig_LogFormatMultiError) AllErrors() []error { return m }
3826
3827 // Bootstrap_ApplicationLogConfig_LogFormatValidationError is the validation
3828 // error returned by Bootstrap_ApplicationLogConfig_LogFormat.Validate if the
3829 // designated constraints aren't met.
3830 type Bootstrap_ApplicationLogConfig_LogFormatValidationError struct {
3831 field string
3832 reason string
3833 cause error
3834 key bool
3835 }
3836
3837 // Field function returns field value.
3838 func (e Bootstrap_ApplicationLogConfig_LogFormatValidationError) Field() string { return e.field }
3839
3840 // Reason function returns reason value.
3841 func (e Bootstrap_ApplicationLogConfig_LogFormatValidationError) Reason() string { return e.reason }
3842
3843 // Cause function returns cause value.
3844 func (e Bootstrap_ApplicationLogConfig_LogFormatValidationError) Cause() error { return e.cause }
3845
3846 // Key function returns key value.
3847 func (e Bootstrap_ApplicationLogConfig_LogFormatValidationError) Key() bool { return e.key }
3848
3849 // ErrorName returns error name.
3850 func (e Bootstrap_ApplicationLogConfig_LogFormatValidationError) ErrorName() string {
3851 return "Bootstrap_ApplicationLogConfig_LogFormatValidationError"
3852 }
3853
3854 // Error satisfies the builtin error interface
3855 func (e Bootstrap_ApplicationLogConfig_LogFormatValidationError) Error() string {
3856 cause := ""
3857 if e.cause != nil {
3858 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3859 }
3860
3861 key := ""
3862 if e.key {
3863 key = "key for "
3864 }
3865
3866 return fmt.Sprintf(
3867 "invalid %sBootstrap_ApplicationLogConfig_LogFormat.%s: %s%s",
3868 key,
3869 e.field,
3870 e.reason,
3871 cause)
3872 }
3873
3874 var _ error = Bootstrap_ApplicationLogConfig_LogFormatValidationError{}
3875
3876 var _ interface {
3877 Field() string
3878 Reason() string
3879 Key() bool
3880 Cause() error
3881 ErrorName() string
3882 } = Bootstrap_ApplicationLogConfig_LogFormatValidationError{}
3883
3884 // Validate checks the field values on ClusterManager_OutlierDetection with the
3885 // rules defined in the proto definition for this message. If any rules are
3886 // violated, the first error encountered is returned, or nil if there are no violations.
3887 func (m *ClusterManager_OutlierDetection) Validate() error {
3888 return m.validate(false)
3889 }
3890
3891 // ValidateAll checks the field values on ClusterManager_OutlierDetection with
3892 // the rules defined in the proto definition for this message. If any rules
3893 // are violated, the result is a list of violation errors wrapped in
3894 // ClusterManager_OutlierDetectionMultiError, or nil if none found.
3895 func (m *ClusterManager_OutlierDetection) ValidateAll() error {
3896 return m.validate(true)
3897 }
3898
3899 func (m *ClusterManager_OutlierDetection) validate(all bool) error {
3900 if m == nil {
3901 return nil
3902 }
3903
3904 var errors []error
3905
3906 // no validation rules for EventLogPath
3907
3908 if all {
3909 switch v := interface{}(m.GetEventService()).(type) {
3910 case interface{ ValidateAll() error }:
3911 if err := v.ValidateAll(); err != nil {
3912 errors = append(errors, ClusterManager_OutlierDetectionValidationError{
3913 field: "EventService",
3914 reason: "embedded message failed validation",
3915 cause: err,
3916 })
3917 }
3918 case interface{ Validate() error }:
3919 if err := v.Validate(); err != nil {
3920 errors = append(errors, ClusterManager_OutlierDetectionValidationError{
3921 field: "EventService",
3922 reason: "embedded message failed validation",
3923 cause: err,
3924 })
3925 }
3926 }
3927 } else if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok {
3928 if err := v.Validate(); err != nil {
3929 return ClusterManager_OutlierDetectionValidationError{
3930 field: "EventService",
3931 reason: "embedded message failed validation",
3932 cause: err,
3933 }
3934 }
3935 }
3936
3937 if len(errors) > 0 {
3938 return ClusterManager_OutlierDetectionMultiError(errors)
3939 }
3940
3941 return nil
3942 }
3943
3944 // ClusterManager_OutlierDetectionMultiError is an error wrapping multiple
3945 // validation errors returned by ClusterManager_OutlierDetection.ValidateAll()
3946 // if the designated constraints aren't met.
3947 type ClusterManager_OutlierDetectionMultiError []error
3948
3949 // Error returns a concatenation of all the error messages it wraps.
3950 func (m ClusterManager_OutlierDetectionMultiError) Error() string {
3951 var msgs []string
3952 for _, err := range m {
3953 msgs = append(msgs, err.Error())
3954 }
3955 return strings.Join(msgs, "; ")
3956 }
3957
3958 // AllErrors returns a list of validation violation errors.
3959 func (m ClusterManager_OutlierDetectionMultiError) AllErrors() []error { return m }
3960
3961 // ClusterManager_OutlierDetectionValidationError is the validation error
3962 // returned by ClusterManager_OutlierDetection.Validate if the designated
3963 // constraints aren't met.
3964 type ClusterManager_OutlierDetectionValidationError struct {
3965 field string
3966 reason string
3967 cause error
3968 key bool
3969 }
3970
3971 // Field function returns field value.
3972 func (e ClusterManager_OutlierDetectionValidationError) Field() string { return e.field }
3973
3974 // Reason function returns reason value.
3975 func (e ClusterManager_OutlierDetectionValidationError) Reason() string { return e.reason }
3976
3977 // Cause function returns cause value.
3978 func (e ClusterManager_OutlierDetectionValidationError) Cause() error { return e.cause }
3979
3980 // Key function returns key value.
3981 func (e ClusterManager_OutlierDetectionValidationError) Key() bool { return e.key }
3982
3983 // ErrorName returns error name.
3984 func (e ClusterManager_OutlierDetectionValidationError) ErrorName() string {
3985 return "ClusterManager_OutlierDetectionValidationError"
3986 }
3987
3988 // Error satisfies the builtin error interface
3989 func (e ClusterManager_OutlierDetectionValidationError) Error() string {
3990 cause := ""
3991 if e.cause != nil {
3992 cause = fmt.Sprintf(" | caused by: %v", e.cause)
3993 }
3994
3995 key := ""
3996 if e.key {
3997 key = "key for "
3998 }
3999
4000 return fmt.Sprintf(
4001 "invalid %sClusterManager_OutlierDetection.%s: %s%s",
4002 key,
4003 e.field,
4004 e.reason,
4005 cause)
4006 }
4007
4008 var _ error = ClusterManager_OutlierDetectionValidationError{}
4009
4010 var _ interface {
4011 Field() string
4012 Reason() string
4013 Key() bool
4014 Cause() error
4015 ErrorName() string
4016 } = ClusterManager_OutlierDetectionValidationError{}
4017
4018 // Validate checks the field values on Watchdog_WatchdogAction with the rules
4019 // defined in the proto definition for this message. If any rules are
4020 // violated, the first error encountered is returned, or nil if there are no violations.
4021 func (m *Watchdog_WatchdogAction) Validate() error {
4022 return m.validate(false)
4023 }
4024
4025 // ValidateAll checks the field values on Watchdog_WatchdogAction with the
4026 // rules defined in the proto definition for this message. If any rules are
4027 // violated, the result is a list of violation errors wrapped in
4028 // Watchdog_WatchdogActionMultiError, or nil if none found.
4029 func (m *Watchdog_WatchdogAction) ValidateAll() error {
4030 return m.validate(true)
4031 }
4032
4033 func (m *Watchdog_WatchdogAction) validate(all bool) error {
4034 if m == nil {
4035 return nil
4036 }
4037
4038 var errors []error
4039
4040 if all {
4041 switch v := interface{}(m.GetConfig()).(type) {
4042 case interface{ ValidateAll() error }:
4043 if err := v.ValidateAll(); err != nil {
4044 errors = append(errors, Watchdog_WatchdogActionValidationError{
4045 field: "Config",
4046 reason: "embedded message failed validation",
4047 cause: err,
4048 })
4049 }
4050 case interface{ Validate() error }:
4051 if err := v.Validate(); err != nil {
4052 errors = append(errors, Watchdog_WatchdogActionValidationError{
4053 field: "Config",
4054 reason: "embedded message failed validation",
4055 cause: err,
4056 })
4057 }
4058 }
4059 } else if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
4060 if err := v.Validate(); err != nil {
4061 return Watchdog_WatchdogActionValidationError{
4062 field: "Config",
4063 reason: "embedded message failed validation",
4064 cause: err,
4065 }
4066 }
4067 }
4068
4069 if _, ok := Watchdog_WatchdogAction_WatchdogEvent_name[int32(m.GetEvent())]; !ok {
4070 err := Watchdog_WatchdogActionValidationError{
4071 field: "Event",
4072 reason: "value must be one of the defined enum values",
4073 }
4074 if !all {
4075 return err
4076 }
4077 errors = append(errors, err)
4078 }
4079
4080 if len(errors) > 0 {
4081 return Watchdog_WatchdogActionMultiError(errors)
4082 }
4083
4084 return nil
4085 }
4086
4087 // Watchdog_WatchdogActionMultiError is an error wrapping multiple validation
4088 // errors returned by Watchdog_WatchdogAction.ValidateAll() if the designated
4089 // constraints aren't met.
4090 type Watchdog_WatchdogActionMultiError []error
4091
4092 // Error returns a concatenation of all the error messages it wraps.
4093 func (m Watchdog_WatchdogActionMultiError) Error() string {
4094 var msgs []string
4095 for _, err := range m {
4096 msgs = append(msgs, err.Error())
4097 }
4098 return strings.Join(msgs, "; ")
4099 }
4100
4101 // AllErrors returns a list of validation violation errors.
4102 func (m Watchdog_WatchdogActionMultiError) AllErrors() []error { return m }
4103
4104 // Watchdog_WatchdogActionValidationError is the validation error returned by
4105 // Watchdog_WatchdogAction.Validate if the designated constraints aren't met.
4106 type Watchdog_WatchdogActionValidationError struct {
4107 field string
4108 reason string
4109 cause error
4110 key bool
4111 }
4112
4113 // Field function returns field value.
4114 func (e Watchdog_WatchdogActionValidationError) Field() string { return e.field }
4115
4116 // Reason function returns reason value.
4117 func (e Watchdog_WatchdogActionValidationError) Reason() string { return e.reason }
4118
4119 // Cause function returns cause value.
4120 func (e Watchdog_WatchdogActionValidationError) Cause() error { return e.cause }
4121
4122 // Key function returns key value.
4123 func (e Watchdog_WatchdogActionValidationError) Key() bool { return e.key }
4124
4125 // ErrorName returns error name.
4126 func (e Watchdog_WatchdogActionValidationError) ErrorName() string {
4127 return "Watchdog_WatchdogActionValidationError"
4128 }
4129
4130 // Error satisfies the builtin error interface
4131 func (e Watchdog_WatchdogActionValidationError) Error() string {
4132 cause := ""
4133 if e.cause != nil {
4134 cause = fmt.Sprintf(" | caused by: %v", e.cause)
4135 }
4136
4137 key := ""
4138 if e.key {
4139 key = "key for "
4140 }
4141
4142 return fmt.Sprintf(
4143 "invalid %sWatchdog_WatchdogAction.%s: %s%s",
4144 key,
4145 e.field,
4146 e.reason,
4147 cause)
4148 }
4149
4150 var _ error = Watchdog_WatchdogActionValidationError{}
4151
4152 var _ interface {
4153 Field() string
4154 Reason() string
4155 Key() bool
4156 Cause() error
4157 ErrorName() string
4158 } = Watchdog_WatchdogActionValidationError{}
4159
4160 // Validate checks the field values on RuntimeLayer_DiskLayer with the rules
4161 // defined in the proto definition for this message. If any rules are
4162 // violated, the first error encountered is returned, or nil if there are no violations.
4163 func (m *RuntimeLayer_DiskLayer) Validate() error {
4164 return m.validate(false)
4165 }
4166
4167 // ValidateAll checks the field values on RuntimeLayer_DiskLayer with the rules
4168 // defined in the proto definition for this message. If any rules are
4169 // violated, the result is a list of violation errors wrapped in
4170 // RuntimeLayer_DiskLayerMultiError, or nil if none found.
4171 func (m *RuntimeLayer_DiskLayer) ValidateAll() error {
4172 return m.validate(true)
4173 }
4174
4175 func (m *RuntimeLayer_DiskLayer) validate(all bool) error {
4176 if m == nil {
4177 return nil
4178 }
4179
4180 var errors []error
4181
4182 // no validation rules for SymlinkRoot
4183
4184 // no validation rules for Subdirectory
4185
4186 // no validation rules for AppendServiceCluster
4187
4188 if len(errors) > 0 {
4189 return RuntimeLayer_DiskLayerMultiError(errors)
4190 }
4191
4192 return nil
4193 }
4194
4195 // RuntimeLayer_DiskLayerMultiError is an error wrapping multiple validation
4196 // errors returned by RuntimeLayer_DiskLayer.ValidateAll() if the designated
4197 // constraints aren't met.
4198 type RuntimeLayer_DiskLayerMultiError []error
4199
4200 // Error returns a concatenation of all the error messages it wraps.
4201 func (m RuntimeLayer_DiskLayerMultiError) Error() string {
4202 var msgs []string
4203 for _, err := range m {
4204 msgs = append(msgs, err.Error())
4205 }
4206 return strings.Join(msgs, "; ")
4207 }
4208
4209 // AllErrors returns a list of validation violation errors.
4210 func (m RuntimeLayer_DiskLayerMultiError) AllErrors() []error { return m }
4211
4212 // RuntimeLayer_DiskLayerValidationError is the validation error returned by
4213 // RuntimeLayer_DiskLayer.Validate if the designated constraints aren't met.
4214 type RuntimeLayer_DiskLayerValidationError struct {
4215 field string
4216 reason string
4217 cause error
4218 key bool
4219 }
4220
4221 // Field function returns field value.
4222 func (e RuntimeLayer_DiskLayerValidationError) Field() string { return e.field }
4223
4224 // Reason function returns reason value.
4225 func (e RuntimeLayer_DiskLayerValidationError) Reason() string { return e.reason }
4226
4227 // Cause function returns cause value.
4228 func (e RuntimeLayer_DiskLayerValidationError) Cause() error { return e.cause }
4229
4230 // Key function returns key value.
4231 func (e RuntimeLayer_DiskLayerValidationError) Key() bool { return e.key }
4232
4233 // ErrorName returns error name.
4234 func (e RuntimeLayer_DiskLayerValidationError) ErrorName() string {
4235 return "RuntimeLayer_DiskLayerValidationError"
4236 }
4237
4238 // Error satisfies the builtin error interface
4239 func (e RuntimeLayer_DiskLayerValidationError) Error() string {
4240 cause := ""
4241 if e.cause != nil {
4242 cause = fmt.Sprintf(" | caused by: %v", e.cause)
4243 }
4244
4245 key := ""
4246 if e.key {
4247 key = "key for "
4248 }
4249
4250 return fmt.Sprintf(
4251 "invalid %sRuntimeLayer_DiskLayer.%s: %s%s",
4252 key,
4253 e.field,
4254 e.reason,
4255 cause)
4256 }
4257
4258 var _ error = RuntimeLayer_DiskLayerValidationError{}
4259
4260 var _ interface {
4261 Field() string
4262 Reason() string
4263 Key() bool
4264 Cause() error
4265 ErrorName() string
4266 } = RuntimeLayer_DiskLayerValidationError{}
4267
4268 // Validate checks the field values on RuntimeLayer_AdminLayer with the rules
4269 // defined in the proto definition for this message. If any rules are
4270 // violated, the first error encountered is returned, or nil if there are no violations.
4271 func (m *RuntimeLayer_AdminLayer) Validate() error {
4272 return m.validate(false)
4273 }
4274
4275 // ValidateAll checks the field values on RuntimeLayer_AdminLayer with the
4276 // rules defined in the proto definition for this message. If any rules are
4277 // violated, the result is a list of violation errors wrapped in
4278 // RuntimeLayer_AdminLayerMultiError, or nil if none found.
4279 func (m *RuntimeLayer_AdminLayer) ValidateAll() error {
4280 return m.validate(true)
4281 }
4282
4283 func (m *RuntimeLayer_AdminLayer) validate(all bool) error {
4284 if m == nil {
4285 return nil
4286 }
4287
4288 var errors []error
4289
4290 if len(errors) > 0 {
4291 return RuntimeLayer_AdminLayerMultiError(errors)
4292 }
4293
4294 return nil
4295 }
4296
4297 // RuntimeLayer_AdminLayerMultiError is an error wrapping multiple validation
4298 // errors returned by RuntimeLayer_AdminLayer.ValidateAll() if the designated
4299 // constraints aren't met.
4300 type RuntimeLayer_AdminLayerMultiError []error
4301
4302 // Error returns a concatenation of all the error messages it wraps.
4303 func (m RuntimeLayer_AdminLayerMultiError) Error() string {
4304 var msgs []string
4305 for _, err := range m {
4306 msgs = append(msgs, err.Error())
4307 }
4308 return strings.Join(msgs, "; ")
4309 }
4310
4311 // AllErrors returns a list of validation violation errors.
4312 func (m RuntimeLayer_AdminLayerMultiError) AllErrors() []error { return m }
4313
4314 // RuntimeLayer_AdminLayerValidationError is the validation error returned by
4315 // RuntimeLayer_AdminLayer.Validate if the designated constraints aren't met.
4316 type RuntimeLayer_AdminLayerValidationError struct {
4317 field string
4318 reason string
4319 cause error
4320 key bool
4321 }
4322
4323 // Field function returns field value.
4324 func (e RuntimeLayer_AdminLayerValidationError) Field() string { return e.field }
4325
4326 // Reason function returns reason value.
4327 func (e RuntimeLayer_AdminLayerValidationError) Reason() string { return e.reason }
4328
4329 // Cause function returns cause value.
4330 func (e RuntimeLayer_AdminLayerValidationError) Cause() error { return e.cause }
4331
4332 // Key function returns key value.
4333 func (e RuntimeLayer_AdminLayerValidationError) Key() bool { return e.key }
4334
4335 // ErrorName returns error name.
4336 func (e RuntimeLayer_AdminLayerValidationError) ErrorName() string {
4337 return "RuntimeLayer_AdminLayerValidationError"
4338 }
4339
4340 // Error satisfies the builtin error interface
4341 func (e RuntimeLayer_AdminLayerValidationError) Error() string {
4342 cause := ""
4343 if e.cause != nil {
4344 cause = fmt.Sprintf(" | caused by: %v", e.cause)
4345 }
4346
4347 key := ""
4348 if e.key {
4349 key = "key for "
4350 }
4351
4352 return fmt.Sprintf(
4353 "invalid %sRuntimeLayer_AdminLayer.%s: %s%s",
4354 key,
4355 e.field,
4356 e.reason,
4357 cause)
4358 }
4359
4360 var _ error = RuntimeLayer_AdminLayerValidationError{}
4361
4362 var _ interface {
4363 Field() string
4364 Reason() string
4365 Key() bool
4366 Cause() error
4367 ErrorName() string
4368 } = RuntimeLayer_AdminLayerValidationError{}
4369
4370 // Validate checks the field values on RuntimeLayer_RtdsLayer with the rules
4371 // defined in the proto definition for this message. If any rules are
4372 // violated, the first error encountered is returned, or nil if there are no violations.
4373 func (m *RuntimeLayer_RtdsLayer) Validate() error {
4374 return m.validate(false)
4375 }
4376
4377 // ValidateAll checks the field values on RuntimeLayer_RtdsLayer with the rules
4378 // defined in the proto definition for this message. If any rules are
4379 // violated, the result is a list of violation errors wrapped in
4380 // RuntimeLayer_RtdsLayerMultiError, or nil if none found.
4381 func (m *RuntimeLayer_RtdsLayer) ValidateAll() error {
4382 return m.validate(true)
4383 }
4384
4385 func (m *RuntimeLayer_RtdsLayer) validate(all bool) error {
4386 if m == nil {
4387 return nil
4388 }
4389
4390 var errors []error
4391
4392 // no validation rules for Name
4393
4394 if all {
4395 switch v := interface{}(m.GetRtdsConfig()).(type) {
4396 case interface{ ValidateAll() error }:
4397 if err := v.ValidateAll(); err != nil {
4398 errors = append(errors, RuntimeLayer_RtdsLayerValidationError{
4399 field: "RtdsConfig",
4400 reason: "embedded message failed validation",
4401 cause: err,
4402 })
4403 }
4404 case interface{ Validate() error }:
4405 if err := v.Validate(); err != nil {
4406 errors = append(errors, RuntimeLayer_RtdsLayerValidationError{
4407 field: "RtdsConfig",
4408 reason: "embedded message failed validation",
4409 cause: err,
4410 })
4411 }
4412 }
4413 } else if v, ok := interface{}(m.GetRtdsConfig()).(interface{ Validate() error }); ok {
4414 if err := v.Validate(); err != nil {
4415 return RuntimeLayer_RtdsLayerValidationError{
4416 field: "RtdsConfig",
4417 reason: "embedded message failed validation",
4418 cause: err,
4419 }
4420 }
4421 }
4422
4423 if len(errors) > 0 {
4424 return RuntimeLayer_RtdsLayerMultiError(errors)
4425 }
4426
4427 return nil
4428 }
4429
4430 // RuntimeLayer_RtdsLayerMultiError is an error wrapping multiple validation
4431 // errors returned by RuntimeLayer_RtdsLayer.ValidateAll() if the designated
4432 // constraints aren't met.
4433 type RuntimeLayer_RtdsLayerMultiError []error
4434
4435 // Error returns a concatenation of all the error messages it wraps.
4436 func (m RuntimeLayer_RtdsLayerMultiError) Error() string {
4437 var msgs []string
4438 for _, err := range m {
4439 msgs = append(msgs, err.Error())
4440 }
4441 return strings.Join(msgs, "; ")
4442 }
4443
4444 // AllErrors returns a list of validation violation errors.
4445 func (m RuntimeLayer_RtdsLayerMultiError) AllErrors() []error { return m }
4446
4447 // RuntimeLayer_RtdsLayerValidationError is the validation error returned by
4448 // RuntimeLayer_RtdsLayer.Validate if the designated constraints aren't met.
4449 type RuntimeLayer_RtdsLayerValidationError struct {
4450 field string
4451 reason string
4452 cause error
4453 key bool
4454 }
4455
4456 // Field function returns field value.
4457 func (e RuntimeLayer_RtdsLayerValidationError) Field() string { return e.field }
4458
4459 // Reason function returns reason value.
4460 func (e RuntimeLayer_RtdsLayerValidationError) Reason() string { return e.reason }
4461
4462 // Cause function returns cause value.
4463 func (e RuntimeLayer_RtdsLayerValidationError) Cause() error { return e.cause }
4464
4465 // Key function returns key value.
4466 func (e RuntimeLayer_RtdsLayerValidationError) Key() bool { return e.key }
4467
4468 // ErrorName returns error name.
4469 func (e RuntimeLayer_RtdsLayerValidationError) ErrorName() string {
4470 return "RuntimeLayer_RtdsLayerValidationError"
4471 }
4472
4473 // Error satisfies the builtin error interface
4474 func (e RuntimeLayer_RtdsLayerValidationError) Error() string {
4475 cause := ""
4476 if e.cause != nil {
4477 cause = fmt.Sprintf(" | caused by: %v", e.cause)
4478 }
4479
4480 key := ""
4481 if e.key {
4482 key = "key for "
4483 }
4484
4485 return fmt.Sprintf(
4486 "invalid %sRuntimeLayer_RtdsLayer.%s: %s%s",
4487 key,
4488 e.field,
4489 e.reason,
4490 cause)
4491 }
4492
4493 var _ error = RuntimeLayer_RtdsLayerValidationError{}
4494
4495 var _ interface {
4496 Field() string
4497 Reason() string
4498 Key() bool
4499 Cause() error
4500 ErrorName() string
4501 } = RuntimeLayer_RtdsLayerValidationError{}