github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/config/bootstrap/v2/bootstrap.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/config/bootstrap/v2/bootstrap.proto 3 4 package envoy_config_bootstrap_v2 5 6 import ( 7 "bytes" 8 "errors" 9 "fmt" 10 "net" 11 "net/mail" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 "google.golang.org/protobuf/types/known/anypb" 19 ) 20 21 // ensure the imports are used 22 var ( 23 _ = bytes.MinRead 24 _ = errors.New("") 25 _ = fmt.Print 26 _ = utf8.UTFMax 27 _ = (*regexp.Regexp)(nil) 28 _ = (*strings.Reader)(nil) 29 _ = net.IPv4len 30 _ = time.Duration(0) 31 _ = (*url.URL)(nil) 32 _ = (*mail.Address)(nil) 33 _ = anypb.Any{} 34 ) 35 36 // Validate checks the field values on Bootstrap with the rules defined in the 37 // proto definition for this message. If any rules are violated, an error is returned. 38 func (m *Bootstrap) Validate() error { 39 if m == nil { 40 return nil 41 } 42 43 if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { 44 if err := v.Validate(); err != nil { 45 return BootstrapValidationError{ 46 field: "Node", 47 reason: "embedded message failed validation", 48 cause: err, 49 } 50 } 51 } 52 53 if v, ok := interface{}(m.GetStaticResources()).(interface{ Validate() error }); ok { 54 if err := v.Validate(); err != nil { 55 return BootstrapValidationError{ 56 field: "StaticResources", 57 reason: "embedded message failed validation", 58 cause: err, 59 } 60 } 61 } 62 63 if v, ok := interface{}(m.GetDynamicResources()).(interface{ Validate() error }); ok { 64 if err := v.Validate(); err != nil { 65 return BootstrapValidationError{ 66 field: "DynamicResources", 67 reason: "embedded message failed validation", 68 cause: err, 69 } 70 } 71 } 72 73 if v, ok := interface{}(m.GetClusterManager()).(interface{ Validate() error }); ok { 74 if err := v.Validate(); err != nil { 75 return BootstrapValidationError{ 76 field: "ClusterManager", 77 reason: "embedded message failed validation", 78 cause: err, 79 } 80 } 81 } 82 83 if v, ok := interface{}(m.GetHdsConfig()).(interface{ Validate() error }); ok { 84 if err := v.Validate(); err != nil { 85 return BootstrapValidationError{ 86 field: "HdsConfig", 87 reason: "embedded message failed validation", 88 cause: err, 89 } 90 } 91 } 92 93 // no validation rules for FlagsPath 94 95 for idx, item := range m.GetStatsSinks() { 96 _, _ = idx, item 97 98 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 99 if err := v.Validate(); err != nil { 100 return BootstrapValidationError{ 101 field: fmt.Sprintf("StatsSinks[%v]", idx), 102 reason: "embedded message failed validation", 103 cause: err, 104 } 105 } 106 } 107 108 } 109 110 if v, ok := interface{}(m.GetStatsConfig()).(interface{ Validate() error }); ok { 111 if err := v.Validate(); err != nil { 112 return BootstrapValidationError{ 113 field: "StatsConfig", 114 reason: "embedded message failed validation", 115 cause: err, 116 } 117 } 118 } 119 120 if d := m.GetStatsFlushInterval(); d != nil { 121 dur, err := d.AsDuration(), d.CheckValid() 122 if err != nil { 123 return BootstrapValidationError{ 124 field: "StatsFlushInterval", 125 reason: "value is not a valid duration", 126 cause: err, 127 } 128 } 129 130 lt := time.Duration(300*time.Second + 0*time.Nanosecond) 131 gte := time.Duration(0*time.Second + 1000000*time.Nanosecond) 132 133 if dur < gte || dur >= lt { 134 return BootstrapValidationError{ 135 field: "StatsFlushInterval", 136 reason: "value must be inside range [1ms, 5m0s)", 137 } 138 } 139 140 } 141 142 if v, ok := interface{}(m.GetWatchdog()).(interface{ Validate() error }); ok { 143 if err := v.Validate(); err != nil { 144 return BootstrapValidationError{ 145 field: "Watchdog", 146 reason: "embedded message failed validation", 147 cause: err, 148 } 149 } 150 } 151 152 if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok { 153 if err := v.Validate(); err != nil { 154 return BootstrapValidationError{ 155 field: "Tracing", 156 reason: "embedded message failed validation", 157 cause: err, 158 } 159 } 160 } 161 162 if v, ok := interface{}(m.GetRuntime()).(interface{ Validate() error }); ok { 163 if err := v.Validate(); err != nil { 164 return BootstrapValidationError{ 165 field: "Runtime", 166 reason: "embedded message failed validation", 167 cause: err, 168 } 169 } 170 } 171 172 if v, ok := interface{}(m.GetLayeredRuntime()).(interface{ Validate() error }); ok { 173 if err := v.Validate(); err != nil { 174 return BootstrapValidationError{ 175 field: "LayeredRuntime", 176 reason: "embedded message failed validation", 177 cause: err, 178 } 179 } 180 } 181 182 if v, ok := interface{}(m.GetAdmin()).(interface{ Validate() error }); ok { 183 if err := v.Validate(); err != nil { 184 return BootstrapValidationError{ 185 field: "Admin", 186 reason: "embedded message failed validation", 187 cause: err, 188 } 189 } 190 } 191 192 if v, ok := interface{}(m.GetOverloadManager()).(interface{ Validate() error }); ok { 193 if err := v.Validate(); err != nil { 194 return BootstrapValidationError{ 195 field: "OverloadManager", 196 reason: "embedded message failed validation", 197 cause: err, 198 } 199 } 200 } 201 202 // no validation rules for EnableDispatcherStats 203 204 // no validation rules for HeaderPrefix 205 206 if v, ok := interface{}(m.GetStatsServerVersionOverride()).(interface{ Validate() error }); ok { 207 if err := v.Validate(); err != nil { 208 return BootstrapValidationError{ 209 field: "StatsServerVersionOverride", 210 reason: "embedded message failed validation", 211 cause: err, 212 } 213 } 214 } 215 216 // no validation rules for UseTcpForDnsLookups 217 218 return nil 219 } 220 221 // BootstrapValidationError is the validation error returned by 222 // Bootstrap.Validate if the designated constraints aren't met. 223 type BootstrapValidationError struct { 224 field string 225 reason string 226 cause error 227 key bool 228 } 229 230 // Field function returns field value. 231 func (e BootstrapValidationError) Field() string { return e.field } 232 233 // Reason function returns reason value. 234 func (e BootstrapValidationError) Reason() string { return e.reason } 235 236 // Cause function returns cause value. 237 func (e BootstrapValidationError) Cause() error { return e.cause } 238 239 // Key function returns key value. 240 func (e BootstrapValidationError) Key() bool { return e.key } 241 242 // ErrorName returns error name. 243 func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" } 244 245 // Error satisfies the builtin error interface 246 func (e BootstrapValidationError) Error() string { 247 cause := "" 248 if e.cause != nil { 249 cause = fmt.Sprintf(" | caused by: %v", e.cause) 250 } 251 252 key := "" 253 if e.key { 254 key = "key for " 255 } 256 257 return fmt.Sprintf( 258 "invalid %sBootstrap.%s: %s%s", 259 key, 260 e.field, 261 e.reason, 262 cause) 263 } 264 265 var _ error = BootstrapValidationError{} 266 267 var _ interface { 268 Field() string 269 Reason() string 270 Key() bool 271 Cause() error 272 ErrorName() string 273 } = BootstrapValidationError{} 274 275 // Validate checks the field values on Admin with the rules defined in the 276 // proto definition for this message. If any rules are violated, an error is returned. 277 func (m *Admin) Validate() error { 278 if m == nil { 279 return nil 280 } 281 282 // no validation rules for AccessLogPath 283 284 // no validation rules for ProfilePath 285 286 if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { 287 if err := v.Validate(); err != nil { 288 return AdminValidationError{ 289 field: "Address", 290 reason: "embedded message failed validation", 291 cause: err, 292 } 293 } 294 } 295 296 for idx, item := range m.GetSocketOptions() { 297 _, _ = idx, item 298 299 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 300 if err := v.Validate(); err != nil { 301 return AdminValidationError{ 302 field: fmt.Sprintf("SocketOptions[%v]", idx), 303 reason: "embedded message failed validation", 304 cause: err, 305 } 306 } 307 } 308 309 } 310 311 return nil 312 } 313 314 // AdminValidationError is the validation error returned by Admin.Validate if 315 // the designated constraints aren't met. 316 type AdminValidationError struct { 317 field string 318 reason string 319 cause error 320 key bool 321 } 322 323 // Field function returns field value. 324 func (e AdminValidationError) Field() string { return e.field } 325 326 // Reason function returns reason value. 327 func (e AdminValidationError) Reason() string { return e.reason } 328 329 // Cause function returns cause value. 330 func (e AdminValidationError) Cause() error { return e.cause } 331 332 // Key function returns key value. 333 func (e AdminValidationError) Key() bool { return e.key } 334 335 // ErrorName returns error name. 336 func (e AdminValidationError) ErrorName() string { return "AdminValidationError" } 337 338 // Error satisfies the builtin error interface 339 func (e AdminValidationError) Error() string { 340 cause := "" 341 if e.cause != nil { 342 cause = fmt.Sprintf(" | caused by: %v", e.cause) 343 } 344 345 key := "" 346 if e.key { 347 key = "key for " 348 } 349 350 return fmt.Sprintf( 351 "invalid %sAdmin.%s: %s%s", 352 key, 353 e.field, 354 e.reason, 355 cause) 356 } 357 358 var _ error = AdminValidationError{} 359 360 var _ interface { 361 Field() string 362 Reason() string 363 Key() bool 364 Cause() error 365 ErrorName() string 366 } = AdminValidationError{} 367 368 // Validate checks the field values on ClusterManager with the rules defined in 369 // the proto definition for this message. If any rules are violated, an error 370 // is returned. 371 func (m *ClusterManager) Validate() error { 372 if m == nil { 373 return nil 374 } 375 376 // no validation rules for LocalClusterName 377 378 if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok { 379 if err := v.Validate(); err != nil { 380 return ClusterManagerValidationError{ 381 field: "OutlierDetection", 382 reason: "embedded message failed validation", 383 cause: err, 384 } 385 } 386 } 387 388 if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok { 389 if err := v.Validate(); err != nil { 390 return ClusterManagerValidationError{ 391 field: "UpstreamBindConfig", 392 reason: "embedded message failed validation", 393 cause: err, 394 } 395 } 396 } 397 398 if v, ok := interface{}(m.GetLoadStatsConfig()).(interface{ Validate() error }); ok { 399 if err := v.Validate(); err != nil { 400 return ClusterManagerValidationError{ 401 field: "LoadStatsConfig", 402 reason: "embedded message failed validation", 403 cause: err, 404 } 405 } 406 } 407 408 return nil 409 } 410 411 // ClusterManagerValidationError is the validation error returned by 412 // ClusterManager.Validate if the designated constraints aren't met. 413 type ClusterManagerValidationError struct { 414 field string 415 reason string 416 cause error 417 key bool 418 } 419 420 // Field function returns field value. 421 func (e ClusterManagerValidationError) Field() string { return e.field } 422 423 // Reason function returns reason value. 424 func (e ClusterManagerValidationError) Reason() string { return e.reason } 425 426 // Cause function returns cause value. 427 func (e ClusterManagerValidationError) Cause() error { return e.cause } 428 429 // Key function returns key value. 430 func (e ClusterManagerValidationError) Key() bool { return e.key } 431 432 // ErrorName returns error name. 433 func (e ClusterManagerValidationError) ErrorName() string { return "ClusterManagerValidationError" } 434 435 // Error satisfies the builtin error interface 436 func (e ClusterManagerValidationError) Error() string { 437 cause := "" 438 if e.cause != nil { 439 cause = fmt.Sprintf(" | caused by: %v", e.cause) 440 } 441 442 key := "" 443 if e.key { 444 key = "key for " 445 } 446 447 return fmt.Sprintf( 448 "invalid %sClusterManager.%s: %s%s", 449 key, 450 e.field, 451 e.reason, 452 cause) 453 } 454 455 var _ error = ClusterManagerValidationError{} 456 457 var _ interface { 458 Field() string 459 Reason() string 460 Key() bool 461 Cause() error 462 ErrorName() string 463 } = ClusterManagerValidationError{} 464 465 // Validate checks the field values on Watchdog with the rules defined in the 466 // proto definition for this message. If any rules are violated, an error is returned. 467 func (m *Watchdog) Validate() error { 468 if m == nil { 469 return nil 470 } 471 472 if v, ok := interface{}(m.GetMissTimeout()).(interface{ Validate() error }); ok { 473 if err := v.Validate(); err != nil { 474 return WatchdogValidationError{ 475 field: "MissTimeout", 476 reason: "embedded message failed validation", 477 cause: err, 478 } 479 } 480 } 481 482 if v, ok := interface{}(m.GetMegamissTimeout()).(interface{ Validate() error }); ok { 483 if err := v.Validate(); err != nil { 484 return WatchdogValidationError{ 485 field: "MegamissTimeout", 486 reason: "embedded message failed validation", 487 cause: err, 488 } 489 } 490 } 491 492 if v, ok := interface{}(m.GetKillTimeout()).(interface{ Validate() error }); ok { 493 if err := v.Validate(); err != nil { 494 return WatchdogValidationError{ 495 field: "KillTimeout", 496 reason: "embedded message failed validation", 497 cause: err, 498 } 499 } 500 } 501 502 if v, ok := interface{}(m.GetMultikillTimeout()).(interface{ Validate() error }); ok { 503 if err := v.Validate(); err != nil { 504 return WatchdogValidationError{ 505 field: "MultikillTimeout", 506 reason: "embedded message failed validation", 507 cause: err, 508 } 509 } 510 } 511 512 return nil 513 } 514 515 // WatchdogValidationError is the validation error returned by 516 // Watchdog.Validate if the designated constraints aren't met. 517 type WatchdogValidationError struct { 518 field string 519 reason string 520 cause error 521 key bool 522 } 523 524 // Field function returns field value. 525 func (e WatchdogValidationError) Field() string { return e.field } 526 527 // Reason function returns reason value. 528 func (e WatchdogValidationError) Reason() string { return e.reason } 529 530 // Cause function returns cause value. 531 func (e WatchdogValidationError) Cause() error { return e.cause } 532 533 // Key function returns key value. 534 func (e WatchdogValidationError) Key() bool { return e.key } 535 536 // ErrorName returns error name. 537 func (e WatchdogValidationError) ErrorName() string { return "WatchdogValidationError" } 538 539 // Error satisfies the builtin error interface 540 func (e WatchdogValidationError) Error() string { 541 cause := "" 542 if e.cause != nil { 543 cause = fmt.Sprintf(" | caused by: %v", e.cause) 544 } 545 546 key := "" 547 if e.key { 548 key = "key for " 549 } 550 551 return fmt.Sprintf( 552 "invalid %sWatchdog.%s: %s%s", 553 key, 554 e.field, 555 e.reason, 556 cause) 557 } 558 559 var _ error = WatchdogValidationError{} 560 561 var _ interface { 562 Field() string 563 Reason() string 564 Key() bool 565 Cause() error 566 ErrorName() string 567 } = WatchdogValidationError{} 568 569 // Validate checks the field values on Runtime with the rules defined in the 570 // proto definition for this message. If any rules are violated, an error is returned. 571 func (m *Runtime) Validate() error { 572 if m == nil { 573 return nil 574 } 575 576 // no validation rules for SymlinkRoot 577 578 // no validation rules for Subdirectory 579 580 // no validation rules for OverrideSubdirectory 581 582 if v, ok := interface{}(m.GetBase()).(interface{ Validate() error }); ok { 583 if err := v.Validate(); err != nil { 584 return RuntimeValidationError{ 585 field: "Base", 586 reason: "embedded message failed validation", 587 cause: err, 588 } 589 } 590 } 591 592 return nil 593 } 594 595 // RuntimeValidationError is the validation error returned by Runtime.Validate 596 // if the designated constraints aren't met. 597 type RuntimeValidationError struct { 598 field string 599 reason string 600 cause error 601 key bool 602 } 603 604 // Field function returns field value. 605 func (e RuntimeValidationError) Field() string { return e.field } 606 607 // Reason function returns reason value. 608 func (e RuntimeValidationError) Reason() string { return e.reason } 609 610 // Cause function returns cause value. 611 func (e RuntimeValidationError) Cause() error { return e.cause } 612 613 // Key function returns key value. 614 func (e RuntimeValidationError) Key() bool { return e.key } 615 616 // ErrorName returns error name. 617 func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" } 618 619 // Error satisfies the builtin error interface 620 func (e RuntimeValidationError) Error() string { 621 cause := "" 622 if e.cause != nil { 623 cause = fmt.Sprintf(" | caused by: %v", e.cause) 624 } 625 626 key := "" 627 if e.key { 628 key = "key for " 629 } 630 631 return fmt.Sprintf( 632 "invalid %sRuntime.%s: %s%s", 633 key, 634 e.field, 635 e.reason, 636 cause) 637 } 638 639 var _ error = RuntimeValidationError{} 640 641 var _ interface { 642 Field() string 643 Reason() string 644 Key() bool 645 Cause() error 646 ErrorName() string 647 } = RuntimeValidationError{} 648 649 // Validate checks the field values on RuntimeLayer with the rules defined in 650 // the proto definition for this message. If any rules are violated, an error 651 // is returned. 652 func (m *RuntimeLayer) Validate() error { 653 if m == nil { 654 return nil 655 } 656 657 if len(m.GetName()) < 1 { 658 return RuntimeLayerValidationError{ 659 field: "Name", 660 reason: "value length must be at least 1 bytes", 661 } 662 } 663 664 switch m.LayerSpecifier.(type) { 665 666 case *RuntimeLayer_StaticLayer: 667 668 if v, ok := interface{}(m.GetStaticLayer()).(interface{ Validate() error }); ok { 669 if err := v.Validate(); err != nil { 670 return RuntimeLayerValidationError{ 671 field: "StaticLayer", 672 reason: "embedded message failed validation", 673 cause: err, 674 } 675 } 676 } 677 678 case *RuntimeLayer_DiskLayer_: 679 680 if v, ok := interface{}(m.GetDiskLayer()).(interface{ Validate() error }); ok { 681 if err := v.Validate(); err != nil { 682 return RuntimeLayerValidationError{ 683 field: "DiskLayer", 684 reason: "embedded message failed validation", 685 cause: err, 686 } 687 } 688 } 689 690 case *RuntimeLayer_AdminLayer_: 691 692 if v, ok := interface{}(m.GetAdminLayer()).(interface{ Validate() error }); ok { 693 if err := v.Validate(); err != nil { 694 return RuntimeLayerValidationError{ 695 field: "AdminLayer", 696 reason: "embedded message failed validation", 697 cause: err, 698 } 699 } 700 } 701 702 case *RuntimeLayer_RtdsLayer_: 703 704 if v, ok := interface{}(m.GetRtdsLayer()).(interface{ Validate() error }); ok { 705 if err := v.Validate(); err != nil { 706 return RuntimeLayerValidationError{ 707 field: "RtdsLayer", 708 reason: "embedded message failed validation", 709 cause: err, 710 } 711 } 712 } 713 714 default: 715 return RuntimeLayerValidationError{ 716 field: "LayerSpecifier", 717 reason: "value is required", 718 } 719 720 } 721 722 return nil 723 } 724 725 // RuntimeLayerValidationError is the validation error returned by 726 // RuntimeLayer.Validate if the designated constraints aren't met. 727 type RuntimeLayerValidationError struct { 728 field string 729 reason string 730 cause error 731 key bool 732 } 733 734 // Field function returns field value. 735 func (e RuntimeLayerValidationError) Field() string { return e.field } 736 737 // Reason function returns reason value. 738 func (e RuntimeLayerValidationError) Reason() string { return e.reason } 739 740 // Cause function returns cause value. 741 func (e RuntimeLayerValidationError) Cause() error { return e.cause } 742 743 // Key function returns key value. 744 func (e RuntimeLayerValidationError) Key() bool { return e.key } 745 746 // ErrorName returns error name. 747 func (e RuntimeLayerValidationError) ErrorName() string { return "RuntimeLayerValidationError" } 748 749 // Error satisfies the builtin error interface 750 func (e RuntimeLayerValidationError) Error() string { 751 cause := "" 752 if e.cause != nil { 753 cause = fmt.Sprintf(" | caused by: %v", e.cause) 754 } 755 756 key := "" 757 if e.key { 758 key = "key for " 759 } 760 761 return fmt.Sprintf( 762 "invalid %sRuntimeLayer.%s: %s%s", 763 key, 764 e.field, 765 e.reason, 766 cause) 767 } 768 769 var _ error = RuntimeLayerValidationError{} 770 771 var _ interface { 772 Field() string 773 Reason() string 774 Key() bool 775 Cause() error 776 ErrorName() string 777 } = RuntimeLayerValidationError{} 778 779 // Validate checks the field values on LayeredRuntime with the rules defined in 780 // the proto definition for this message. If any rules are violated, an error 781 // is returned. 782 func (m *LayeredRuntime) Validate() error { 783 if m == nil { 784 return nil 785 } 786 787 for idx, item := range m.GetLayers() { 788 _, _ = idx, item 789 790 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 791 if err := v.Validate(); err != nil { 792 return LayeredRuntimeValidationError{ 793 field: fmt.Sprintf("Layers[%v]", idx), 794 reason: "embedded message failed validation", 795 cause: err, 796 } 797 } 798 } 799 800 } 801 802 return nil 803 } 804 805 // LayeredRuntimeValidationError is the validation error returned by 806 // LayeredRuntime.Validate if the designated constraints aren't met. 807 type LayeredRuntimeValidationError struct { 808 field string 809 reason string 810 cause error 811 key bool 812 } 813 814 // Field function returns field value. 815 func (e LayeredRuntimeValidationError) Field() string { return e.field } 816 817 // Reason function returns reason value. 818 func (e LayeredRuntimeValidationError) Reason() string { return e.reason } 819 820 // Cause function returns cause value. 821 func (e LayeredRuntimeValidationError) Cause() error { return e.cause } 822 823 // Key function returns key value. 824 func (e LayeredRuntimeValidationError) Key() bool { return e.key } 825 826 // ErrorName returns error name. 827 func (e LayeredRuntimeValidationError) ErrorName() string { return "LayeredRuntimeValidationError" } 828 829 // Error satisfies the builtin error interface 830 func (e LayeredRuntimeValidationError) Error() string { 831 cause := "" 832 if e.cause != nil { 833 cause = fmt.Sprintf(" | caused by: %v", e.cause) 834 } 835 836 key := "" 837 if e.key { 838 key = "key for " 839 } 840 841 return fmt.Sprintf( 842 "invalid %sLayeredRuntime.%s: %s%s", 843 key, 844 e.field, 845 e.reason, 846 cause) 847 } 848 849 var _ error = LayeredRuntimeValidationError{} 850 851 var _ interface { 852 Field() string 853 Reason() string 854 Key() bool 855 Cause() error 856 ErrorName() string 857 } = LayeredRuntimeValidationError{} 858 859 // Validate checks the field values on Bootstrap_StaticResources with the rules 860 // defined in the proto definition for this message. If any rules are 861 // violated, an error is returned. 862 func (m *Bootstrap_StaticResources) Validate() error { 863 if m == nil { 864 return nil 865 } 866 867 for idx, item := range m.GetListeners() { 868 _, _ = idx, item 869 870 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 871 if err := v.Validate(); err != nil { 872 return Bootstrap_StaticResourcesValidationError{ 873 field: fmt.Sprintf("Listeners[%v]", idx), 874 reason: "embedded message failed validation", 875 cause: err, 876 } 877 } 878 } 879 880 } 881 882 for idx, item := range m.GetClusters() { 883 _, _ = idx, item 884 885 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 886 if err := v.Validate(); err != nil { 887 return Bootstrap_StaticResourcesValidationError{ 888 field: fmt.Sprintf("Clusters[%v]", idx), 889 reason: "embedded message failed validation", 890 cause: err, 891 } 892 } 893 } 894 895 } 896 897 for idx, item := range m.GetSecrets() { 898 _, _ = idx, item 899 900 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 901 if err := v.Validate(); err != nil { 902 return Bootstrap_StaticResourcesValidationError{ 903 field: fmt.Sprintf("Secrets[%v]", idx), 904 reason: "embedded message failed validation", 905 cause: err, 906 } 907 } 908 } 909 910 } 911 912 return nil 913 } 914 915 // Bootstrap_StaticResourcesValidationError is the validation error returned by 916 // Bootstrap_StaticResources.Validate if the designated constraints aren't met. 917 type Bootstrap_StaticResourcesValidationError struct { 918 field string 919 reason string 920 cause error 921 key bool 922 } 923 924 // Field function returns field value. 925 func (e Bootstrap_StaticResourcesValidationError) Field() string { return e.field } 926 927 // Reason function returns reason value. 928 func (e Bootstrap_StaticResourcesValidationError) Reason() string { return e.reason } 929 930 // Cause function returns cause value. 931 func (e Bootstrap_StaticResourcesValidationError) Cause() error { return e.cause } 932 933 // Key function returns key value. 934 func (e Bootstrap_StaticResourcesValidationError) Key() bool { return e.key } 935 936 // ErrorName returns error name. 937 func (e Bootstrap_StaticResourcesValidationError) ErrorName() string { 938 return "Bootstrap_StaticResourcesValidationError" 939 } 940 941 // Error satisfies the builtin error interface 942 func (e Bootstrap_StaticResourcesValidationError) Error() string { 943 cause := "" 944 if e.cause != nil { 945 cause = fmt.Sprintf(" | caused by: %v", e.cause) 946 } 947 948 key := "" 949 if e.key { 950 key = "key for " 951 } 952 953 return fmt.Sprintf( 954 "invalid %sBootstrap_StaticResources.%s: %s%s", 955 key, 956 e.field, 957 e.reason, 958 cause) 959 } 960 961 var _ error = Bootstrap_StaticResourcesValidationError{} 962 963 var _ interface { 964 Field() string 965 Reason() string 966 Key() bool 967 Cause() error 968 ErrorName() string 969 } = Bootstrap_StaticResourcesValidationError{} 970 971 // Validate checks the field values on Bootstrap_DynamicResources with the 972 // rules defined in the proto definition for this message. If any rules are 973 // violated, an error is returned. 974 func (m *Bootstrap_DynamicResources) Validate() error { 975 if m == nil { 976 return nil 977 } 978 979 if v, ok := interface{}(m.GetLdsConfig()).(interface{ Validate() error }); ok { 980 if err := v.Validate(); err != nil { 981 return Bootstrap_DynamicResourcesValidationError{ 982 field: "LdsConfig", 983 reason: "embedded message failed validation", 984 cause: err, 985 } 986 } 987 } 988 989 if v, ok := interface{}(m.GetCdsConfig()).(interface{ Validate() error }); ok { 990 if err := v.Validate(); err != nil { 991 return Bootstrap_DynamicResourcesValidationError{ 992 field: "CdsConfig", 993 reason: "embedded message failed validation", 994 cause: err, 995 } 996 } 997 } 998 999 if v, ok := interface{}(m.GetAdsConfig()).(interface{ Validate() error }); ok { 1000 if err := v.Validate(); err != nil { 1001 return Bootstrap_DynamicResourcesValidationError{ 1002 field: "AdsConfig", 1003 reason: "embedded message failed validation", 1004 cause: err, 1005 } 1006 } 1007 } 1008 1009 return nil 1010 } 1011 1012 // Bootstrap_DynamicResourcesValidationError is the validation error returned 1013 // by Bootstrap_DynamicResources.Validate if the designated constraints aren't met. 1014 type Bootstrap_DynamicResourcesValidationError struct { 1015 field string 1016 reason string 1017 cause error 1018 key bool 1019 } 1020 1021 // Field function returns field value. 1022 func (e Bootstrap_DynamicResourcesValidationError) Field() string { return e.field } 1023 1024 // Reason function returns reason value. 1025 func (e Bootstrap_DynamicResourcesValidationError) Reason() string { return e.reason } 1026 1027 // Cause function returns cause value. 1028 func (e Bootstrap_DynamicResourcesValidationError) Cause() error { return e.cause } 1029 1030 // Key function returns key value. 1031 func (e Bootstrap_DynamicResourcesValidationError) Key() bool { return e.key } 1032 1033 // ErrorName returns error name. 1034 func (e Bootstrap_DynamicResourcesValidationError) ErrorName() string { 1035 return "Bootstrap_DynamicResourcesValidationError" 1036 } 1037 1038 // Error satisfies the builtin error interface 1039 func (e Bootstrap_DynamicResourcesValidationError) Error() string { 1040 cause := "" 1041 if e.cause != nil { 1042 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1043 } 1044 1045 key := "" 1046 if e.key { 1047 key = "key for " 1048 } 1049 1050 return fmt.Sprintf( 1051 "invalid %sBootstrap_DynamicResources.%s: %s%s", 1052 key, 1053 e.field, 1054 e.reason, 1055 cause) 1056 } 1057 1058 var _ error = Bootstrap_DynamicResourcesValidationError{} 1059 1060 var _ interface { 1061 Field() string 1062 Reason() string 1063 Key() bool 1064 Cause() error 1065 ErrorName() string 1066 } = Bootstrap_DynamicResourcesValidationError{} 1067 1068 // Validate checks the field values on ClusterManager_OutlierDetection with the 1069 // rules defined in the proto definition for this message. If any rules are 1070 // violated, an error is returned. 1071 func (m *ClusterManager_OutlierDetection) Validate() error { 1072 if m == nil { 1073 return nil 1074 } 1075 1076 // no validation rules for EventLogPath 1077 1078 if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok { 1079 if err := v.Validate(); err != nil { 1080 return ClusterManager_OutlierDetectionValidationError{ 1081 field: "EventService", 1082 reason: "embedded message failed validation", 1083 cause: err, 1084 } 1085 } 1086 } 1087 1088 return nil 1089 } 1090 1091 // ClusterManager_OutlierDetectionValidationError is the validation error 1092 // returned by ClusterManager_OutlierDetection.Validate if the designated 1093 // constraints aren't met. 1094 type ClusterManager_OutlierDetectionValidationError struct { 1095 field string 1096 reason string 1097 cause error 1098 key bool 1099 } 1100 1101 // Field function returns field value. 1102 func (e ClusterManager_OutlierDetectionValidationError) Field() string { return e.field } 1103 1104 // Reason function returns reason value. 1105 func (e ClusterManager_OutlierDetectionValidationError) Reason() string { return e.reason } 1106 1107 // Cause function returns cause value. 1108 func (e ClusterManager_OutlierDetectionValidationError) Cause() error { return e.cause } 1109 1110 // Key function returns key value. 1111 func (e ClusterManager_OutlierDetectionValidationError) Key() bool { return e.key } 1112 1113 // ErrorName returns error name. 1114 func (e ClusterManager_OutlierDetectionValidationError) ErrorName() string { 1115 return "ClusterManager_OutlierDetectionValidationError" 1116 } 1117 1118 // Error satisfies the builtin error interface 1119 func (e ClusterManager_OutlierDetectionValidationError) Error() string { 1120 cause := "" 1121 if e.cause != nil { 1122 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1123 } 1124 1125 key := "" 1126 if e.key { 1127 key = "key for " 1128 } 1129 1130 return fmt.Sprintf( 1131 "invalid %sClusterManager_OutlierDetection.%s: %s%s", 1132 key, 1133 e.field, 1134 e.reason, 1135 cause) 1136 } 1137 1138 var _ error = ClusterManager_OutlierDetectionValidationError{} 1139 1140 var _ interface { 1141 Field() string 1142 Reason() string 1143 Key() bool 1144 Cause() error 1145 ErrorName() string 1146 } = ClusterManager_OutlierDetectionValidationError{} 1147 1148 // Validate checks the field values on RuntimeLayer_DiskLayer with the rules 1149 // defined in the proto definition for this message. If any rules are 1150 // violated, an error is returned. 1151 func (m *RuntimeLayer_DiskLayer) Validate() error { 1152 if m == nil { 1153 return nil 1154 } 1155 1156 // no validation rules for SymlinkRoot 1157 1158 // no validation rules for Subdirectory 1159 1160 // no validation rules for AppendServiceCluster 1161 1162 return nil 1163 } 1164 1165 // RuntimeLayer_DiskLayerValidationError is the validation error returned by 1166 // RuntimeLayer_DiskLayer.Validate if the designated constraints aren't met. 1167 type RuntimeLayer_DiskLayerValidationError struct { 1168 field string 1169 reason string 1170 cause error 1171 key bool 1172 } 1173 1174 // Field function returns field value. 1175 func (e RuntimeLayer_DiskLayerValidationError) Field() string { return e.field } 1176 1177 // Reason function returns reason value. 1178 func (e RuntimeLayer_DiskLayerValidationError) Reason() string { return e.reason } 1179 1180 // Cause function returns cause value. 1181 func (e RuntimeLayer_DiskLayerValidationError) Cause() error { return e.cause } 1182 1183 // Key function returns key value. 1184 func (e RuntimeLayer_DiskLayerValidationError) Key() bool { return e.key } 1185 1186 // ErrorName returns error name. 1187 func (e RuntimeLayer_DiskLayerValidationError) ErrorName() string { 1188 return "RuntimeLayer_DiskLayerValidationError" 1189 } 1190 1191 // Error satisfies the builtin error interface 1192 func (e RuntimeLayer_DiskLayerValidationError) Error() string { 1193 cause := "" 1194 if e.cause != nil { 1195 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1196 } 1197 1198 key := "" 1199 if e.key { 1200 key = "key for " 1201 } 1202 1203 return fmt.Sprintf( 1204 "invalid %sRuntimeLayer_DiskLayer.%s: %s%s", 1205 key, 1206 e.field, 1207 e.reason, 1208 cause) 1209 } 1210 1211 var _ error = RuntimeLayer_DiskLayerValidationError{} 1212 1213 var _ interface { 1214 Field() string 1215 Reason() string 1216 Key() bool 1217 Cause() error 1218 ErrorName() string 1219 } = RuntimeLayer_DiskLayerValidationError{} 1220 1221 // Validate checks the field values on RuntimeLayer_AdminLayer with the rules 1222 // defined in the proto definition for this message. If any rules are 1223 // violated, an error is returned. 1224 func (m *RuntimeLayer_AdminLayer) Validate() error { 1225 if m == nil { 1226 return nil 1227 } 1228 1229 return nil 1230 } 1231 1232 // RuntimeLayer_AdminLayerValidationError is the validation error returned by 1233 // RuntimeLayer_AdminLayer.Validate if the designated constraints aren't met. 1234 type RuntimeLayer_AdminLayerValidationError struct { 1235 field string 1236 reason string 1237 cause error 1238 key bool 1239 } 1240 1241 // Field function returns field value. 1242 func (e RuntimeLayer_AdminLayerValidationError) Field() string { return e.field } 1243 1244 // Reason function returns reason value. 1245 func (e RuntimeLayer_AdminLayerValidationError) Reason() string { return e.reason } 1246 1247 // Cause function returns cause value. 1248 func (e RuntimeLayer_AdminLayerValidationError) Cause() error { return e.cause } 1249 1250 // Key function returns key value. 1251 func (e RuntimeLayer_AdminLayerValidationError) Key() bool { return e.key } 1252 1253 // ErrorName returns error name. 1254 func (e RuntimeLayer_AdminLayerValidationError) ErrorName() string { 1255 return "RuntimeLayer_AdminLayerValidationError" 1256 } 1257 1258 // Error satisfies the builtin error interface 1259 func (e RuntimeLayer_AdminLayerValidationError) Error() string { 1260 cause := "" 1261 if e.cause != nil { 1262 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1263 } 1264 1265 key := "" 1266 if e.key { 1267 key = "key for " 1268 } 1269 1270 return fmt.Sprintf( 1271 "invalid %sRuntimeLayer_AdminLayer.%s: %s%s", 1272 key, 1273 e.field, 1274 e.reason, 1275 cause) 1276 } 1277 1278 var _ error = RuntimeLayer_AdminLayerValidationError{} 1279 1280 var _ interface { 1281 Field() string 1282 Reason() string 1283 Key() bool 1284 Cause() error 1285 ErrorName() string 1286 } = RuntimeLayer_AdminLayerValidationError{} 1287 1288 // Validate checks the field values on RuntimeLayer_RtdsLayer with the rules 1289 // defined in the proto definition for this message. If any rules are 1290 // violated, an error is returned. 1291 func (m *RuntimeLayer_RtdsLayer) Validate() error { 1292 if m == nil { 1293 return nil 1294 } 1295 1296 // no validation rules for Name 1297 1298 if v, ok := interface{}(m.GetRtdsConfig()).(interface{ Validate() error }); ok { 1299 if err := v.Validate(); err != nil { 1300 return RuntimeLayer_RtdsLayerValidationError{ 1301 field: "RtdsConfig", 1302 reason: "embedded message failed validation", 1303 cause: err, 1304 } 1305 } 1306 } 1307 1308 return nil 1309 } 1310 1311 // RuntimeLayer_RtdsLayerValidationError is the validation error returned by 1312 // RuntimeLayer_RtdsLayer.Validate if the designated constraints aren't met. 1313 type RuntimeLayer_RtdsLayerValidationError struct { 1314 field string 1315 reason string 1316 cause error 1317 key bool 1318 } 1319 1320 // Field function returns field value. 1321 func (e RuntimeLayer_RtdsLayerValidationError) Field() string { return e.field } 1322 1323 // Reason function returns reason value. 1324 func (e RuntimeLayer_RtdsLayerValidationError) Reason() string { return e.reason } 1325 1326 // Cause function returns cause value. 1327 func (e RuntimeLayer_RtdsLayerValidationError) Cause() error { return e.cause } 1328 1329 // Key function returns key value. 1330 func (e RuntimeLayer_RtdsLayerValidationError) Key() bool { return e.key } 1331 1332 // ErrorName returns error name. 1333 func (e RuntimeLayer_RtdsLayerValidationError) ErrorName() string { 1334 return "RuntimeLayer_RtdsLayerValidationError" 1335 } 1336 1337 // Error satisfies the builtin error interface 1338 func (e RuntimeLayer_RtdsLayerValidationError) Error() string { 1339 cause := "" 1340 if e.cause != nil { 1341 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1342 } 1343 1344 key := "" 1345 if e.key { 1346 key = "key for " 1347 } 1348 1349 return fmt.Sprintf( 1350 "invalid %sRuntimeLayer_RtdsLayer.%s: %s%s", 1351 key, 1352 e.field, 1353 e.reason, 1354 cause) 1355 } 1356 1357 var _ error = RuntimeLayer_RtdsLayerValidationError{} 1358 1359 var _ interface { 1360 Field() string 1361 Reason() string 1362 Key() bool 1363 Cause() error 1364 ErrorName() string 1365 } = RuntimeLayer_RtdsLayerValidationError{}