gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/config/core/v3/base.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/config/core/v3/base.proto 3 4 package envoy_config_core_v3 5 6 import ( 7 "bytes" 8 "errors" 9 "fmt" 10 "net" 11 "net/mail" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 "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 Locality with the rules defined in the 37 // proto definition for this message. If any rules are violated, an error is returned. 38 func (m *Locality) Validate() error { 39 if m == nil { 40 return nil 41 } 42 43 // no validation rules for Region 44 45 // no validation rules for Zone 46 47 // no validation rules for SubZone 48 49 return nil 50 } 51 52 // LocalityValidationError is the validation error returned by 53 // Locality.Validate if the designated constraints aren't met. 54 type LocalityValidationError struct { 55 field string 56 reason string 57 cause error 58 key bool 59 } 60 61 // Field function returns field value. 62 func (e LocalityValidationError) Field() string { return e.field } 63 64 // Reason function returns reason value. 65 func (e LocalityValidationError) Reason() string { return e.reason } 66 67 // Cause function returns cause value. 68 func (e LocalityValidationError) Cause() error { return e.cause } 69 70 // Key function returns key value. 71 func (e LocalityValidationError) Key() bool { return e.key } 72 73 // ErrorName returns error name. 74 func (e LocalityValidationError) ErrorName() string { return "LocalityValidationError" } 75 76 // Error satisfies the builtin error interface 77 func (e LocalityValidationError) Error() string { 78 cause := "" 79 if e.cause != nil { 80 cause = fmt.Sprintf(" | caused by: %v", e.cause) 81 } 82 83 key := "" 84 if e.key { 85 key = "key for " 86 } 87 88 return fmt.Sprintf( 89 "invalid %sLocality.%s: %s%s", 90 key, 91 e.field, 92 e.reason, 93 cause) 94 } 95 96 var _ error = LocalityValidationError{} 97 98 var _ interface { 99 Field() string 100 Reason() string 101 Key() bool 102 Cause() error 103 ErrorName() string 104 } = LocalityValidationError{} 105 106 // Validate checks the field values on BuildVersion with the rules defined in 107 // the proto definition for this message. If any rules are violated, an error 108 // is returned. 109 func (m *BuildVersion) Validate() error { 110 if m == nil { 111 return nil 112 } 113 114 if v, ok := interface{}(m.GetVersion()).(interface{ Validate() error }); ok { 115 if err := v.Validate(); err != nil { 116 return BuildVersionValidationError{ 117 field: "Version", 118 reason: "embedded message failed validation", 119 cause: err, 120 } 121 } 122 } 123 124 if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { 125 if err := v.Validate(); err != nil { 126 return BuildVersionValidationError{ 127 field: "Metadata", 128 reason: "embedded message failed validation", 129 cause: err, 130 } 131 } 132 } 133 134 return nil 135 } 136 137 // BuildVersionValidationError is the validation error returned by 138 // BuildVersion.Validate if the designated constraints aren't met. 139 type BuildVersionValidationError struct { 140 field string 141 reason string 142 cause error 143 key bool 144 } 145 146 // Field function returns field value. 147 func (e BuildVersionValidationError) Field() string { return e.field } 148 149 // Reason function returns reason value. 150 func (e BuildVersionValidationError) Reason() string { return e.reason } 151 152 // Cause function returns cause value. 153 func (e BuildVersionValidationError) Cause() error { return e.cause } 154 155 // Key function returns key value. 156 func (e BuildVersionValidationError) Key() bool { return e.key } 157 158 // ErrorName returns error name. 159 func (e BuildVersionValidationError) ErrorName() string { return "BuildVersionValidationError" } 160 161 // Error satisfies the builtin error interface 162 func (e BuildVersionValidationError) Error() string { 163 cause := "" 164 if e.cause != nil { 165 cause = fmt.Sprintf(" | caused by: %v", e.cause) 166 } 167 168 key := "" 169 if e.key { 170 key = "key for " 171 } 172 173 return fmt.Sprintf( 174 "invalid %sBuildVersion.%s: %s%s", 175 key, 176 e.field, 177 e.reason, 178 cause) 179 } 180 181 var _ error = BuildVersionValidationError{} 182 183 var _ interface { 184 Field() string 185 Reason() string 186 Key() bool 187 Cause() error 188 ErrorName() string 189 } = BuildVersionValidationError{} 190 191 // Validate checks the field values on Extension with the rules defined in the 192 // proto definition for this message. If any rules are violated, an error is returned. 193 func (m *Extension) Validate() error { 194 if m == nil { 195 return nil 196 } 197 198 // no validation rules for Name 199 200 // no validation rules for Category 201 202 // no validation rules for TypeDescriptor 203 204 if v, ok := interface{}(m.GetVersion()).(interface{ Validate() error }); ok { 205 if err := v.Validate(); err != nil { 206 return ExtensionValidationError{ 207 field: "Version", 208 reason: "embedded message failed validation", 209 cause: err, 210 } 211 } 212 } 213 214 // no validation rules for Disabled 215 216 return nil 217 } 218 219 // ExtensionValidationError is the validation error returned by 220 // Extension.Validate if the designated constraints aren't met. 221 type ExtensionValidationError struct { 222 field string 223 reason string 224 cause error 225 key bool 226 } 227 228 // Field function returns field value. 229 func (e ExtensionValidationError) Field() string { return e.field } 230 231 // Reason function returns reason value. 232 func (e ExtensionValidationError) Reason() string { return e.reason } 233 234 // Cause function returns cause value. 235 func (e ExtensionValidationError) Cause() error { return e.cause } 236 237 // Key function returns key value. 238 func (e ExtensionValidationError) Key() bool { return e.key } 239 240 // ErrorName returns error name. 241 func (e ExtensionValidationError) ErrorName() string { return "ExtensionValidationError" } 242 243 // Error satisfies the builtin error interface 244 func (e ExtensionValidationError) Error() string { 245 cause := "" 246 if e.cause != nil { 247 cause = fmt.Sprintf(" | caused by: %v", e.cause) 248 } 249 250 key := "" 251 if e.key { 252 key = "key for " 253 } 254 255 return fmt.Sprintf( 256 "invalid %sExtension.%s: %s%s", 257 key, 258 e.field, 259 e.reason, 260 cause) 261 } 262 263 var _ error = ExtensionValidationError{} 264 265 var _ interface { 266 Field() string 267 Reason() string 268 Key() bool 269 Cause() error 270 ErrorName() string 271 } = ExtensionValidationError{} 272 273 // Validate checks the field values on Node with the rules defined in the proto 274 // definition for this message. If any rules are violated, an error is returned. 275 func (m *Node) Validate() error { 276 if m == nil { 277 return nil 278 } 279 280 // no validation rules for Id 281 282 // no validation rules for Cluster 283 284 if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { 285 if err := v.Validate(); err != nil { 286 return NodeValidationError{ 287 field: "Metadata", 288 reason: "embedded message failed validation", 289 cause: err, 290 } 291 } 292 } 293 294 for key, val := range m.GetDynamicParameters() { 295 _ = val 296 297 // no validation rules for DynamicParameters[key] 298 299 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 300 if err := v.Validate(); err != nil { 301 return NodeValidationError{ 302 field: fmt.Sprintf("DynamicParameters[%v]", key), 303 reason: "embedded message failed validation", 304 cause: err, 305 } 306 } 307 } 308 309 } 310 311 if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { 312 if err := v.Validate(); err != nil { 313 return NodeValidationError{ 314 field: "Locality", 315 reason: "embedded message failed validation", 316 cause: err, 317 } 318 } 319 } 320 321 // no validation rules for UserAgentName 322 323 for idx, item := range m.GetExtensions() { 324 _, _ = idx, item 325 326 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 327 if err := v.Validate(); err != nil { 328 return NodeValidationError{ 329 field: fmt.Sprintf("Extensions[%v]", idx), 330 reason: "embedded message failed validation", 331 cause: err, 332 } 333 } 334 } 335 336 } 337 338 for idx, item := range m.GetListeningAddresses() { 339 _, _ = idx, item 340 341 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 342 if err := v.Validate(); err != nil { 343 return NodeValidationError{ 344 field: fmt.Sprintf("ListeningAddresses[%v]", idx), 345 reason: "embedded message failed validation", 346 cause: err, 347 } 348 } 349 } 350 351 } 352 353 // no validation rules for HiddenEnvoyDeprecatedBuildVersion 354 355 switch m.UserAgentVersionType.(type) { 356 357 case *Node_UserAgentVersion: 358 // no validation rules for UserAgentVersion 359 360 case *Node_UserAgentBuildVersion: 361 362 if v, ok := interface{}(m.GetUserAgentBuildVersion()).(interface{ Validate() error }); ok { 363 if err := v.Validate(); err != nil { 364 return NodeValidationError{ 365 field: "UserAgentBuildVersion", 366 reason: "embedded message failed validation", 367 cause: err, 368 } 369 } 370 } 371 372 } 373 374 return nil 375 } 376 377 // NodeValidationError is the validation error returned by Node.Validate if the 378 // designated constraints aren't met. 379 type NodeValidationError struct { 380 field string 381 reason string 382 cause error 383 key bool 384 } 385 386 // Field function returns field value. 387 func (e NodeValidationError) Field() string { return e.field } 388 389 // Reason function returns reason value. 390 func (e NodeValidationError) Reason() string { return e.reason } 391 392 // Cause function returns cause value. 393 func (e NodeValidationError) Cause() error { return e.cause } 394 395 // Key function returns key value. 396 func (e NodeValidationError) Key() bool { return e.key } 397 398 // ErrorName returns error name. 399 func (e NodeValidationError) ErrorName() string { return "NodeValidationError" } 400 401 // Error satisfies the builtin error interface 402 func (e NodeValidationError) Error() string { 403 cause := "" 404 if e.cause != nil { 405 cause = fmt.Sprintf(" | caused by: %v", e.cause) 406 } 407 408 key := "" 409 if e.key { 410 key = "key for " 411 } 412 413 return fmt.Sprintf( 414 "invalid %sNode.%s: %s%s", 415 key, 416 e.field, 417 e.reason, 418 cause) 419 } 420 421 var _ error = NodeValidationError{} 422 423 var _ interface { 424 Field() string 425 Reason() string 426 Key() bool 427 Cause() error 428 ErrorName() string 429 } = NodeValidationError{} 430 431 // Validate checks the field values on Metadata with the rules defined in the 432 // proto definition for this message. If any rules are violated, an error is returned. 433 func (m *Metadata) Validate() error { 434 if m == nil { 435 return nil 436 } 437 438 for key, val := range m.GetFilterMetadata() { 439 _ = val 440 441 // no validation rules for FilterMetadata[key] 442 443 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 444 if err := v.Validate(); err != nil { 445 return MetadataValidationError{ 446 field: fmt.Sprintf("FilterMetadata[%v]", key), 447 reason: "embedded message failed validation", 448 cause: err, 449 } 450 } 451 } 452 453 } 454 455 for key, val := range m.GetTypedFilterMetadata() { 456 _ = val 457 458 // no validation rules for TypedFilterMetadata[key] 459 460 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 461 if err := v.Validate(); err != nil { 462 return MetadataValidationError{ 463 field: fmt.Sprintf("TypedFilterMetadata[%v]", key), 464 reason: "embedded message failed validation", 465 cause: err, 466 } 467 } 468 } 469 470 } 471 472 return nil 473 } 474 475 // MetadataValidationError is the validation error returned by 476 // Metadata.Validate if the designated constraints aren't met. 477 type MetadataValidationError struct { 478 field string 479 reason string 480 cause error 481 key bool 482 } 483 484 // Field function returns field value. 485 func (e MetadataValidationError) Field() string { return e.field } 486 487 // Reason function returns reason value. 488 func (e MetadataValidationError) Reason() string { return e.reason } 489 490 // Cause function returns cause value. 491 func (e MetadataValidationError) Cause() error { return e.cause } 492 493 // Key function returns key value. 494 func (e MetadataValidationError) Key() bool { return e.key } 495 496 // ErrorName returns error name. 497 func (e MetadataValidationError) ErrorName() string { return "MetadataValidationError" } 498 499 // Error satisfies the builtin error interface 500 func (e MetadataValidationError) Error() string { 501 cause := "" 502 if e.cause != nil { 503 cause = fmt.Sprintf(" | caused by: %v", e.cause) 504 } 505 506 key := "" 507 if e.key { 508 key = "key for " 509 } 510 511 return fmt.Sprintf( 512 "invalid %sMetadata.%s: %s%s", 513 key, 514 e.field, 515 e.reason, 516 cause) 517 } 518 519 var _ error = MetadataValidationError{} 520 521 var _ interface { 522 Field() string 523 Reason() string 524 Key() bool 525 Cause() error 526 ErrorName() string 527 } = MetadataValidationError{} 528 529 // Validate checks the field values on RuntimeUInt32 with the rules defined in 530 // the proto definition for this message. If any rules are violated, an error 531 // is returned. 532 func (m *RuntimeUInt32) Validate() error { 533 if m == nil { 534 return nil 535 } 536 537 // no validation rules for DefaultValue 538 539 if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 { 540 return RuntimeUInt32ValidationError{ 541 field: "RuntimeKey", 542 reason: "value length must be at least 1 runes", 543 } 544 } 545 546 return nil 547 } 548 549 // RuntimeUInt32ValidationError is the validation error returned by 550 // RuntimeUInt32.Validate if the designated constraints aren't met. 551 type RuntimeUInt32ValidationError struct { 552 field string 553 reason string 554 cause error 555 key bool 556 } 557 558 // Field function returns field value. 559 func (e RuntimeUInt32ValidationError) Field() string { return e.field } 560 561 // Reason function returns reason value. 562 func (e RuntimeUInt32ValidationError) Reason() string { return e.reason } 563 564 // Cause function returns cause value. 565 func (e RuntimeUInt32ValidationError) Cause() error { return e.cause } 566 567 // Key function returns key value. 568 func (e RuntimeUInt32ValidationError) Key() bool { return e.key } 569 570 // ErrorName returns error name. 571 func (e RuntimeUInt32ValidationError) ErrorName() string { return "RuntimeUInt32ValidationError" } 572 573 // Error satisfies the builtin error interface 574 func (e RuntimeUInt32ValidationError) Error() string { 575 cause := "" 576 if e.cause != nil { 577 cause = fmt.Sprintf(" | caused by: %v", e.cause) 578 } 579 580 key := "" 581 if e.key { 582 key = "key for " 583 } 584 585 return fmt.Sprintf( 586 "invalid %sRuntimeUInt32.%s: %s%s", 587 key, 588 e.field, 589 e.reason, 590 cause) 591 } 592 593 var _ error = RuntimeUInt32ValidationError{} 594 595 var _ interface { 596 Field() string 597 Reason() string 598 Key() bool 599 Cause() error 600 ErrorName() string 601 } = RuntimeUInt32ValidationError{} 602 603 // Validate checks the field values on RuntimePercent with the rules defined in 604 // the proto definition for this message. If any rules are violated, an error 605 // is returned. 606 func (m *RuntimePercent) Validate() error { 607 if m == nil { 608 return nil 609 } 610 611 if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok { 612 if err := v.Validate(); err != nil { 613 return RuntimePercentValidationError{ 614 field: "DefaultValue", 615 reason: "embedded message failed validation", 616 cause: err, 617 } 618 } 619 } 620 621 if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 { 622 return RuntimePercentValidationError{ 623 field: "RuntimeKey", 624 reason: "value length must be at least 1 runes", 625 } 626 } 627 628 return nil 629 } 630 631 // RuntimePercentValidationError is the validation error returned by 632 // RuntimePercent.Validate if the designated constraints aren't met. 633 type RuntimePercentValidationError struct { 634 field string 635 reason string 636 cause error 637 key bool 638 } 639 640 // Field function returns field value. 641 func (e RuntimePercentValidationError) Field() string { return e.field } 642 643 // Reason function returns reason value. 644 func (e RuntimePercentValidationError) Reason() string { return e.reason } 645 646 // Cause function returns cause value. 647 func (e RuntimePercentValidationError) Cause() error { return e.cause } 648 649 // Key function returns key value. 650 func (e RuntimePercentValidationError) Key() bool { return e.key } 651 652 // ErrorName returns error name. 653 func (e RuntimePercentValidationError) ErrorName() string { return "RuntimePercentValidationError" } 654 655 // Error satisfies the builtin error interface 656 func (e RuntimePercentValidationError) Error() string { 657 cause := "" 658 if e.cause != nil { 659 cause = fmt.Sprintf(" | caused by: %v", e.cause) 660 } 661 662 key := "" 663 if e.key { 664 key = "key for " 665 } 666 667 return fmt.Sprintf( 668 "invalid %sRuntimePercent.%s: %s%s", 669 key, 670 e.field, 671 e.reason, 672 cause) 673 } 674 675 var _ error = RuntimePercentValidationError{} 676 677 var _ interface { 678 Field() string 679 Reason() string 680 Key() bool 681 Cause() error 682 ErrorName() string 683 } = RuntimePercentValidationError{} 684 685 // Validate checks the field values on RuntimeDouble with the rules defined in 686 // the proto definition for this message. If any rules are violated, an error 687 // is returned. 688 func (m *RuntimeDouble) Validate() error { 689 if m == nil { 690 return nil 691 } 692 693 // no validation rules for DefaultValue 694 695 if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 { 696 return RuntimeDoubleValidationError{ 697 field: "RuntimeKey", 698 reason: "value length must be at least 1 runes", 699 } 700 } 701 702 return nil 703 } 704 705 // RuntimeDoubleValidationError is the validation error returned by 706 // RuntimeDouble.Validate if the designated constraints aren't met. 707 type RuntimeDoubleValidationError struct { 708 field string 709 reason string 710 cause error 711 key bool 712 } 713 714 // Field function returns field value. 715 func (e RuntimeDoubleValidationError) Field() string { return e.field } 716 717 // Reason function returns reason value. 718 func (e RuntimeDoubleValidationError) Reason() string { return e.reason } 719 720 // Cause function returns cause value. 721 func (e RuntimeDoubleValidationError) Cause() error { return e.cause } 722 723 // Key function returns key value. 724 func (e RuntimeDoubleValidationError) Key() bool { return e.key } 725 726 // ErrorName returns error name. 727 func (e RuntimeDoubleValidationError) ErrorName() string { return "RuntimeDoubleValidationError" } 728 729 // Error satisfies the builtin error interface 730 func (e RuntimeDoubleValidationError) Error() string { 731 cause := "" 732 if e.cause != nil { 733 cause = fmt.Sprintf(" | caused by: %v", e.cause) 734 } 735 736 key := "" 737 if e.key { 738 key = "key for " 739 } 740 741 return fmt.Sprintf( 742 "invalid %sRuntimeDouble.%s: %s%s", 743 key, 744 e.field, 745 e.reason, 746 cause) 747 } 748 749 var _ error = RuntimeDoubleValidationError{} 750 751 var _ interface { 752 Field() string 753 Reason() string 754 Key() bool 755 Cause() error 756 ErrorName() string 757 } = RuntimeDoubleValidationError{} 758 759 // Validate checks the field values on RuntimeFeatureFlag with the rules 760 // defined in the proto definition for this message. If any rules are 761 // violated, an error is returned. 762 func (m *RuntimeFeatureFlag) Validate() error { 763 if m == nil { 764 return nil 765 } 766 767 if m.GetDefaultValue() == nil { 768 return RuntimeFeatureFlagValidationError{ 769 field: "DefaultValue", 770 reason: "value is required", 771 } 772 } 773 774 if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok { 775 if err := v.Validate(); err != nil { 776 return RuntimeFeatureFlagValidationError{ 777 field: "DefaultValue", 778 reason: "embedded message failed validation", 779 cause: err, 780 } 781 } 782 } 783 784 if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 { 785 return RuntimeFeatureFlagValidationError{ 786 field: "RuntimeKey", 787 reason: "value length must be at least 1 runes", 788 } 789 } 790 791 return nil 792 } 793 794 // RuntimeFeatureFlagValidationError is the validation error returned by 795 // RuntimeFeatureFlag.Validate if the designated constraints aren't met. 796 type RuntimeFeatureFlagValidationError struct { 797 field string 798 reason string 799 cause error 800 key bool 801 } 802 803 // Field function returns field value. 804 func (e RuntimeFeatureFlagValidationError) Field() string { return e.field } 805 806 // Reason function returns reason value. 807 func (e RuntimeFeatureFlagValidationError) Reason() string { return e.reason } 808 809 // Cause function returns cause value. 810 func (e RuntimeFeatureFlagValidationError) Cause() error { return e.cause } 811 812 // Key function returns key value. 813 func (e RuntimeFeatureFlagValidationError) Key() bool { return e.key } 814 815 // ErrorName returns error name. 816 func (e RuntimeFeatureFlagValidationError) ErrorName() string { 817 return "RuntimeFeatureFlagValidationError" 818 } 819 820 // Error satisfies the builtin error interface 821 func (e RuntimeFeatureFlagValidationError) Error() string { 822 cause := "" 823 if e.cause != nil { 824 cause = fmt.Sprintf(" | caused by: %v", e.cause) 825 } 826 827 key := "" 828 if e.key { 829 key = "key for " 830 } 831 832 return fmt.Sprintf( 833 "invalid %sRuntimeFeatureFlag.%s: %s%s", 834 key, 835 e.field, 836 e.reason, 837 cause) 838 } 839 840 var _ error = RuntimeFeatureFlagValidationError{} 841 842 var _ interface { 843 Field() string 844 Reason() string 845 Key() bool 846 Cause() error 847 ErrorName() string 848 } = RuntimeFeatureFlagValidationError{} 849 850 // Validate checks the field values on HeaderValue with the rules defined in 851 // the proto definition for this message. If any rules are violated, an error 852 // is returned. 853 func (m *HeaderValue) Validate() error { 854 if m == nil { 855 return nil 856 } 857 858 if utf8.RuneCountInString(m.GetKey()) < 1 { 859 return HeaderValueValidationError{ 860 field: "Key", 861 reason: "value length must be at least 1 runes", 862 } 863 } 864 865 if len(m.GetKey()) > 16384 { 866 return HeaderValueValidationError{ 867 field: "Key", 868 reason: "value length must be at most 16384 bytes", 869 } 870 } 871 872 if !_HeaderValue_Key_Pattern.MatchString(m.GetKey()) { 873 return HeaderValueValidationError{ 874 field: "Key", 875 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 876 } 877 } 878 879 if len(m.GetValue()) > 16384 { 880 return HeaderValueValidationError{ 881 field: "Value", 882 reason: "value length must be at most 16384 bytes", 883 } 884 } 885 886 if !_HeaderValue_Value_Pattern.MatchString(m.GetValue()) { 887 return HeaderValueValidationError{ 888 field: "Value", 889 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 890 } 891 } 892 893 return nil 894 } 895 896 // HeaderValueValidationError is the validation error returned by 897 // HeaderValue.Validate if the designated constraints aren't met. 898 type HeaderValueValidationError struct { 899 field string 900 reason string 901 cause error 902 key bool 903 } 904 905 // Field function returns field value. 906 func (e HeaderValueValidationError) Field() string { return e.field } 907 908 // Reason function returns reason value. 909 func (e HeaderValueValidationError) Reason() string { return e.reason } 910 911 // Cause function returns cause value. 912 func (e HeaderValueValidationError) Cause() error { return e.cause } 913 914 // Key function returns key value. 915 func (e HeaderValueValidationError) Key() bool { return e.key } 916 917 // ErrorName returns error name. 918 func (e HeaderValueValidationError) ErrorName() string { return "HeaderValueValidationError" } 919 920 // Error satisfies the builtin error interface 921 func (e HeaderValueValidationError) Error() string { 922 cause := "" 923 if e.cause != nil { 924 cause = fmt.Sprintf(" | caused by: %v", e.cause) 925 } 926 927 key := "" 928 if e.key { 929 key = "key for " 930 } 931 932 return fmt.Sprintf( 933 "invalid %sHeaderValue.%s: %s%s", 934 key, 935 e.field, 936 e.reason, 937 cause) 938 } 939 940 var _ error = HeaderValueValidationError{} 941 942 var _ interface { 943 Field() string 944 Reason() string 945 Key() bool 946 Cause() error 947 ErrorName() string 948 } = HeaderValueValidationError{} 949 950 var _HeaderValue_Key_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 951 952 var _HeaderValue_Value_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 953 954 // Validate checks the field values on HeaderValueOption with the rules defined 955 // in the proto definition for this message. If any rules are violated, an 956 // error is returned. 957 func (m *HeaderValueOption) Validate() error { 958 if m == nil { 959 return nil 960 } 961 962 if m.GetHeader() == nil { 963 return HeaderValueOptionValidationError{ 964 field: "Header", 965 reason: "value is required", 966 } 967 } 968 969 if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok { 970 if err := v.Validate(); err != nil { 971 return HeaderValueOptionValidationError{ 972 field: "Header", 973 reason: "embedded message failed validation", 974 cause: err, 975 } 976 } 977 } 978 979 if v, ok := interface{}(m.GetAppend()).(interface{ Validate() error }); ok { 980 if err := v.Validate(); err != nil { 981 return HeaderValueOptionValidationError{ 982 field: "Append", 983 reason: "embedded message failed validation", 984 cause: err, 985 } 986 } 987 } 988 989 return nil 990 } 991 992 // HeaderValueOptionValidationError is the validation error returned by 993 // HeaderValueOption.Validate if the designated constraints aren't met. 994 type HeaderValueOptionValidationError struct { 995 field string 996 reason string 997 cause error 998 key bool 999 } 1000 1001 // Field function returns field value. 1002 func (e HeaderValueOptionValidationError) Field() string { return e.field } 1003 1004 // Reason function returns reason value. 1005 func (e HeaderValueOptionValidationError) Reason() string { return e.reason } 1006 1007 // Cause function returns cause value. 1008 func (e HeaderValueOptionValidationError) Cause() error { return e.cause } 1009 1010 // Key function returns key value. 1011 func (e HeaderValueOptionValidationError) Key() bool { return e.key } 1012 1013 // ErrorName returns error name. 1014 func (e HeaderValueOptionValidationError) ErrorName() string { 1015 return "HeaderValueOptionValidationError" 1016 } 1017 1018 // Error satisfies the builtin error interface 1019 func (e HeaderValueOptionValidationError) Error() string { 1020 cause := "" 1021 if e.cause != nil { 1022 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1023 } 1024 1025 key := "" 1026 if e.key { 1027 key = "key for " 1028 } 1029 1030 return fmt.Sprintf( 1031 "invalid %sHeaderValueOption.%s: %s%s", 1032 key, 1033 e.field, 1034 e.reason, 1035 cause) 1036 } 1037 1038 var _ error = HeaderValueOptionValidationError{} 1039 1040 var _ interface { 1041 Field() string 1042 Reason() string 1043 Key() bool 1044 Cause() error 1045 ErrorName() string 1046 } = HeaderValueOptionValidationError{} 1047 1048 // Validate checks the field values on HeaderMap with the rules defined in the 1049 // proto definition for this message. If any rules are violated, an error is returned. 1050 func (m *HeaderMap) Validate() error { 1051 if m == nil { 1052 return nil 1053 } 1054 1055 for idx, item := range m.GetHeaders() { 1056 _, _ = idx, item 1057 1058 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1059 if err := v.Validate(); err != nil { 1060 return HeaderMapValidationError{ 1061 field: fmt.Sprintf("Headers[%v]", idx), 1062 reason: "embedded message failed validation", 1063 cause: err, 1064 } 1065 } 1066 } 1067 1068 } 1069 1070 return nil 1071 } 1072 1073 // HeaderMapValidationError is the validation error returned by 1074 // HeaderMap.Validate if the designated constraints aren't met. 1075 type HeaderMapValidationError struct { 1076 field string 1077 reason string 1078 cause error 1079 key bool 1080 } 1081 1082 // Field function returns field value. 1083 func (e HeaderMapValidationError) Field() string { return e.field } 1084 1085 // Reason function returns reason value. 1086 func (e HeaderMapValidationError) Reason() string { return e.reason } 1087 1088 // Cause function returns cause value. 1089 func (e HeaderMapValidationError) Cause() error { return e.cause } 1090 1091 // Key function returns key value. 1092 func (e HeaderMapValidationError) Key() bool { return e.key } 1093 1094 // ErrorName returns error name. 1095 func (e HeaderMapValidationError) ErrorName() string { return "HeaderMapValidationError" } 1096 1097 // Error satisfies the builtin error interface 1098 func (e HeaderMapValidationError) Error() string { 1099 cause := "" 1100 if e.cause != nil { 1101 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1102 } 1103 1104 key := "" 1105 if e.key { 1106 key = "key for " 1107 } 1108 1109 return fmt.Sprintf( 1110 "invalid %sHeaderMap.%s: %s%s", 1111 key, 1112 e.field, 1113 e.reason, 1114 cause) 1115 } 1116 1117 var _ error = HeaderMapValidationError{} 1118 1119 var _ interface { 1120 Field() string 1121 Reason() string 1122 Key() bool 1123 Cause() error 1124 ErrorName() string 1125 } = HeaderMapValidationError{} 1126 1127 // Validate checks the field values on WatchedDirectory with the rules defined 1128 // in the proto definition for this message. If any rules are violated, an 1129 // error is returned. 1130 func (m *WatchedDirectory) Validate() error { 1131 if m == nil { 1132 return nil 1133 } 1134 1135 if utf8.RuneCountInString(m.GetPath()) < 1 { 1136 return WatchedDirectoryValidationError{ 1137 field: "Path", 1138 reason: "value length must be at least 1 runes", 1139 } 1140 } 1141 1142 return nil 1143 } 1144 1145 // WatchedDirectoryValidationError is the validation error returned by 1146 // WatchedDirectory.Validate if the designated constraints aren't met. 1147 type WatchedDirectoryValidationError struct { 1148 field string 1149 reason string 1150 cause error 1151 key bool 1152 } 1153 1154 // Field function returns field value. 1155 func (e WatchedDirectoryValidationError) Field() string { return e.field } 1156 1157 // Reason function returns reason value. 1158 func (e WatchedDirectoryValidationError) Reason() string { return e.reason } 1159 1160 // Cause function returns cause value. 1161 func (e WatchedDirectoryValidationError) Cause() error { return e.cause } 1162 1163 // Key function returns key value. 1164 func (e WatchedDirectoryValidationError) Key() bool { return e.key } 1165 1166 // ErrorName returns error name. 1167 func (e WatchedDirectoryValidationError) ErrorName() string { return "WatchedDirectoryValidationError" } 1168 1169 // Error satisfies the builtin error interface 1170 func (e WatchedDirectoryValidationError) Error() string { 1171 cause := "" 1172 if e.cause != nil { 1173 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1174 } 1175 1176 key := "" 1177 if e.key { 1178 key = "key for " 1179 } 1180 1181 return fmt.Sprintf( 1182 "invalid %sWatchedDirectory.%s: %s%s", 1183 key, 1184 e.field, 1185 e.reason, 1186 cause) 1187 } 1188 1189 var _ error = WatchedDirectoryValidationError{} 1190 1191 var _ interface { 1192 Field() string 1193 Reason() string 1194 Key() bool 1195 Cause() error 1196 ErrorName() string 1197 } = WatchedDirectoryValidationError{} 1198 1199 // Validate checks the field values on DataSource with the rules defined in the 1200 // proto definition for this message. If any rules are violated, an error is returned. 1201 func (m *DataSource) Validate() error { 1202 if m == nil { 1203 return nil 1204 } 1205 1206 switch m.Specifier.(type) { 1207 1208 case *DataSource_Filename: 1209 1210 if utf8.RuneCountInString(m.GetFilename()) < 1 { 1211 return DataSourceValidationError{ 1212 field: "Filename", 1213 reason: "value length must be at least 1 runes", 1214 } 1215 } 1216 1217 case *DataSource_InlineBytes: 1218 // no validation rules for InlineBytes 1219 1220 case *DataSource_InlineString: 1221 // no validation rules for InlineString 1222 1223 default: 1224 return DataSourceValidationError{ 1225 field: "Specifier", 1226 reason: "value is required", 1227 } 1228 1229 } 1230 1231 return nil 1232 } 1233 1234 // DataSourceValidationError is the validation error returned by 1235 // DataSource.Validate if the designated constraints aren't met. 1236 type DataSourceValidationError struct { 1237 field string 1238 reason string 1239 cause error 1240 key bool 1241 } 1242 1243 // Field function returns field value. 1244 func (e DataSourceValidationError) Field() string { return e.field } 1245 1246 // Reason function returns reason value. 1247 func (e DataSourceValidationError) Reason() string { return e.reason } 1248 1249 // Cause function returns cause value. 1250 func (e DataSourceValidationError) Cause() error { return e.cause } 1251 1252 // Key function returns key value. 1253 func (e DataSourceValidationError) Key() bool { return e.key } 1254 1255 // ErrorName returns error name. 1256 func (e DataSourceValidationError) ErrorName() string { return "DataSourceValidationError" } 1257 1258 // Error satisfies the builtin error interface 1259 func (e DataSourceValidationError) 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 %sDataSource.%s: %s%s", 1272 key, 1273 e.field, 1274 e.reason, 1275 cause) 1276 } 1277 1278 var _ error = DataSourceValidationError{} 1279 1280 var _ interface { 1281 Field() string 1282 Reason() string 1283 Key() bool 1284 Cause() error 1285 ErrorName() string 1286 } = DataSourceValidationError{} 1287 1288 // Validate checks the field values on RetryPolicy with the rules defined in 1289 // the proto definition for this message. If any rules are violated, an error 1290 // is returned. 1291 func (m *RetryPolicy) Validate() error { 1292 if m == nil { 1293 return nil 1294 } 1295 1296 if v, ok := interface{}(m.GetRetryBackOff()).(interface{ Validate() error }); ok { 1297 if err := v.Validate(); err != nil { 1298 return RetryPolicyValidationError{ 1299 field: "RetryBackOff", 1300 reason: "embedded message failed validation", 1301 cause: err, 1302 } 1303 } 1304 } 1305 1306 if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok { 1307 if err := v.Validate(); err != nil { 1308 return RetryPolicyValidationError{ 1309 field: "NumRetries", 1310 reason: "embedded message failed validation", 1311 cause: err, 1312 } 1313 } 1314 } 1315 1316 return nil 1317 } 1318 1319 // RetryPolicyValidationError is the validation error returned by 1320 // RetryPolicy.Validate if the designated constraints aren't met. 1321 type RetryPolicyValidationError struct { 1322 field string 1323 reason string 1324 cause error 1325 key bool 1326 } 1327 1328 // Field function returns field value. 1329 func (e RetryPolicyValidationError) Field() string { return e.field } 1330 1331 // Reason function returns reason value. 1332 func (e RetryPolicyValidationError) Reason() string { return e.reason } 1333 1334 // Cause function returns cause value. 1335 func (e RetryPolicyValidationError) Cause() error { return e.cause } 1336 1337 // Key function returns key value. 1338 func (e RetryPolicyValidationError) Key() bool { return e.key } 1339 1340 // ErrorName returns error name. 1341 func (e RetryPolicyValidationError) ErrorName() string { return "RetryPolicyValidationError" } 1342 1343 // Error satisfies the builtin error interface 1344 func (e RetryPolicyValidationError) Error() string { 1345 cause := "" 1346 if e.cause != nil { 1347 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1348 } 1349 1350 key := "" 1351 if e.key { 1352 key = "key for " 1353 } 1354 1355 return fmt.Sprintf( 1356 "invalid %sRetryPolicy.%s: %s%s", 1357 key, 1358 e.field, 1359 e.reason, 1360 cause) 1361 } 1362 1363 var _ error = RetryPolicyValidationError{} 1364 1365 var _ interface { 1366 Field() string 1367 Reason() string 1368 Key() bool 1369 Cause() error 1370 ErrorName() string 1371 } = RetryPolicyValidationError{} 1372 1373 // Validate checks the field values on RemoteDataSource with the rules defined 1374 // in the proto definition for this message. If any rules are violated, an 1375 // error is returned. 1376 func (m *RemoteDataSource) Validate() error { 1377 if m == nil { 1378 return nil 1379 } 1380 1381 if m.GetHttpUri() == nil { 1382 return RemoteDataSourceValidationError{ 1383 field: "HttpUri", 1384 reason: "value is required", 1385 } 1386 } 1387 1388 if v, ok := interface{}(m.GetHttpUri()).(interface{ Validate() error }); ok { 1389 if err := v.Validate(); err != nil { 1390 return RemoteDataSourceValidationError{ 1391 field: "HttpUri", 1392 reason: "embedded message failed validation", 1393 cause: err, 1394 } 1395 } 1396 } 1397 1398 if utf8.RuneCountInString(m.GetSha256()) < 1 { 1399 return RemoteDataSourceValidationError{ 1400 field: "Sha256", 1401 reason: "value length must be at least 1 runes", 1402 } 1403 } 1404 1405 if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok { 1406 if err := v.Validate(); err != nil { 1407 return RemoteDataSourceValidationError{ 1408 field: "RetryPolicy", 1409 reason: "embedded message failed validation", 1410 cause: err, 1411 } 1412 } 1413 } 1414 1415 return nil 1416 } 1417 1418 // RemoteDataSourceValidationError is the validation error returned by 1419 // RemoteDataSource.Validate if the designated constraints aren't met. 1420 type RemoteDataSourceValidationError struct { 1421 field string 1422 reason string 1423 cause error 1424 key bool 1425 } 1426 1427 // Field function returns field value. 1428 func (e RemoteDataSourceValidationError) Field() string { return e.field } 1429 1430 // Reason function returns reason value. 1431 func (e RemoteDataSourceValidationError) Reason() string { return e.reason } 1432 1433 // Cause function returns cause value. 1434 func (e RemoteDataSourceValidationError) Cause() error { return e.cause } 1435 1436 // Key function returns key value. 1437 func (e RemoteDataSourceValidationError) Key() bool { return e.key } 1438 1439 // ErrorName returns error name. 1440 func (e RemoteDataSourceValidationError) ErrorName() string { return "RemoteDataSourceValidationError" } 1441 1442 // Error satisfies the builtin error interface 1443 func (e RemoteDataSourceValidationError) Error() string { 1444 cause := "" 1445 if e.cause != nil { 1446 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1447 } 1448 1449 key := "" 1450 if e.key { 1451 key = "key for " 1452 } 1453 1454 return fmt.Sprintf( 1455 "invalid %sRemoteDataSource.%s: %s%s", 1456 key, 1457 e.field, 1458 e.reason, 1459 cause) 1460 } 1461 1462 var _ error = RemoteDataSourceValidationError{} 1463 1464 var _ interface { 1465 Field() string 1466 Reason() string 1467 Key() bool 1468 Cause() error 1469 ErrorName() string 1470 } = RemoteDataSourceValidationError{} 1471 1472 // Validate checks the field values on AsyncDataSource with the rules defined 1473 // in the proto definition for this message. If any rules are violated, an 1474 // error is returned. 1475 func (m *AsyncDataSource) Validate() error { 1476 if m == nil { 1477 return nil 1478 } 1479 1480 switch m.Specifier.(type) { 1481 1482 case *AsyncDataSource_Local: 1483 1484 if v, ok := interface{}(m.GetLocal()).(interface{ Validate() error }); ok { 1485 if err := v.Validate(); err != nil { 1486 return AsyncDataSourceValidationError{ 1487 field: "Local", 1488 reason: "embedded message failed validation", 1489 cause: err, 1490 } 1491 } 1492 } 1493 1494 case *AsyncDataSource_Remote: 1495 1496 if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { 1497 if err := v.Validate(); err != nil { 1498 return AsyncDataSourceValidationError{ 1499 field: "Remote", 1500 reason: "embedded message failed validation", 1501 cause: err, 1502 } 1503 } 1504 } 1505 1506 default: 1507 return AsyncDataSourceValidationError{ 1508 field: "Specifier", 1509 reason: "value is required", 1510 } 1511 1512 } 1513 1514 return nil 1515 } 1516 1517 // AsyncDataSourceValidationError is the validation error returned by 1518 // AsyncDataSource.Validate if the designated constraints aren't met. 1519 type AsyncDataSourceValidationError struct { 1520 field string 1521 reason string 1522 cause error 1523 key bool 1524 } 1525 1526 // Field function returns field value. 1527 func (e AsyncDataSourceValidationError) Field() string { return e.field } 1528 1529 // Reason function returns reason value. 1530 func (e AsyncDataSourceValidationError) Reason() string { return e.reason } 1531 1532 // Cause function returns cause value. 1533 func (e AsyncDataSourceValidationError) Cause() error { return e.cause } 1534 1535 // Key function returns key value. 1536 func (e AsyncDataSourceValidationError) Key() bool { return e.key } 1537 1538 // ErrorName returns error name. 1539 func (e AsyncDataSourceValidationError) ErrorName() string { return "AsyncDataSourceValidationError" } 1540 1541 // Error satisfies the builtin error interface 1542 func (e AsyncDataSourceValidationError) Error() string { 1543 cause := "" 1544 if e.cause != nil { 1545 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1546 } 1547 1548 key := "" 1549 if e.key { 1550 key = "key for " 1551 } 1552 1553 return fmt.Sprintf( 1554 "invalid %sAsyncDataSource.%s: %s%s", 1555 key, 1556 e.field, 1557 e.reason, 1558 cause) 1559 } 1560 1561 var _ error = AsyncDataSourceValidationError{} 1562 1563 var _ interface { 1564 Field() string 1565 Reason() string 1566 Key() bool 1567 Cause() error 1568 ErrorName() string 1569 } = AsyncDataSourceValidationError{} 1570 1571 // Validate checks the field values on TransportSocket with the rules defined 1572 // in the proto definition for this message. If any rules are violated, an 1573 // error is returned. 1574 func (m *TransportSocket) Validate() error { 1575 if m == nil { 1576 return nil 1577 } 1578 1579 if utf8.RuneCountInString(m.GetName()) < 1 { 1580 return TransportSocketValidationError{ 1581 field: "Name", 1582 reason: "value length must be at least 1 runes", 1583 } 1584 } 1585 1586 switch m.ConfigType.(type) { 1587 1588 case *TransportSocket_TypedConfig: 1589 1590 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 1591 if err := v.Validate(); err != nil { 1592 return TransportSocketValidationError{ 1593 field: "TypedConfig", 1594 reason: "embedded message failed validation", 1595 cause: err, 1596 } 1597 } 1598 } 1599 1600 case *TransportSocket_HiddenEnvoyDeprecatedConfig: 1601 1602 if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedConfig()).(interface{ Validate() error }); ok { 1603 if err := v.Validate(); err != nil { 1604 return TransportSocketValidationError{ 1605 field: "HiddenEnvoyDeprecatedConfig", 1606 reason: "embedded message failed validation", 1607 cause: err, 1608 } 1609 } 1610 } 1611 1612 } 1613 1614 return nil 1615 } 1616 1617 // TransportSocketValidationError is the validation error returned by 1618 // TransportSocket.Validate if the designated constraints aren't met. 1619 type TransportSocketValidationError struct { 1620 field string 1621 reason string 1622 cause error 1623 key bool 1624 } 1625 1626 // Field function returns field value. 1627 func (e TransportSocketValidationError) Field() string { return e.field } 1628 1629 // Reason function returns reason value. 1630 func (e TransportSocketValidationError) Reason() string { return e.reason } 1631 1632 // Cause function returns cause value. 1633 func (e TransportSocketValidationError) Cause() error { return e.cause } 1634 1635 // Key function returns key value. 1636 func (e TransportSocketValidationError) Key() bool { return e.key } 1637 1638 // ErrorName returns error name. 1639 func (e TransportSocketValidationError) ErrorName() string { return "TransportSocketValidationError" } 1640 1641 // Error satisfies the builtin error interface 1642 func (e TransportSocketValidationError) Error() string { 1643 cause := "" 1644 if e.cause != nil { 1645 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1646 } 1647 1648 key := "" 1649 if e.key { 1650 key = "key for " 1651 } 1652 1653 return fmt.Sprintf( 1654 "invalid %sTransportSocket.%s: %s%s", 1655 key, 1656 e.field, 1657 e.reason, 1658 cause) 1659 } 1660 1661 var _ error = TransportSocketValidationError{} 1662 1663 var _ interface { 1664 Field() string 1665 Reason() string 1666 Key() bool 1667 Cause() error 1668 ErrorName() string 1669 } = TransportSocketValidationError{} 1670 1671 // Validate checks the field values on RuntimeFractionalPercent with the rules 1672 // defined in the proto definition for this message. If any rules are 1673 // violated, an error is returned. 1674 func (m *RuntimeFractionalPercent) Validate() error { 1675 if m == nil { 1676 return nil 1677 } 1678 1679 if m.GetDefaultValue() == nil { 1680 return RuntimeFractionalPercentValidationError{ 1681 field: "DefaultValue", 1682 reason: "value is required", 1683 } 1684 } 1685 1686 if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok { 1687 if err := v.Validate(); err != nil { 1688 return RuntimeFractionalPercentValidationError{ 1689 field: "DefaultValue", 1690 reason: "embedded message failed validation", 1691 cause: err, 1692 } 1693 } 1694 } 1695 1696 // no validation rules for RuntimeKey 1697 1698 return nil 1699 } 1700 1701 // RuntimeFractionalPercentValidationError is the validation error returned by 1702 // RuntimeFractionalPercent.Validate if the designated constraints aren't met. 1703 type RuntimeFractionalPercentValidationError struct { 1704 field string 1705 reason string 1706 cause error 1707 key bool 1708 } 1709 1710 // Field function returns field value. 1711 func (e RuntimeFractionalPercentValidationError) Field() string { return e.field } 1712 1713 // Reason function returns reason value. 1714 func (e RuntimeFractionalPercentValidationError) Reason() string { return e.reason } 1715 1716 // Cause function returns cause value. 1717 func (e RuntimeFractionalPercentValidationError) Cause() error { return e.cause } 1718 1719 // Key function returns key value. 1720 func (e RuntimeFractionalPercentValidationError) Key() bool { return e.key } 1721 1722 // ErrorName returns error name. 1723 func (e RuntimeFractionalPercentValidationError) ErrorName() string { 1724 return "RuntimeFractionalPercentValidationError" 1725 } 1726 1727 // Error satisfies the builtin error interface 1728 func (e RuntimeFractionalPercentValidationError) Error() string { 1729 cause := "" 1730 if e.cause != nil { 1731 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1732 } 1733 1734 key := "" 1735 if e.key { 1736 key = "key for " 1737 } 1738 1739 return fmt.Sprintf( 1740 "invalid %sRuntimeFractionalPercent.%s: %s%s", 1741 key, 1742 e.field, 1743 e.reason, 1744 cause) 1745 } 1746 1747 var _ error = RuntimeFractionalPercentValidationError{} 1748 1749 var _ interface { 1750 Field() string 1751 Reason() string 1752 Key() bool 1753 Cause() error 1754 ErrorName() string 1755 } = RuntimeFractionalPercentValidationError{} 1756 1757 // Validate checks the field values on ControlPlane with the rules defined in 1758 // the proto definition for this message. If any rules are violated, an error 1759 // is returned. 1760 func (m *ControlPlane) Validate() error { 1761 if m == nil { 1762 return nil 1763 } 1764 1765 // no validation rules for Identifier 1766 1767 return nil 1768 } 1769 1770 // ControlPlaneValidationError is the validation error returned by 1771 // ControlPlane.Validate if the designated constraints aren't met. 1772 type ControlPlaneValidationError struct { 1773 field string 1774 reason string 1775 cause error 1776 key bool 1777 } 1778 1779 // Field function returns field value. 1780 func (e ControlPlaneValidationError) Field() string { return e.field } 1781 1782 // Reason function returns reason value. 1783 func (e ControlPlaneValidationError) Reason() string { return e.reason } 1784 1785 // Cause function returns cause value. 1786 func (e ControlPlaneValidationError) Cause() error { return e.cause } 1787 1788 // Key function returns key value. 1789 func (e ControlPlaneValidationError) Key() bool { return e.key } 1790 1791 // ErrorName returns error name. 1792 func (e ControlPlaneValidationError) ErrorName() string { return "ControlPlaneValidationError" } 1793 1794 // Error satisfies the builtin error interface 1795 func (e ControlPlaneValidationError) Error() string { 1796 cause := "" 1797 if e.cause != nil { 1798 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1799 } 1800 1801 key := "" 1802 if e.key { 1803 key = "key for " 1804 } 1805 1806 return fmt.Sprintf( 1807 "invalid %sControlPlane.%s: %s%s", 1808 key, 1809 e.field, 1810 e.reason, 1811 cause) 1812 } 1813 1814 var _ error = ControlPlaneValidationError{} 1815 1816 var _ interface { 1817 Field() string 1818 Reason() string 1819 Key() bool 1820 Cause() error 1821 ErrorName() string 1822 } = ControlPlaneValidationError{}