gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/config/route/v3/route_components.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/config/route/v3/route_components.proto 3 4 package envoy_config_route_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 v3 "gitee.com/ks-custle/core-gm/go-control-plane/envoy/config/core/v3" 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 37 _ = v3.RoutingPriority(0) 38 39 _ = v3.RequestMethod(0) 40 ) 41 42 // Validate checks the field values on VirtualHost with the rules defined in 43 // the proto definition for this message. If any rules are violated, an error 44 // is returned. 45 func (m *VirtualHost) Validate() error { 46 if m == nil { 47 return nil 48 } 49 50 if utf8.RuneCountInString(m.GetName()) < 1 { 51 return VirtualHostValidationError{ 52 field: "Name", 53 reason: "value length must be at least 1 runes", 54 } 55 } 56 57 if len(m.GetDomains()) < 1 { 58 return VirtualHostValidationError{ 59 field: "Domains", 60 reason: "value must contain at least 1 item(s)", 61 } 62 } 63 64 for idx, item := range m.GetDomains() { 65 _, _ = idx, item 66 67 if !_VirtualHost_Domains_Pattern.MatchString(item) { 68 return VirtualHostValidationError{ 69 field: fmt.Sprintf("Domains[%v]", idx), 70 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 71 } 72 } 73 74 } 75 76 for idx, item := range m.GetRoutes() { 77 _, _ = idx, item 78 79 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 80 if err := v.Validate(); err != nil { 81 return VirtualHostValidationError{ 82 field: fmt.Sprintf("Routes[%v]", idx), 83 reason: "embedded message failed validation", 84 cause: err, 85 } 86 } 87 } 88 89 } 90 91 if _, ok := VirtualHost_TlsRequirementType_name[int32(m.GetRequireTls())]; !ok { 92 return VirtualHostValidationError{ 93 field: "RequireTls", 94 reason: "value must be one of the defined enum values", 95 } 96 } 97 98 for idx, item := range m.GetVirtualClusters() { 99 _, _ = idx, item 100 101 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 102 if err := v.Validate(); err != nil { 103 return VirtualHostValidationError{ 104 field: fmt.Sprintf("VirtualClusters[%v]", idx), 105 reason: "embedded message failed validation", 106 cause: err, 107 } 108 } 109 } 110 111 } 112 113 for idx, item := range m.GetRateLimits() { 114 _, _ = idx, item 115 116 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 117 if err := v.Validate(); err != nil { 118 return VirtualHostValidationError{ 119 field: fmt.Sprintf("RateLimits[%v]", idx), 120 reason: "embedded message failed validation", 121 cause: err, 122 } 123 } 124 } 125 126 } 127 128 if len(m.GetRequestHeadersToAdd()) > 1000 { 129 return VirtualHostValidationError{ 130 field: "RequestHeadersToAdd", 131 reason: "value must contain no more than 1000 item(s)", 132 } 133 } 134 135 for idx, item := range m.GetRequestHeadersToAdd() { 136 _, _ = idx, item 137 138 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 139 if err := v.Validate(); err != nil { 140 return VirtualHostValidationError{ 141 field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), 142 reason: "embedded message failed validation", 143 cause: err, 144 } 145 } 146 } 147 148 } 149 150 for idx, item := range m.GetRequestHeadersToRemove() { 151 _, _ = idx, item 152 153 if utf8.RuneCountInString(item) < 1 { 154 return VirtualHostValidationError{ 155 field: fmt.Sprintf("RequestHeadersToRemove[%v]", idx), 156 reason: "value length must be at least 1 runes", 157 } 158 } 159 160 if !_VirtualHost_RequestHeadersToRemove_Pattern.MatchString(item) { 161 return VirtualHostValidationError{ 162 field: fmt.Sprintf("RequestHeadersToRemove[%v]", idx), 163 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 164 } 165 } 166 167 } 168 169 if len(m.GetResponseHeadersToAdd()) > 1000 { 170 return VirtualHostValidationError{ 171 field: "ResponseHeadersToAdd", 172 reason: "value must contain no more than 1000 item(s)", 173 } 174 } 175 176 for idx, item := range m.GetResponseHeadersToAdd() { 177 _, _ = idx, item 178 179 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 180 if err := v.Validate(); err != nil { 181 return VirtualHostValidationError{ 182 field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), 183 reason: "embedded message failed validation", 184 cause: err, 185 } 186 } 187 } 188 189 } 190 191 for idx, item := range m.GetResponseHeadersToRemove() { 192 _, _ = idx, item 193 194 if utf8.RuneCountInString(item) < 1 { 195 return VirtualHostValidationError{ 196 field: fmt.Sprintf("ResponseHeadersToRemove[%v]", idx), 197 reason: "value length must be at least 1 runes", 198 } 199 } 200 201 if !_VirtualHost_ResponseHeadersToRemove_Pattern.MatchString(item) { 202 return VirtualHostValidationError{ 203 field: fmt.Sprintf("ResponseHeadersToRemove[%v]", idx), 204 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 205 } 206 } 207 208 } 209 210 if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { 211 if err := v.Validate(); err != nil { 212 return VirtualHostValidationError{ 213 field: "Cors", 214 reason: "embedded message failed validation", 215 cause: err, 216 } 217 } 218 } 219 220 for key, val := range m.GetTypedPerFilterConfig() { 221 _ = val 222 223 // no validation rules for TypedPerFilterConfig[key] 224 225 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 226 if err := v.Validate(); err != nil { 227 return VirtualHostValidationError{ 228 field: fmt.Sprintf("TypedPerFilterConfig[%v]", key), 229 reason: "embedded message failed validation", 230 cause: err, 231 } 232 } 233 } 234 235 } 236 237 // no validation rules for IncludeRequestAttemptCount 238 239 // no validation rules for IncludeAttemptCountInResponse 240 241 if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok { 242 if err := v.Validate(); err != nil { 243 return VirtualHostValidationError{ 244 field: "RetryPolicy", 245 reason: "embedded message failed validation", 246 cause: err, 247 } 248 } 249 } 250 251 if v, ok := interface{}(m.GetRetryPolicyTypedConfig()).(interface{ Validate() error }); ok { 252 if err := v.Validate(); err != nil { 253 return VirtualHostValidationError{ 254 field: "RetryPolicyTypedConfig", 255 reason: "embedded message failed validation", 256 cause: err, 257 } 258 } 259 } 260 261 if v, ok := interface{}(m.GetHedgePolicy()).(interface{ Validate() error }); ok { 262 if err := v.Validate(); err != nil { 263 return VirtualHostValidationError{ 264 field: "HedgePolicy", 265 reason: "embedded message failed validation", 266 cause: err, 267 } 268 } 269 } 270 271 if v, ok := interface{}(m.GetPerRequestBufferLimitBytes()).(interface{ Validate() error }); ok { 272 if err := v.Validate(); err != nil { 273 return VirtualHostValidationError{ 274 field: "PerRequestBufferLimitBytes", 275 reason: "embedded message failed validation", 276 cause: err, 277 } 278 } 279 } 280 281 for key, val := range m.GetHiddenEnvoyDeprecatedPerFilterConfig() { 282 _ = val 283 284 // no validation rules for HiddenEnvoyDeprecatedPerFilterConfig[key] 285 286 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 287 if err := v.Validate(); err != nil { 288 return VirtualHostValidationError{ 289 field: fmt.Sprintf("HiddenEnvoyDeprecatedPerFilterConfig[%v]", key), 290 reason: "embedded message failed validation", 291 cause: err, 292 } 293 } 294 } 295 296 } 297 298 return nil 299 } 300 301 // VirtualHostValidationError is the validation error returned by 302 // VirtualHost.Validate if the designated constraints aren't met. 303 type VirtualHostValidationError struct { 304 field string 305 reason string 306 cause error 307 key bool 308 } 309 310 // Field function returns field value. 311 func (e VirtualHostValidationError) Field() string { return e.field } 312 313 // Reason function returns reason value. 314 func (e VirtualHostValidationError) Reason() string { return e.reason } 315 316 // Cause function returns cause value. 317 func (e VirtualHostValidationError) Cause() error { return e.cause } 318 319 // Key function returns key value. 320 func (e VirtualHostValidationError) Key() bool { return e.key } 321 322 // ErrorName returns error name. 323 func (e VirtualHostValidationError) ErrorName() string { return "VirtualHostValidationError" } 324 325 // Error satisfies the builtin error interface 326 func (e VirtualHostValidationError) Error() string { 327 cause := "" 328 if e.cause != nil { 329 cause = fmt.Sprintf(" | caused by: %v", e.cause) 330 } 331 332 key := "" 333 if e.key { 334 key = "key for " 335 } 336 337 return fmt.Sprintf( 338 "invalid %sVirtualHost.%s: %s%s", 339 key, 340 e.field, 341 e.reason, 342 cause) 343 } 344 345 var _ error = VirtualHostValidationError{} 346 347 var _ interface { 348 Field() string 349 Reason() string 350 Key() bool 351 Cause() error 352 ErrorName() string 353 } = VirtualHostValidationError{} 354 355 var _VirtualHost_Domains_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 356 357 var _VirtualHost_RequestHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 358 359 var _VirtualHost_ResponseHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 360 361 // Validate checks the field values on FilterAction with the rules defined in 362 // the proto definition for this message. If any rules are violated, an error 363 // is returned. 364 func (m *FilterAction) Validate() error { 365 if m == nil { 366 return nil 367 } 368 369 if v, ok := interface{}(m.GetAction()).(interface{ Validate() error }); ok { 370 if err := v.Validate(); err != nil { 371 return FilterActionValidationError{ 372 field: "Action", 373 reason: "embedded message failed validation", 374 cause: err, 375 } 376 } 377 } 378 379 return nil 380 } 381 382 // FilterActionValidationError is the validation error returned by 383 // FilterAction.Validate if the designated constraints aren't met. 384 type FilterActionValidationError struct { 385 field string 386 reason string 387 cause error 388 key bool 389 } 390 391 // Field function returns field value. 392 func (e FilterActionValidationError) Field() string { return e.field } 393 394 // Reason function returns reason value. 395 func (e FilterActionValidationError) Reason() string { return e.reason } 396 397 // Cause function returns cause value. 398 func (e FilterActionValidationError) Cause() error { return e.cause } 399 400 // Key function returns key value. 401 func (e FilterActionValidationError) Key() bool { return e.key } 402 403 // ErrorName returns error name. 404 func (e FilterActionValidationError) ErrorName() string { return "FilterActionValidationError" } 405 406 // Error satisfies the builtin error interface 407 func (e FilterActionValidationError) Error() string { 408 cause := "" 409 if e.cause != nil { 410 cause = fmt.Sprintf(" | caused by: %v", e.cause) 411 } 412 413 key := "" 414 if e.key { 415 key = "key for " 416 } 417 418 return fmt.Sprintf( 419 "invalid %sFilterAction.%s: %s%s", 420 key, 421 e.field, 422 e.reason, 423 cause) 424 } 425 426 var _ error = FilterActionValidationError{} 427 428 var _ interface { 429 Field() string 430 Reason() string 431 Key() bool 432 Cause() error 433 ErrorName() string 434 } = FilterActionValidationError{} 435 436 // Validate checks the field values on Route with the rules defined in the 437 // proto definition for this message. If any rules are violated, an error is returned. 438 func (m *Route) Validate() error { 439 if m == nil { 440 return nil 441 } 442 443 // no validation rules for Name 444 445 if m.GetMatch() == nil { 446 return RouteValidationError{ 447 field: "Match", 448 reason: "value is required", 449 } 450 } 451 452 if v, ok := interface{}(m.GetMatch()).(interface{ Validate() error }); ok { 453 if err := v.Validate(); err != nil { 454 return RouteValidationError{ 455 field: "Match", 456 reason: "embedded message failed validation", 457 cause: err, 458 } 459 } 460 } 461 462 if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { 463 if err := v.Validate(); err != nil { 464 return RouteValidationError{ 465 field: "Metadata", 466 reason: "embedded message failed validation", 467 cause: err, 468 } 469 } 470 } 471 472 if v, ok := interface{}(m.GetDecorator()).(interface{ Validate() error }); ok { 473 if err := v.Validate(); err != nil { 474 return RouteValidationError{ 475 field: "Decorator", 476 reason: "embedded message failed validation", 477 cause: err, 478 } 479 } 480 } 481 482 for key, val := range m.GetTypedPerFilterConfig() { 483 _ = val 484 485 // no validation rules for TypedPerFilterConfig[key] 486 487 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 488 if err := v.Validate(); err != nil { 489 return RouteValidationError{ 490 field: fmt.Sprintf("TypedPerFilterConfig[%v]", key), 491 reason: "embedded message failed validation", 492 cause: err, 493 } 494 } 495 } 496 497 } 498 499 if len(m.GetRequestHeadersToAdd()) > 1000 { 500 return RouteValidationError{ 501 field: "RequestHeadersToAdd", 502 reason: "value must contain no more than 1000 item(s)", 503 } 504 } 505 506 for idx, item := range m.GetRequestHeadersToAdd() { 507 _, _ = idx, item 508 509 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 510 if err := v.Validate(); err != nil { 511 return RouteValidationError{ 512 field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), 513 reason: "embedded message failed validation", 514 cause: err, 515 } 516 } 517 } 518 519 } 520 521 for idx, item := range m.GetRequestHeadersToRemove() { 522 _, _ = idx, item 523 524 if utf8.RuneCountInString(item) < 1 { 525 return RouteValidationError{ 526 field: fmt.Sprintf("RequestHeadersToRemove[%v]", idx), 527 reason: "value length must be at least 1 runes", 528 } 529 } 530 531 if !_Route_RequestHeadersToRemove_Pattern.MatchString(item) { 532 return RouteValidationError{ 533 field: fmt.Sprintf("RequestHeadersToRemove[%v]", idx), 534 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 535 } 536 } 537 538 } 539 540 if len(m.GetResponseHeadersToAdd()) > 1000 { 541 return RouteValidationError{ 542 field: "ResponseHeadersToAdd", 543 reason: "value must contain no more than 1000 item(s)", 544 } 545 } 546 547 for idx, item := range m.GetResponseHeadersToAdd() { 548 _, _ = idx, item 549 550 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 551 if err := v.Validate(); err != nil { 552 return RouteValidationError{ 553 field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), 554 reason: "embedded message failed validation", 555 cause: err, 556 } 557 } 558 } 559 560 } 561 562 for idx, item := range m.GetResponseHeadersToRemove() { 563 _, _ = idx, item 564 565 if utf8.RuneCountInString(item) < 1 { 566 return RouteValidationError{ 567 field: fmt.Sprintf("ResponseHeadersToRemove[%v]", idx), 568 reason: "value length must be at least 1 runes", 569 } 570 } 571 572 if !_Route_ResponseHeadersToRemove_Pattern.MatchString(item) { 573 return RouteValidationError{ 574 field: fmt.Sprintf("ResponseHeadersToRemove[%v]", idx), 575 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 576 } 577 } 578 579 } 580 581 if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok { 582 if err := v.Validate(); err != nil { 583 return RouteValidationError{ 584 field: "Tracing", 585 reason: "embedded message failed validation", 586 cause: err, 587 } 588 } 589 } 590 591 if v, ok := interface{}(m.GetPerRequestBufferLimitBytes()).(interface{ Validate() error }); ok { 592 if err := v.Validate(); err != nil { 593 return RouteValidationError{ 594 field: "PerRequestBufferLimitBytes", 595 reason: "embedded message failed validation", 596 cause: err, 597 } 598 } 599 } 600 601 for key, val := range m.GetHiddenEnvoyDeprecatedPerFilterConfig() { 602 _ = val 603 604 // no validation rules for HiddenEnvoyDeprecatedPerFilterConfig[key] 605 606 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 607 if err := v.Validate(); err != nil { 608 return RouteValidationError{ 609 field: fmt.Sprintf("HiddenEnvoyDeprecatedPerFilterConfig[%v]", key), 610 reason: "embedded message failed validation", 611 cause: err, 612 } 613 } 614 } 615 616 } 617 618 switch m.Action.(type) { 619 620 case *Route_Route: 621 622 if v, ok := interface{}(m.GetRoute()).(interface{ Validate() error }); ok { 623 if err := v.Validate(); err != nil { 624 return RouteValidationError{ 625 field: "Route", 626 reason: "embedded message failed validation", 627 cause: err, 628 } 629 } 630 } 631 632 case *Route_Redirect: 633 634 if v, ok := interface{}(m.GetRedirect()).(interface{ Validate() error }); ok { 635 if err := v.Validate(); err != nil { 636 return RouteValidationError{ 637 field: "Redirect", 638 reason: "embedded message failed validation", 639 cause: err, 640 } 641 } 642 } 643 644 case *Route_DirectResponse: 645 646 if v, ok := interface{}(m.GetDirectResponse()).(interface{ Validate() error }); ok { 647 if err := v.Validate(); err != nil { 648 return RouteValidationError{ 649 field: "DirectResponse", 650 reason: "embedded message failed validation", 651 cause: err, 652 } 653 } 654 } 655 656 case *Route_FilterAction: 657 658 if v, ok := interface{}(m.GetFilterAction()).(interface{ Validate() error }); ok { 659 if err := v.Validate(); err != nil { 660 return RouteValidationError{ 661 field: "FilterAction", 662 reason: "embedded message failed validation", 663 cause: err, 664 } 665 } 666 } 667 668 case *Route_NonForwardingAction: 669 670 if v, ok := interface{}(m.GetNonForwardingAction()).(interface{ Validate() error }); ok { 671 if err := v.Validate(); err != nil { 672 return RouteValidationError{ 673 field: "NonForwardingAction", 674 reason: "embedded message failed validation", 675 cause: err, 676 } 677 } 678 } 679 680 default: 681 return RouteValidationError{ 682 field: "Action", 683 reason: "value is required", 684 } 685 686 } 687 688 return nil 689 } 690 691 // RouteValidationError is the validation error returned by Route.Validate if 692 // the designated constraints aren't met. 693 type RouteValidationError struct { 694 field string 695 reason string 696 cause error 697 key bool 698 } 699 700 // Field function returns field value. 701 func (e RouteValidationError) Field() string { return e.field } 702 703 // Reason function returns reason value. 704 func (e RouteValidationError) Reason() string { return e.reason } 705 706 // Cause function returns cause value. 707 func (e RouteValidationError) Cause() error { return e.cause } 708 709 // Key function returns key value. 710 func (e RouteValidationError) Key() bool { return e.key } 711 712 // ErrorName returns error name. 713 func (e RouteValidationError) ErrorName() string { return "RouteValidationError" } 714 715 // Error satisfies the builtin error interface 716 func (e RouteValidationError) Error() string { 717 cause := "" 718 if e.cause != nil { 719 cause = fmt.Sprintf(" | caused by: %v", e.cause) 720 } 721 722 key := "" 723 if e.key { 724 key = "key for " 725 } 726 727 return fmt.Sprintf( 728 "invalid %sRoute.%s: %s%s", 729 key, 730 e.field, 731 e.reason, 732 cause) 733 } 734 735 var _ error = RouteValidationError{} 736 737 var _ interface { 738 Field() string 739 Reason() string 740 Key() bool 741 Cause() error 742 ErrorName() string 743 } = RouteValidationError{} 744 745 var _Route_RequestHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 746 747 var _Route_ResponseHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 748 749 // Validate checks the field values on WeightedCluster with the rules defined 750 // in the proto definition for this message. If any rules are violated, an 751 // error is returned. 752 func (m *WeightedCluster) Validate() error { 753 if m == nil { 754 return nil 755 } 756 757 if len(m.GetClusters()) < 1 { 758 return WeightedClusterValidationError{ 759 field: "Clusters", 760 reason: "value must contain at least 1 item(s)", 761 } 762 } 763 764 for idx, item := range m.GetClusters() { 765 _, _ = idx, item 766 767 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 768 if err := v.Validate(); err != nil { 769 return WeightedClusterValidationError{ 770 field: fmt.Sprintf("Clusters[%v]", idx), 771 reason: "embedded message failed validation", 772 cause: err, 773 } 774 } 775 } 776 777 } 778 779 if wrapper := m.GetTotalWeight(); wrapper != nil { 780 781 if wrapper.GetValue() < 1 { 782 return WeightedClusterValidationError{ 783 field: "TotalWeight", 784 reason: "value must be greater than or equal to 1", 785 } 786 } 787 788 } 789 790 // no validation rules for RuntimeKeyPrefix 791 792 return nil 793 } 794 795 // WeightedClusterValidationError is the validation error returned by 796 // WeightedCluster.Validate if the designated constraints aren't met. 797 type WeightedClusterValidationError struct { 798 field string 799 reason string 800 cause error 801 key bool 802 } 803 804 // Field function returns field value. 805 func (e WeightedClusterValidationError) Field() string { return e.field } 806 807 // Reason function returns reason value. 808 func (e WeightedClusterValidationError) Reason() string { return e.reason } 809 810 // Cause function returns cause value. 811 func (e WeightedClusterValidationError) Cause() error { return e.cause } 812 813 // Key function returns key value. 814 func (e WeightedClusterValidationError) Key() bool { return e.key } 815 816 // ErrorName returns error name. 817 func (e WeightedClusterValidationError) ErrorName() string { return "WeightedClusterValidationError" } 818 819 // Error satisfies the builtin error interface 820 func (e WeightedClusterValidationError) Error() string { 821 cause := "" 822 if e.cause != nil { 823 cause = fmt.Sprintf(" | caused by: %v", e.cause) 824 } 825 826 key := "" 827 if e.key { 828 key = "key for " 829 } 830 831 return fmt.Sprintf( 832 "invalid %sWeightedCluster.%s: %s%s", 833 key, 834 e.field, 835 e.reason, 836 cause) 837 } 838 839 var _ error = WeightedClusterValidationError{} 840 841 var _ interface { 842 Field() string 843 Reason() string 844 Key() bool 845 Cause() error 846 ErrorName() string 847 } = WeightedClusterValidationError{} 848 849 // Validate checks the field values on RouteMatch with the rules defined in the 850 // proto definition for this message. If any rules are violated, an error is returned. 851 func (m *RouteMatch) Validate() error { 852 if m == nil { 853 return nil 854 } 855 856 if v, ok := interface{}(m.GetCaseSensitive()).(interface{ Validate() error }); ok { 857 if err := v.Validate(); err != nil { 858 return RouteMatchValidationError{ 859 field: "CaseSensitive", 860 reason: "embedded message failed validation", 861 cause: err, 862 } 863 } 864 } 865 866 if v, ok := interface{}(m.GetRuntimeFraction()).(interface{ Validate() error }); ok { 867 if err := v.Validate(); err != nil { 868 return RouteMatchValidationError{ 869 field: "RuntimeFraction", 870 reason: "embedded message failed validation", 871 cause: err, 872 } 873 } 874 } 875 876 for idx, item := range m.GetHeaders() { 877 _, _ = idx, item 878 879 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 880 if err := v.Validate(); err != nil { 881 return RouteMatchValidationError{ 882 field: fmt.Sprintf("Headers[%v]", idx), 883 reason: "embedded message failed validation", 884 cause: err, 885 } 886 } 887 } 888 889 } 890 891 for idx, item := range m.GetQueryParameters() { 892 _, _ = idx, item 893 894 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 895 if err := v.Validate(); err != nil { 896 return RouteMatchValidationError{ 897 field: fmt.Sprintf("QueryParameters[%v]", idx), 898 reason: "embedded message failed validation", 899 cause: err, 900 } 901 } 902 } 903 904 } 905 906 if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok { 907 if err := v.Validate(); err != nil { 908 return RouteMatchValidationError{ 909 field: "Grpc", 910 reason: "embedded message failed validation", 911 cause: err, 912 } 913 } 914 } 915 916 if v, ok := interface{}(m.GetTlsContext()).(interface{ Validate() error }); ok { 917 if err := v.Validate(); err != nil { 918 return RouteMatchValidationError{ 919 field: "TlsContext", 920 reason: "embedded message failed validation", 921 cause: err, 922 } 923 } 924 } 925 926 for idx, item := range m.GetDynamicMetadata() { 927 _, _ = idx, item 928 929 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 930 if err := v.Validate(); err != nil { 931 return RouteMatchValidationError{ 932 field: fmt.Sprintf("DynamicMetadata[%v]", idx), 933 reason: "embedded message failed validation", 934 cause: err, 935 } 936 } 937 } 938 939 } 940 941 switch m.PathSpecifier.(type) { 942 943 case *RouteMatch_Prefix: 944 // no validation rules for Prefix 945 946 case *RouteMatch_Path: 947 // no validation rules for Path 948 949 case *RouteMatch_SafeRegex: 950 951 if m.GetSafeRegex() == nil { 952 return RouteMatchValidationError{ 953 field: "SafeRegex", 954 reason: "value is required", 955 } 956 } 957 958 if v, ok := interface{}(m.GetSafeRegex()).(interface{ Validate() error }); ok { 959 if err := v.Validate(); err != nil { 960 return RouteMatchValidationError{ 961 field: "SafeRegex", 962 reason: "embedded message failed validation", 963 cause: err, 964 } 965 } 966 } 967 968 case *RouteMatch_ConnectMatcher_: 969 970 if v, ok := interface{}(m.GetConnectMatcher()).(interface{ Validate() error }); ok { 971 if err := v.Validate(); err != nil { 972 return RouteMatchValidationError{ 973 field: "ConnectMatcher", 974 reason: "embedded message failed validation", 975 cause: err, 976 } 977 } 978 } 979 980 case *RouteMatch_HiddenEnvoyDeprecatedRegex: 981 982 if len(m.GetHiddenEnvoyDeprecatedRegex()) > 1024 { 983 return RouteMatchValidationError{ 984 field: "HiddenEnvoyDeprecatedRegex", 985 reason: "value length must be at most 1024 bytes", 986 } 987 } 988 989 default: 990 return RouteMatchValidationError{ 991 field: "PathSpecifier", 992 reason: "value is required", 993 } 994 995 } 996 997 return nil 998 } 999 1000 // RouteMatchValidationError is the validation error returned by 1001 // RouteMatch.Validate if the designated constraints aren't met. 1002 type RouteMatchValidationError struct { 1003 field string 1004 reason string 1005 cause error 1006 key bool 1007 } 1008 1009 // Field function returns field value. 1010 func (e RouteMatchValidationError) Field() string { return e.field } 1011 1012 // Reason function returns reason value. 1013 func (e RouteMatchValidationError) Reason() string { return e.reason } 1014 1015 // Cause function returns cause value. 1016 func (e RouteMatchValidationError) Cause() error { return e.cause } 1017 1018 // Key function returns key value. 1019 func (e RouteMatchValidationError) Key() bool { return e.key } 1020 1021 // ErrorName returns error name. 1022 func (e RouteMatchValidationError) ErrorName() string { return "RouteMatchValidationError" } 1023 1024 // Error satisfies the builtin error interface 1025 func (e RouteMatchValidationError) Error() string { 1026 cause := "" 1027 if e.cause != nil { 1028 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1029 } 1030 1031 key := "" 1032 if e.key { 1033 key = "key for " 1034 } 1035 1036 return fmt.Sprintf( 1037 "invalid %sRouteMatch.%s: %s%s", 1038 key, 1039 e.field, 1040 e.reason, 1041 cause) 1042 } 1043 1044 var _ error = RouteMatchValidationError{} 1045 1046 var _ interface { 1047 Field() string 1048 Reason() string 1049 Key() bool 1050 Cause() error 1051 ErrorName() string 1052 } = RouteMatchValidationError{} 1053 1054 // Validate checks the field values on CorsPolicy with the rules defined in the 1055 // proto definition for this message. If any rules are violated, an error is returned. 1056 func (m *CorsPolicy) Validate() error { 1057 if m == nil { 1058 return nil 1059 } 1060 1061 for idx, item := range m.GetAllowOriginStringMatch() { 1062 _, _ = idx, item 1063 1064 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1065 if err := v.Validate(); err != nil { 1066 return CorsPolicyValidationError{ 1067 field: fmt.Sprintf("AllowOriginStringMatch[%v]", idx), 1068 reason: "embedded message failed validation", 1069 cause: err, 1070 } 1071 } 1072 } 1073 1074 } 1075 1076 // no validation rules for AllowMethods 1077 1078 // no validation rules for AllowHeaders 1079 1080 // no validation rules for ExposeHeaders 1081 1082 // no validation rules for MaxAge 1083 1084 if v, ok := interface{}(m.GetAllowCredentials()).(interface{ Validate() error }); ok { 1085 if err := v.Validate(); err != nil { 1086 return CorsPolicyValidationError{ 1087 field: "AllowCredentials", 1088 reason: "embedded message failed validation", 1089 cause: err, 1090 } 1091 } 1092 } 1093 1094 if v, ok := interface{}(m.GetShadowEnabled()).(interface{ Validate() error }); ok { 1095 if err := v.Validate(); err != nil { 1096 return CorsPolicyValidationError{ 1097 field: "ShadowEnabled", 1098 reason: "embedded message failed validation", 1099 cause: err, 1100 } 1101 } 1102 } 1103 1104 for idx, item := range m.GetHiddenEnvoyDeprecatedAllowOriginRegex() { 1105 _, _ = idx, item 1106 1107 if len(item) > 1024 { 1108 return CorsPolicyValidationError{ 1109 field: fmt.Sprintf("HiddenEnvoyDeprecatedAllowOriginRegex[%v]", idx), 1110 reason: "value length must be at most 1024 bytes", 1111 } 1112 } 1113 1114 } 1115 1116 switch m.EnabledSpecifier.(type) { 1117 1118 case *CorsPolicy_FilterEnabled: 1119 1120 if v, ok := interface{}(m.GetFilterEnabled()).(interface{ Validate() error }); ok { 1121 if err := v.Validate(); err != nil { 1122 return CorsPolicyValidationError{ 1123 field: "FilterEnabled", 1124 reason: "embedded message failed validation", 1125 cause: err, 1126 } 1127 } 1128 } 1129 1130 case *CorsPolicy_HiddenEnvoyDeprecatedEnabled: 1131 1132 if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedEnabled()).(interface{ Validate() error }); ok { 1133 if err := v.Validate(); err != nil { 1134 return CorsPolicyValidationError{ 1135 field: "HiddenEnvoyDeprecatedEnabled", 1136 reason: "embedded message failed validation", 1137 cause: err, 1138 } 1139 } 1140 } 1141 1142 } 1143 1144 return nil 1145 } 1146 1147 // CorsPolicyValidationError is the validation error returned by 1148 // CorsPolicy.Validate if the designated constraints aren't met. 1149 type CorsPolicyValidationError struct { 1150 field string 1151 reason string 1152 cause error 1153 key bool 1154 } 1155 1156 // Field function returns field value. 1157 func (e CorsPolicyValidationError) Field() string { return e.field } 1158 1159 // Reason function returns reason value. 1160 func (e CorsPolicyValidationError) Reason() string { return e.reason } 1161 1162 // Cause function returns cause value. 1163 func (e CorsPolicyValidationError) Cause() error { return e.cause } 1164 1165 // Key function returns key value. 1166 func (e CorsPolicyValidationError) Key() bool { return e.key } 1167 1168 // ErrorName returns error name. 1169 func (e CorsPolicyValidationError) ErrorName() string { return "CorsPolicyValidationError" } 1170 1171 // Error satisfies the builtin error interface 1172 func (e CorsPolicyValidationError) Error() string { 1173 cause := "" 1174 if e.cause != nil { 1175 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1176 } 1177 1178 key := "" 1179 if e.key { 1180 key = "key for " 1181 } 1182 1183 return fmt.Sprintf( 1184 "invalid %sCorsPolicy.%s: %s%s", 1185 key, 1186 e.field, 1187 e.reason, 1188 cause) 1189 } 1190 1191 var _ error = CorsPolicyValidationError{} 1192 1193 var _ interface { 1194 Field() string 1195 Reason() string 1196 Key() bool 1197 Cause() error 1198 ErrorName() string 1199 } = CorsPolicyValidationError{} 1200 1201 // Validate checks the field values on RouteAction with the rules defined in 1202 // the proto definition for this message. If any rules are violated, an error 1203 // is returned. 1204 func (m *RouteAction) Validate() error { 1205 if m == nil { 1206 return nil 1207 } 1208 1209 if _, ok := RouteAction_ClusterNotFoundResponseCode_name[int32(m.GetClusterNotFoundResponseCode())]; !ok { 1210 return RouteActionValidationError{ 1211 field: "ClusterNotFoundResponseCode", 1212 reason: "value must be one of the defined enum values", 1213 } 1214 } 1215 1216 if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { 1217 if err := v.Validate(); err != nil { 1218 return RouteActionValidationError{ 1219 field: "MetadataMatch", 1220 reason: "embedded message failed validation", 1221 cause: err, 1222 } 1223 } 1224 } 1225 1226 if !_RouteAction_PrefixRewrite_Pattern.MatchString(m.GetPrefixRewrite()) { 1227 return RouteActionValidationError{ 1228 field: "PrefixRewrite", 1229 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1230 } 1231 } 1232 1233 if v, ok := interface{}(m.GetRegexRewrite()).(interface{ Validate() error }); ok { 1234 if err := v.Validate(); err != nil { 1235 return RouteActionValidationError{ 1236 field: "RegexRewrite", 1237 reason: "embedded message failed validation", 1238 cause: err, 1239 } 1240 } 1241 } 1242 1243 if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { 1244 if err := v.Validate(); err != nil { 1245 return RouteActionValidationError{ 1246 field: "Timeout", 1247 reason: "embedded message failed validation", 1248 cause: err, 1249 } 1250 } 1251 } 1252 1253 if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok { 1254 if err := v.Validate(); err != nil { 1255 return RouteActionValidationError{ 1256 field: "IdleTimeout", 1257 reason: "embedded message failed validation", 1258 cause: err, 1259 } 1260 } 1261 } 1262 1263 if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok { 1264 if err := v.Validate(); err != nil { 1265 return RouteActionValidationError{ 1266 field: "RetryPolicy", 1267 reason: "embedded message failed validation", 1268 cause: err, 1269 } 1270 } 1271 } 1272 1273 if v, ok := interface{}(m.GetRetryPolicyTypedConfig()).(interface{ Validate() error }); ok { 1274 if err := v.Validate(); err != nil { 1275 return RouteActionValidationError{ 1276 field: "RetryPolicyTypedConfig", 1277 reason: "embedded message failed validation", 1278 cause: err, 1279 } 1280 } 1281 } 1282 1283 for idx, item := range m.GetRequestMirrorPolicies() { 1284 _, _ = idx, item 1285 1286 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1287 if err := v.Validate(); err != nil { 1288 return RouteActionValidationError{ 1289 field: fmt.Sprintf("RequestMirrorPolicies[%v]", idx), 1290 reason: "embedded message failed validation", 1291 cause: err, 1292 } 1293 } 1294 } 1295 1296 } 1297 1298 if _, ok := v3.RoutingPriority_name[int32(m.GetPriority())]; !ok { 1299 return RouteActionValidationError{ 1300 field: "Priority", 1301 reason: "value must be one of the defined enum values", 1302 } 1303 } 1304 1305 for idx, item := range m.GetRateLimits() { 1306 _, _ = idx, item 1307 1308 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1309 if err := v.Validate(); err != nil { 1310 return RouteActionValidationError{ 1311 field: fmt.Sprintf("RateLimits[%v]", idx), 1312 reason: "embedded message failed validation", 1313 cause: err, 1314 } 1315 } 1316 } 1317 1318 } 1319 1320 if v, ok := interface{}(m.GetIncludeVhRateLimits()).(interface{ Validate() error }); ok { 1321 if err := v.Validate(); err != nil { 1322 return RouteActionValidationError{ 1323 field: "IncludeVhRateLimits", 1324 reason: "embedded message failed validation", 1325 cause: err, 1326 } 1327 } 1328 } 1329 1330 for idx, item := range m.GetHashPolicy() { 1331 _, _ = idx, item 1332 1333 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1334 if err := v.Validate(); err != nil { 1335 return RouteActionValidationError{ 1336 field: fmt.Sprintf("HashPolicy[%v]", idx), 1337 reason: "embedded message failed validation", 1338 cause: err, 1339 } 1340 } 1341 } 1342 1343 } 1344 1345 if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { 1346 if err := v.Validate(); err != nil { 1347 return RouteActionValidationError{ 1348 field: "Cors", 1349 reason: "embedded message failed validation", 1350 cause: err, 1351 } 1352 } 1353 } 1354 1355 if v, ok := interface{}(m.GetMaxGrpcTimeout()).(interface{ Validate() error }); ok { 1356 if err := v.Validate(); err != nil { 1357 return RouteActionValidationError{ 1358 field: "MaxGrpcTimeout", 1359 reason: "embedded message failed validation", 1360 cause: err, 1361 } 1362 } 1363 } 1364 1365 if v, ok := interface{}(m.GetGrpcTimeoutOffset()).(interface{ Validate() error }); ok { 1366 if err := v.Validate(); err != nil { 1367 return RouteActionValidationError{ 1368 field: "GrpcTimeoutOffset", 1369 reason: "embedded message failed validation", 1370 cause: err, 1371 } 1372 } 1373 } 1374 1375 for idx, item := range m.GetUpgradeConfigs() { 1376 _, _ = idx, item 1377 1378 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1379 if err := v.Validate(); err != nil { 1380 return RouteActionValidationError{ 1381 field: fmt.Sprintf("UpgradeConfigs[%v]", idx), 1382 reason: "embedded message failed validation", 1383 cause: err, 1384 } 1385 } 1386 } 1387 1388 } 1389 1390 if v, ok := interface{}(m.GetInternalRedirectPolicy()).(interface{ Validate() error }); ok { 1391 if err := v.Validate(); err != nil { 1392 return RouteActionValidationError{ 1393 field: "InternalRedirectPolicy", 1394 reason: "embedded message failed validation", 1395 cause: err, 1396 } 1397 } 1398 } 1399 1400 // no validation rules for InternalRedirectAction 1401 1402 if v, ok := interface{}(m.GetMaxInternalRedirects()).(interface{ Validate() error }); ok { 1403 if err := v.Validate(); err != nil { 1404 return RouteActionValidationError{ 1405 field: "MaxInternalRedirects", 1406 reason: "embedded message failed validation", 1407 cause: err, 1408 } 1409 } 1410 } 1411 1412 if v, ok := interface{}(m.GetHedgePolicy()).(interface{ Validate() error }); ok { 1413 if err := v.Validate(); err != nil { 1414 return RouteActionValidationError{ 1415 field: "HedgePolicy", 1416 reason: "embedded message failed validation", 1417 cause: err, 1418 } 1419 } 1420 } 1421 1422 if v, ok := interface{}(m.GetMaxStreamDuration()).(interface{ Validate() error }); ok { 1423 if err := v.Validate(); err != nil { 1424 return RouteActionValidationError{ 1425 field: "MaxStreamDuration", 1426 reason: "embedded message failed validation", 1427 cause: err, 1428 } 1429 } 1430 } 1431 1432 if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedRequestMirrorPolicy()).(interface{ Validate() error }); ok { 1433 if err := v.Validate(); err != nil { 1434 return RouteActionValidationError{ 1435 field: "HiddenEnvoyDeprecatedRequestMirrorPolicy", 1436 reason: "embedded message failed validation", 1437 cause: err, 1438 } 1439 } 1440 } 1441 1442 switch m.ClusterSpecifier.(type) { 1443 1444 case *RouteAction_Cluster: 1445 1446 if utf8.RuneCountInString(m.GetCluster()) < 1 { 1447 return RouteActionValidationError{ 1448 field: "Cluster", 1449 reason: "value length must be at least 1 runes", 1450 } 1451 } 1452 1453 case *RouteAction_ClusterHeader: 1454 1455 if utf8.RuneCountInString(m.GetClusterHeader()) < 1 { 1456 return RouteActionValidationError{ 1457 field: "ClusterHeader", 1458 reason: "value length must be at least 1 runes", 1459 } 1460 } 1461 1462 if !_RouteAction_ClusterHeader_Pattern.MatchString(m.GetClusterHeader()) { 1463 return RouteActionValidationError{ 1464 field: "ClusterHeader", 1465 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1466 } 1467 } 1468 1469 case *RouteAction_WeightedClusters: 1470 1471 if v, ok := interface{}(m.GetWeightedClusters()).(interface{ Validate() error }); ok { 1472 if err := v.Validate(); err != nil { 1473 return RouteActionValidationError{ 1474 field: "WeightedClusters", 1475 reason: "embedded message failed validation", 1476 cause: err, 1477 } 1478 } 1479 } 1480 1481 case *RouteAction_ClusterSpecifierPlugin: 1482 // no validation rules for ClusterSpecifierPlugin 1483 1484 default: 1485 return RouteActionValidationError{ 1486 field: "ClusterSpecifier", 1487 reason: "value is required", 1488 } 1489 1490 } 1491 1492 switch m.HostRewriteSpecifier.(type) { 1493 1494 case *RouteAction_HostRewriteLiteral: 1495 1496 if !_RouteAction_HostRewriteLiteral_Pattern.MatchString(m.GetHostRewriteLiteral()) { 1497 return RouteActionValidationError{ 1498 field: "HostRewriteLiteral", 1499 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1500 } 1501 } 1502 1503 case *RouteAction_AutoHostRewrite: 1504 1505 if v, ok := interface{}(m.GetAutoHostRewrite()).(interface{ Validate() error }); ok { 1506 if err := v.Validate(); err != nil { 1507 return RouteActionValidationError{ 1508 field: "AutoHostRewrite", 1509 reason: "embedded message failed validation", 1510 cause: err, 1511 } 1512 } 1513 } 1514 1515 case *RouteAction_HostRewriteHeader: 1516 1517 if !_RouteAction_HostRewriteHeader_Pattern.MatchString(m.GetHostRewriteHeader()) { 1518 return RouteActionValidationError{ 1519 field: "HostRewriteHeader", 1520 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1521 } 1522 } 1523 1524 case *RouteAction_HostRewritePathRegex: 1525 1526 if v, ok := interface{}(m.GetHostRewritePathRegex()).(interface{ Validate() error }); ok { 1527 if err := v.Validate(); err != nil { 1528 return RouteActionValidationError{ 1529 field: "HostRewritePathRegex", 1530 reason: "embedded message failed validation", 1531 cause: err, 1532 } 1533 } 1534 } 1535 1536 } 1537 1538 return nil 1539 } 1540 1541 // RouteActionValidationError is the validation error returned by 1542 // RouteAction.Validate if the designated constraints aren't met. 1543 type RouteActionValidationError struct { 1544 field string 1545 reason string 1546 cause error 1547 key bool 1548 } 1549 1550 // Field function returns field value. 1551 func (e RouteActionValidationError) Field() string { return e.field } 1552 1553 // Reason function returns reason value. 1554 func (e RouteActionValidationError) Reason() string { return e.reason } 1555 1556 // Cause function returns cause value. 1557 func (e RouteActionValidationError) Cause() error { return e.cause } 1558 1559 // Key function returns key value. 1560 func (e RouteActionValidationError) Key() bool { return e.key } 1561 1562 // ErrorName returns error name. 1563 func (e RouteActionValidationError) ErrorName() string { return "RouteActionValidationError" } 1564 1565 // Error satisfies the builtin error interface 1566 func (e RouteActionValidationError) Error() string { 1567 cause := "" 1568 if e.cause != nil { 1569 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1570 } 1571 1572 key := "" 1573 if e.key { 1574 key = "key for " 1575 } 1576 1577 return fmt.Sprintf( 1578 "invalid %sRouteAction.%s: %s%s", 1579 key, 1580 e.field, 1581 e.reason, 1582 cause) 1583 } 1584 1585 var _ error = RouteActionValidationError{} 1586 1587 var _ interface { 1588 Field() string 1589 Reason() string 1590 Key() bool 1591 Cause() error 1592 ErrorName() string 1593 } = RouteActionValidationError{} 1594 1595 var _RouteAction_ClusterHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1596 1597 var _RouteAction_PrefixRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1598 1599 var _RouteAction_HostRewriteLiteral_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1600 1601 var _RouteAction_HostRewriteHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1602 1603 // Validate checks the field values on RetryPolicy with the rules defined in 1604 // the proto definition for this message. If any rules are violated, an error 1605 // is returned. 1606 func (m *RetryPolicy) Validate() error { 1607 if m == nil { 1608 return nil 1609 } 1610 1611 // no validation rules for RetryOn 1612 1613 if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok { 1614 if err := v.Validate(); err != nil { 1615 return RetryPolicyValidationError{ 1616 field: "NumRetries", 1617 reason: "embedded message failed validation", 1618 cause: err, 1619 } 1620 } 1621 } 1622 1623 if v, ok := interface{}(m.GetPerTryTimeout()).(interface{ Validate() error }); ok { 1624 if err := v.Validate(); err != nil { 1625 return RetryPolicyValidationError{ 1626 field: "PerTryTimeout", 1627 reason: "embedded message failed validation", 1628 cause: err, 1629 } 1630 } 1631 } 1632 1633 if v, ok := interface{}(m.GetRetryPriority()).(interface{ Validate() error }); ok { 1634 if err := v.Validate(); err != nil { 1635 return RetryPolicyValidationError{ 1636 field: "RetryPriority", 1637 reason: "embedded message failed validation", 1638 cause: err, 1639 } 1640 } 1641 } 1642 1643 for idx, item := range m.GetRetryHostPredicate() { 1644 _, _ = idx, item 1645 1646 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1647 if err := v.Validate(); err != nil { 1648 return RetryPolicyValidationError{ 1649 field: fmt.Sprintf("RetryHostPredicate[%v]", idx), 1650 reason: "embedded message failed validation", 1651 cause: err, 1652 } 1653 } 1654 } 1655 1656 } 1657 1658 // no validation rules for HostSelectionRetryMaxAttempts 1659 1660 if v, ok := interface{}(m.GetRetryBackOff()).(interface{ Validate() error }); ok { 1661 if err := v.Validate(); err != nil { 1662 return RetryPolicyValidationError{ 1663 field: "RetryBackOff", 1664 reason: "embedded message failed validation", 1665 cause: err, 1666 } 1667 } 1668 } 1669 1670 if v, ok := interface{}(m.GetRateLimitedRetryBackOff()).(interface{ Validate() error }); ok { 1671 if err := v.Validate(); err != nil { 1672 return RetryPolicyValidationError{ 1673 field: "RateLimitedRetryBackOff", 1674 reason: "embedded message failed validation", 1675 cause: err, 1676 } 1677 } 1678 } 1679 1680 for idx, item := range m.GetRetriableHeaders() { 1681 _, _ = idx, item 1682 1683 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1684 if err := v.Validate(); err != nil { 1685 return RetryPolicyValidationError{ 1686 field: fmt.Sprintf("RetriableHeaders[%v]", idx), 1687 reason: "embedded message failed validation", 1688 cause: err, 1689 } 1690 } 1691 } 1692 1693 } 1694 1695 for idx, item := range m.GetRetriableRequestHeaders() { 1696 _, _ = idx, item 1697 1698 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1699 if err := v.Validate(); err != nil { 1700 return RetryPolicyValidationError{ 1701 field: fmt.Sprintf("RetriableRequestHeaders[%v]", idx), 1702 reason: "embedded message failed validation", 1703 cause: err, 1704 } 1705 } 1706 } 1707 1708 } 1709 1710 return nil 1711 } 1712 1713 // RetryPolicyValidationError is the validation error returned by 1714 // RetryPolicy.Validate if the designated constraints aren't met. 1715 type RetryPolicyValidationError struct { 1716 field string 1717 reason string 1718 cause error 1719 key bool 1720 } 1721 1722 // Field function returns field value. 1723 func (e RetryPolicyValidationError) Field() string { return e.field } 1724 1725 // Reason function returns reason value. 1726 func (e RetryPolicyValidationError) Reason() string { return e.reason } 1727 1728 // Cause function returns cause value. 1729 func (e RetryPolicyValidationError) Cause() error { return e.cause } 1730 1731 // Key function returns key value. 1732 func (e RetryPolicyValidationError) Key() bool { return e.key } 1733 1734 // ErrorName returns error name. 1735 func (e RetryPolicyValidationError) ErrorName() string { return "RetryPolicyValidationError" } 1736 1737 // Error satisfies the builtin error interface 1738 func (e RetryPolicyValidationError) Error() string { 1739 cause := "" 1740 if e.cause != nil { 1741 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1742 } 1743 1744 key := "" 1745 if e.key { 1746 key = "key for " 1747 } 1748 1749 return fmt.Sprintf( 1750 "invalid %sRetryPolicy.%s: %s%s", 1751 key, 1752 e.field, 1753 e.reason, 1754 cause) 1755 } 1756 1757 var _ error = RetryPolicyValidationError{} 1758 1759 var _ interface { 1760 Field() string 1761 Reason() string 1762 Key() bool 1763 Cause() error 1764 ErrorName() string 1765 } = RetryPolicyValidationError{} 1766 1767 // Validate checks the field values on HedgePolicy with the rules defined in 1768 // the proto definition for this message. If any rules are violated, an error 1769 // is returned. 1770 func (m *HedgePolicy) Validate() error { 1771 if m == nil { 1772 return nil 1773 } 1774 1775 if wrapper := m.GetInitialRequests(); wrapper != nil { 1776 1777 if wrapper.GetValue() < 1 { 1778 return HedgePolicyValidationError{ 1779 field: "InitialRequests", 1780 reason: "value must be greater than or equal to 1", 1781 } 1782 } 1783 1784 } 1785 1786 if v, ok := interface{}(m.GetAdditionalRequestChance()).(interface{ Validate() error }); ok { 1787 if err := v.Validate(); err != nil { 1788 return HedgePolicyValidationError{ 1789 field: "AdditionalRequestChance", 1790 reason: "embedded message failed validation", 1791 cause: err, 1792 } 1793 } 1794 } 1795 1796 // no validation rules for HedgeOnPerTryTimeout 1797 1798 return nil 1799 } 1800 1801 // HedgePolicyValidationError is the validation error returned by 1802 // HedgePolicy.Validate if the designated constraints aren't met. 1803 type HedgePolicyValidationError struct { 1804 field string 1805 reason string 1806 cause error 1807 key bool 1808 } 1809 1810 // Field function returns field value. 1811 func (e HedgePolicyValidationError) Field() string { return e.field } 1812 1813 // Reason function returns reason value. 1814 func (e HedgePolicyValidationError) Reason() string { return e.reason } 1815 1816 // Cause function returns cause value. 1817 func (e HedgePolicyValidationError) Cause() error { return e.cause } 1818 1819 // Key function returns key value. 1820 func (e HedgePolicyValidationError) Key() bool { return e.key } 1821 1822 // ErrorName returns error name. 1823 func (e HedgePolicyValidationError) ErrorName() string { return "HedgePolicyValidationError" } 1824 1825 // Error satisfies the builtin error interface 1826 func (e HedgePolicyValidationError) Error() string { 1827 cause := "" 1828 if e.cause != nil { 1829 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1830 } 1831 1832 key := "" 1833 if e.key { 1834 key = "key for " 1835 } 1836 1837 return fmt.Sprintf( 1838 "invalid %sHedgePolicy.%s: %s%s", 1839 key, 1840 e.field, 1841 e.reason, 1842 cause) 1843 } 1844 1845 var _ error = HedgePolicyValidationError{} 1846 1847 var _ interface { 1848 Field() string 1849 Reason() string 1850 Key() bool 1851 Cause() error 1852 ErrorName() string 1853 } = HedgePolicyValidationError{} 1854 1855 // Validate checks the field values on RedirectAction with the rules defined in 1856 // the proto definition for this message. If any rules are violated, an error 1857 // is returned. 1858 func (m *RedirectAction) Validate() error { 1859 if m == nil { 1860 return nil 1861 } 1862 1863 if !_RedirectAction_HostRedirect_Pattern.MatchString(m.GetHostRedirect()) { 1864 return RedirectActionValidationError{ 1865 field: "HostRedirect", 1866 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1867 } 1868 } 1869 1870 // no validation rules for PortRedirect 1871 1872 if _, ok := RedirectAction_RedirectResponseCode_name[int32(m.GetResponseCode())]; !ok { 1873 return RedirectActionValidationError{ 1874 field: "ResponseCode", 1875 reason: "value must be one of the defined enum values", 1876 } 1877 } 1878 1879 // no validation rules for StripQuery 1880 1881 switch m.SchemeRewriteSpecifier.(type) { 1882 1883 case *RedirectAction_HttpsRedirect: 1884 // no validation rules for HttpsRedirect 1885 1886 case *RedirectAction_SchemeRedirect: 1887 // no validation rules for SchemeRedirect 1888 1889 } 1890 1891 switch m.PathRewriteSpecifier.(type) { 1892 1893 case *RedirectAction_PathRedirect: 1894 1895 if !_RedirectAction_PathRedirect_Pattern.MatchString(m.GetPathRedirect()) { 1896 return RedirectActionValidationError{ 1897 field: "PathRedirect", 1898 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1899 } 1900 } 1901 1902 case *RedirectAction_PrefixRewrite: 1903 1904 if !_RedirectAction_PrefixRewrite_Pattern.MatchString(m.GetPrefixRewrite()) { 1905 return RedirectActionValidationError{ 1906 field: "PrefixRewrite", 1907 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 1908 } 1909 } 1910 1911 case *RedirectAction_RegexRewrite: 1912 1913 if v, ok := interface{}(m.GetRegexRewrite()).(interface{ Validate() error }); ok { 1914 if err := v.Validate(); err != nil { 1915 return RedirectActionValidationError{ 1916 field: "RegexRewrite", 1917 reason: "embedded message failed validation", 1918 cause: err, 1919 } 1920 } 1921 } 1922 1923 } 1924 1925 return nil 1926 } 1927 1928 // RedirectActionValidationError is the validation error returned by 1929 // RedirectAction.Validate if the designated constraints aren't met. 1930 type RedirectActionValidationError struct { 1931 field string 1932 reason string 1933 cause error 1934 key bool 1935 } 1936 1937 // Field function returns field value. 1938 func (e RedirectActionValidationError) Field() string { return e.field } 1939 1940 // Reason function returns reason value. 1941 func (e RedirectActionValidationError) Reason() string { return e.reason } 1942 1943 // Cause function returns cause value. 1944 func (e RedirectActionValidationError) Cause() error { return e.cause } 1945 1946 // Key function returns key value. 1947 func (e RedirectActionValidationError) Key() bool { return e.key } 1948 1949 // ErrorName returns error name. 1950 func (e RedirectActionValidationError) ErrorName() string { return "RedirectActionValidationError" } 1951 1952 // Error satisfies the builtin error interface 1953 func (e RedirectActionValidationError) Error() string { 1954 cause := "" 1955 if e.cause != nil { 1956 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1957 } 1958 1959 key := "" 1960 if e.key { 1961 key = "key for " 1962 } 1963 1964 return fmt.Sprintf( 1965 "invalid %sRedirectAction.%s: %s%s", 1966 key, 1967 e.field, 1968 e.reason, 1969 cause) 1970 } 1971 1972 var _ error = RedirectActionValidationError{} 1973 1974 var _ interface { 1975 Field() string 1976 Reason() string 1977 Key() bool 1978 Cause() error 1979 ErrorName() string 1980 } = RedirectActionValidationError{} 1981 1982 var _RedirectAction_HostRedirect_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1983 1984 var _RedirectAction_PathRedirect_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1985 1986 var _RedirectAction_PrefixRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 1987 1988 // Validate checks the field values on DirectResponseAction with the rules 1989 // defined in the proto definition for this message. If any rules are 1990 // violated, an error is returned. 1991 func (m *DirectResponseAction) Validate() error { 1992 if m == nil { 1993 return nil 1994 } 1995 1996 if val := m.GetStatus(); val < 100 || val >= 600 { 1997 return DirectResponseActionValidationError{ 1998 field: "Status", 1999 reason: "value must be inside range [100, 600)", 2000 } 2001 } 2002 2003 if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok { 2004 if err := v.Validate(); err != nil { 2005 return DirectResponseActionValidationError{ 2006 field: "Body", 2007 reason: "embedded message failed validation", 2008 cause: err, 2009 } 2010 } 2011 } 2012 2013 return nil 2014 } 2015 2016 // DirectResponseActionValidationError is the validation error returned by 2017 // DirectResponseAction.Validate if the designated constraints aren't met. 2018 type DirectResponseActionValidationError struct { 2019 field string 2020 reason string 2021 cause error 2022 key bool 2023 } 2024 2025 // Field function returns field value. 2026 func (e DirectResponseActionValidationError) Field() string { return e.field } 2027 2028 // Reason function returns reason value. 2029 func (e DirectResponseActionValidationError) Reason() string { return e.reason } 2030 2031 // Cause function returns cause value. 2032 func (e DirectResponseActionValidationError) Cause() error { return e.cause } 2033 2034 // Key function returns key value. 2035 func (e DirectResponseActionValidationError) Key() bool { return e.key } 2036 2037 // ErrorName returns error name. 2038 func (e DirectResponseActionValidationError) ErrorName() string { 2039 return "DirectResponseActionValidationError" 2040 } 2041 2042 // Error satisfies the builtin error interface 2043 func (e DirectResponseActionValidationError) Error() string { 2044 cause := "" 2045 if e.cause != nil { 2046 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2047 } 2048 2049 key := "" 2050 if e.key { 2051 key = "key for " 2052 } 2053 2054 return fmt.Sprintf( 2055 "invalid %sDirectResponseAction.%s: %s%s", 2056 key, 2057 e.field, 2058 e.reason, 2059 cause) 2060 } 2061 2062 var _ error = DirectResponseActionValidationError{} 2063 2064 var _ interface { 2065 Field() string 2066 Reason() string 2067 Key() bool 2068 Cause() error 2069 ErrorName() string 2070 } = DirectResponseActionValidationError{} 2071 2072 // Validate checks the field values on NonForwardingAction with the rules 2073 // defined in the proto definition for this message. If any rules are 2074 // violated, an error is returned. 2075 func (m *NonForwardingAction) Validate() error { 2076 if m == nil { 2077 return nil 2078 } 2079 2080 return nil 2081 } 2082 2083 // NonForwardingActionValidationError is the validation error returned by 2084 // NonForwardingAction.Validate if the designated constraints aren't met. 2085 type NonForwardingActionValidationError struct { 2086 field string 2087 reason string 2088 cause error 2089 key bool 2090 } 2091 2092 // Field function returns field value. 2093 func (e NonForwardingActionValidationError) Field() string { return e.field } 2094 2095 // Reason function returns reason value. 2096 func (e NonForwardingActionValidationError) Reason() string { return e.reason } 2097 2098 // Cause function returns cause value. 2099 func (e NonForwardingActionValidationError) Cause() error { return e.cause } 2100 2101 // Key function returns key value. 2102 func (e NonForwardingActionValidationError) Key() bool { return e.key } 2103 2104 // ErrorName returns error name. 2105 func (e NonForwardingActionValidationError) ErrorName() string { 2106 return "NonForwardingActionValidationError" 2107 } 2108 2109 // Error satisfies the builtin error interface 2110 func (e NonForwardingActionValidationError) Error() string { 2111 cause := "" 2112 if e.cause != nil { 2113 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2114 } 2115 2116 key := "" 2117 if e.key { 2118 key = "key for " 2119 } 2120 2121 return fmt.Sprintf( 2122 "invalid %sNonForwardingAction.%s: %s%s", 2123 key, 2124 e.field, 2125 e.reason, 2126 cause) 2127 } 2128 2129 var _ error = NonForwardingActionValidationError{} 2130 2131 var _ interface { 2132 Field() string 2133 Reason() string 2134 Key() bool 2135 Cause() error 2136 ErrorName() string 2137 } = NonForwardingActionValidationError{} 2138 2139 // Validate checks the field values on Decorator with the rules defined in the 2140 // proto definition for this message. If any rules are violated, an error is returned. 2141 func (m *Decorator) Validate() error { 2142 if m == nil { 2143 return nil 2144 } 2145 2146 if utf8.RuneCountInString(m.GetOperation()) < 1 { 2147 return DecoratorValidationError{ 2148 field: "Operation", 2149 reason: "value length must be at least 1 runes", 2150 } 2151 } 2152 2153 if v, ok := interface{}(m.GetPropagate()).(interface{ Validate() error }); ok { 2154 if err := v.Validate(); err != nil { 2155 return DecoratorValidationError{ 2156 field: "Propagate", 2157 reason: "embedded message failed validation", 2158 cause: err, 2159 } 2160 } 2161 } 2162 2163 return nil 2164 } 2165 2166 // DecoratorValidationError is the validation error returned by 2167 // Decorator.Validate if the designated constraints aren't met. 2168 type DecoratorValidationError struct { 2169 field string 2170 reason string 2171 cause error 2172 key bool 2173 } 2174 2175 // Field function returns field value. 2176 func (e DecoratorValidationError) Field() string { return e.field } 2177 2178 // Reason function returns reason value. 2179 func (e DecoratorValidationError) Reason() string { return e.reason } 2180 2181 // Cause function returns cause value. 2182 func (e DecoratorValidationError) Cause() error { return e.cause } 2183 2184 // Key function returns key value. 2185 func (e DecoratorValidationError) Key() bool { return e.key } 2186 2187 // ErrorName returns error name. 2188 func (e DecoratorValidationError) ErrorName() string { return "DecoratorValidationError" } 2189 2190 // Error satisfies the builtin error interface 2191 func (e DecoratorValidationError) Error() string { 2192 cause := "" 2193 if e.cause != nil { 2194 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2195 } 2196 2197 key := "" 2198 if e.key { 2199 key = "key for " 2200 } 2201 2202 return fmt.Sprintf( 2203 "invalid %sDecorator.%s: %s%s", 2204 key, 2205 e.field, 2206 e.reason, 2207 cause) 2208 } 2209 2210 var _ error = DecoratorValidationError{} 2211 2212 var _ interface { 2213 Field() string 2214 Reason() string 2215 Key() bool 2216 Cause() error 2217 ErrorName() string 2218 } = DecoratorValidationError{} 2219 2220 // Validate checks the field values on Tracing with the rules defined in the 2221 // proto definition for this message. If any rules are violated, an error is returned. 2222 func (m *Tracing) Validate() error { 2223 if m == nil { 2224 return nil 2225 } 2226 2227 if v, ok := interface{}(m.GetClientSampling()).(interface{ Validate() error }); ok { 2228 if err := v.Validate(); err != nil { 2229 return TracingValidationError{ 2230 field: "ClientSampling", 2231 reason: "embedded message failed validation", 2232 cause: err, 2233 } 2234 } 2235 } 2236 2237 if v, ok := interface{}(m.GetRandomSampling()).(interface{ Validate() error }); ok { 2238 if err := v.Validate(); err != nil { 2239 return TracingValidationError{ 2240 field: "RandomSampling", 2241 reason: "embedded message failed validation", 2242 cause: err, 2243 } 2244 } 2245 } 2246 2247 if v, ok := interface{}(m.GetOverallSampling()).(interface{ Validate() error }); ok { 2248 if err := v.Validate(); err != nil { 2249 return TracingValidationError{ 2250 field: "OverallSampling", 2251 reason: "embedded message failed validation", 2252 cause: err, 2253 } 2254 } 2255 } 2256 2257 for idx, item := range m.GetCustomTags() { 2258 _, _ = idx, item 2259 2260 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2261 if err := v.Validate(); err != nil { 2262 return TracingValidationError{ 2263 field: fmt.Sprintf("CustomTags[%v]", idx), 2264 reason: "embedded message failed validation", 2265 cause: err, 2266 } 2267 } 2268 } 2269 2270 } 2271 2272 return nil 2273 } 2274 2275 // TracingValidationError is the validation error returned by Tracing.Validate 2276 // if the designated constraints aren't met. 2277 type TracingValidationError struct { 2278 field string 2279 reason string 2280 cause error 2281 key bool 2282 } 2283 2284 // Field function returns field value. 2285 func (e TracingValidationError) Field() string { return e.field } 2286 2287 // Reason function returns reason value. 2288 func (e TracingValidationError) Reason() string { return e.reason } 2289 2290 // Cause function returns cause value. 2291 func (e TracingValidationError) Cause() error { return e.cause } 2292 2293 // Key function returns key value. 2294 func (e TracingValidationError) Key() bool { return e.key } 2295 2296 // ErrorName returns error name. 2297 func (e TracingValidationError) ErrorName() string { return "TracingValidationError" } 2298 2299 // Error satisfies the builtin error interface 2300 func (e TracingValidationError) Error() string { 2301 cause := "" 2302 if e.cause != nil { 2303 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2304 } 2305 2306 key := "" 2307 if e.key { 2308 key = "key for " 2309 } 2310 2311 return fmt.Sprintf( 2312 "invalid %sTracing.%s: %s%s", 2313 key, 2314 e.field, 2315 e.reason, 2316 cause) 2317 } 2318 2319 var _ error = TracingValidationError{} 2320 2321 var _ interface { 2322 Field() string 2323 Reason() string 2324 Key() bool 2325 Cause() error 2326 ErrorName() string 2327 } = TracingValidationError{} 2328 2329 // Validate checks the field values on VirtualCluster with the rules defined in 2330 // the proto definition for this message. If any rules are violated, an error 2331 // is returned. 2332 func (m *VirtualCluster) Validate() error { 2333 if m == nil { 2334 return nil 2335 } 2336 2337 for idx, item := range m.GetHeaders() { 2338 _, _ = idx, item 2339 2340 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2341 if err := v.Validate(); err != nil { 2342 return VirtualClusterValidationError{ 2343 field: fmt.Sprintf("Headers[%v]", idx), 2344 reason: "embedded message failed validation", 2345 cause: err, 2346 } 2347 } 2348 } 2349 2350 } 2351 2352 if utf8.RuneCountInString(m.GetName()) < 1 { 2353 return VirtualClusterValidationError{ 2354 field: "Name", 2355 reason: "value length must be at least 1 runes", 2356 } 2357 } 2358 2359 if len(m.GetHiddenEnvoyDeprecatedPattern()) > 1024 { 2360 return VirtualClusterValidationError{ 2361 field: "HiddenEnvoyDeprecatedPattern", 2362 reason: "value length must be at most 1024 bytes", 2363 } 2364 } 2365 2366 // no validation rules for HiddenEnvoyDeprecatedMethod 2367 2368 return nil 2369 } 2370 2371 // VirtualClusterValidationError is the validation error returned by 2372 // VirtualCluster.Validate if the designated constraints aren't met. 2373 type VirtualClusterValidationError struct { 2374 field string 2375 reason string 2376 cause error 2377 key bool 2378 } 2379 2380 // Field function returns field value. 2381 func (e VirtualClusterValidationError) Field() string { return e.field } 2382 2383 // Reason function returns reason value. 2384 func (e VirtualClusterValidationError) Reason() string { return e.reason } 2385 2386 // Cause function returns cause value. 2387 func (e VirtualClusterValidationError) Cause() error { return e.cause } 2388 2389 // Key function returns key value. 2390 func (e VirtualClusterValidationError) Key() bool { return e.key } 2391 2392 // ErrorName returns error name. 2393 func (e VirtualClusterValidationError) ErrorName() string { return "VirtualClusterValidationError" } 2394 2395 // Error satisfies the builtin error interface 2396 func (e VirtualClusterValidationError) Error() string { 2397 cause := "" 2398 if e.cause != nil { 2399 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2400 } 2401 2402 key := "" 2403 if e.key { 2404 key = "key for " 2405 } 2406 2407 return fmt.Sprintf( 2408 "invalid %sVirtualCluster.%s: %s%s", 2409 key, 2410 e.field, 2411 e.reason, 2412 cause) 2413 } 2414 2415 var _ error = VirtualClusterValidationError{} 2416 2417 var _ interface { 2418 Field() string 2419 Reason() string 2420 Key() bool 2421 Cause() error 2422 ErrorName() string 2423 } = VirtualClusterValidationError{} 2424 2425 // Validate checks the field values on RateLimit with the rules defined in the 2426 // proto definition for this message. If any rules are violated, an error is returned. 2427 func (m *RateLimit) Validate() error { 2428 if m == nil { 2429 return nil 2430 } 2431 2432 if wrapper := m.GetStage(); wrapper != nil { 2433 2434 if wrapper.GetValue() > 10 { 2435 return RateLimitValidationError{ 2436 field: "Stage", 2437 reason: "value must be less than or equal to 10", 2438 } 2439 } 2440 2441 } 2442 2443 // no validation rules for DisableKey 2444 2445 if len(m.GetActions()) < 1 { 2446 return RateLimitValidationError{ 2447 field: "Actions", 2448 reason: "value must contain at least 1 item(s)", 2449 } 2450 } 2451 2452 for idx, item := range m.GetActions() { 2453 _, _ = idx, item 2454 2455 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2456 if err := v.Validate(); err != nil { 2457 return RateLimitValidationError{ 2458 field: fmt.Sprintf("Actions[%v]", idx), 2459 reason: "embedded message failed validation", 2460 cause: err, 2461 } 2462 } 2463 } 2464 2465 } 2466 2467 if v, ok := interface{}(m.GetLimit()).(interface{ Validate() error }); ok { 2468 if err := v.Validate(); err != nil { 2469 return RateLimitValidationError{ 2470 field: "Limit", 2471 reason: "embedded message failed validation", 2472 cause: err, 2473 } 2474 } 2475 } 2476 2477 return nil 2478 } 2479 2480 // RateLimitValidationError is the validation error returned by 2481 // RateLimit.Validate if the designated constraints aren't met. 2482 type RateLimitValidationError struct { 2483 field string 2484 reason string 2485 cause error 2486 key bool 2487 } 2488 2489 // Field function returns field value. 2490 func (e RateLimitValidationError) Field() string { return e.field } 2491 2492 // Reason function returns reason value. 2493 func (e RateLimitValidationError) Reason() string { return e.reason } 2494 2495 // Cause function returns cause value. 2496 func (e RateLimitValidationError) Cause() error { return e.cause } 2497 2498 // Key function returns key value. 2499 func (e RateLimitValidationError) Key() bool { return e.key } 2500 2501 // ErrorName returns error name. 2502 func (e RateLimitValidationError) ErrorName() string { return "RateLimitValidationError" } 2503 2504 // Error satisfies the builtin error interface 2505 func (e RateLimitValidationError) Error() string { 2506 cause := "" 2507 if e.cause != nil { 2508 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2509 } 2510 2511 key := "" 2512 if e.key { 2513 key = "key for " 2514 } 2515 2516 return fmt.Sprintf( 2517 "invalid %sRateLimit.%s: %s%s", 2518 key, 2519 e.field, 2520 e.reason, 2521 cause) 2522 } 2523 2524 var _ error = RateLimitValidationError{} 2525 2526 var _ interface { 2527 Field() string 2528 Reason() string 2529 Key() bool 2530 Cause() error 2531 ErrorName() string 2532 } = RateLimitValidationError{} 2533 2534 // Validate checks the field values on HeaderMatcher with the rules defined in 2535 // the proto definition for this message. If any rules are violated, an error 2536 // is returned. 2537 func (m *HeaderMatcher) Validate() error { 2538 if m == nil { 2539 return nil 2540 } 2541 2542 if utf8.RuneCountInString(m.GetName()) < 1 { 2543 return HeaderMatcherValidationError{ 2544 field: "Name", 2545 reason: "value length must be at least 1 runes", 2546 } 2547 } 2548 2549 if !_HeaderMatcher_Name_Pattern.MatchString(m.GetName()) { 2550 return HeaderMatcherValidationError{ 2551 field: "Name", 2552 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 2553 } 2554 } 2555 2556 // no validation rules for InvertMatch 2557 2558 switch m.HeaderMatchSpecifier.(type) { 2559 2560 case *HeaderMatcher_ExactMatch: 2561 // no validation rules for ExactMatch 2562 2563 case *HeaderMatcher_SafeRegexMatch: 2564 2565 if v, ok := interface{}(m.GetSafeRegexMatch()).(interface{ Validate() error }); ok { 2566 if err := v.Validate(); err != nil { 2567 return HeaderMatcherValidationError{ 2568 field: "SafeRegexMatch", 2569 reason: "embedded message failed validation", 2570 cause: err, 2571 } 2572 } 2573 } 2574 2575 case *HeaderMatcher_RangeMatch: 2576 2577 if v, ok := interface{}(m.GetRangeMatch()).(interface{ Validate() error }); ok { 2578 if err := v.Validate(); err != nil { 2579 return HeaderMatcherValidationError{ 2580 field: "RangeMatch", 2581 reason: "embedded message failed validation", 2582 cause: err, 2583 } 2584 } 2585 } 2586 2587 case *HeaderMatcher_PresentMatch: 2588 // no validation rules for PresentMatch 2589 2590 case *HeaderMatcher_PrefixMatch: 2591 2592 if utf8.RuneCountInString(m.GetPrefixMatch()) < 1 { 2593 return HeaderMatcherValidationError{ 2594 field: "PrefixMatch", 2595 reason: "value length must be at least 1 runes", 2596 } 2597 } 2598 2599 case *HeaderMatcher_SuffixMatch: 2600 2601 if utf8.RuneCountInString(m.GetSuffixMatch()) < 1 { 2602 return HeaderMatcherValidationError{ 2603 field: "SuffixMatch", 2604 reason: "value length must be at least 1 runes", 2605 } 2606 } 2607 2608 case *HeaderMatcher_ContainsMatch: 2609 2610 if utf8.RuneCountInString(m.GetContainsMatch()) < 1 { 2611 return HeaderMatcherValidationError{ 2612 field: "ContainsMatch", 2613 reason: "value length must be at least 1 runes", 2614 } 2615 } 2616 2617 case *HeaderMatcher_StringMatch: 2618 2619 if v, ok := interface{}(m.GetStringMatch()).(interface{ Validate() error }); ok { 2620 if err := v.Validate(); err != nil { 2621 return HeaderMatcherValidationError{ 2622 field: "StringMatch", 2623 reason: "embedded message failed validation", 2624 cause: err, 2625 } 2626 } 2627 } 2628 2629 case *HeaderMatcher_HiddenEnvoyDeprecatedRegexMatch: 2630 2631 if len(m.GetHiddenEnvoyDeprecatedRegexMatch()) > 1024 { 2632 return HeaderMatcherValidationError{ 2633 field: "HiddenEnvoyDeprecatedRegexMatch", 2634 reason: "value length must be at most 1024 bytes", 2635 } 2636 } 2637 2638 } 2639 2640 return nil 2641 } 2642 2643 // HeaderMatcherValidationError is the validation error returned by 2644 // HeaderMatcher.Validate if the designated constraints aren't met. 2645 type HeaderMatcherValidationError struct { 2646 field string 2647 reason string 2648 cause error 2649 key bool 2650 } 2651 2652 // Field function returns field value. 2653 func (e HeaderMatcherValidationError) Field() string { return e.field } 2654 2655 // Reason function returns reason value. 2656 func (e HeaderMatcherValidationError) Reason() string { return e.reason } 2657 2658 // Cause function returns cause value. 2659 func (e HeaderMatcherValidationError) Cause() error { return e.cause } 2660 2661 // Key function returns key value. 2662 func (e HeaderMatcherValidationError) Key() bool { return e.key } 2663 2664 // ErrorName returns error name. 2665 func (e HeaderMatcherValidationError) ErrorName() string { return "HeaderMatcherValidationError" } 2666 2667 // Error satisfies the builtin error interface 2668 func (e HeaderMatcherValidationError) Error() string { 2669 cause := "" 2670 if e.cause != nil { 2671 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2672 } 2673 2674 key := "" 2675 if e.key { 2676 key = "key for " 2677 } 2678 2679 return fmt.Sprintf( 2680 "invalid %sHeaderMatcher.%s: %s%s", 2681 key, 2682 e.field, 2683 e.reason, 2684 cause) 2685 } 2686 2687 var _ error = HeaderMatcherValidationError{} 2688 2689 var _ interface { 2690 Field() string 2691 Reason() string 2692 Key() bool 2693 Cause() error 2694 ErrorName() string 2695 } = HeaderMatcherValidationError{} 2696 2697 var _HeaderMatcher_Name_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 2698 2699 // Validate checks the field values on QueryParameterMatcher with the rules 2700 // defined in the proto definition for this message. If any rules are 2701 // violated, an error is returned. 2702 func (m *QueryParameterMatcher) Validate() error { 2703 if m == nil { 2704 return nil 2705 } 2706 2707 if utf8.RuneCountInString(m.GetName()) < 1 { 2708 return QueryParameterMatcherValidationError{ 2709 field: "Name", 2710 reason: "value length must be at least 1 runes", 2711 } 2712 } 2713 2714 if len(m.GetName()) > 1024 { 2715 return QueryParameterMatcherValidationError{ 2716 field: "Name", 2717 reason: "value length must be at most 1024 bytes", 2718 } 2719 } 2720 2721 // no validation rules for HiddenEnvoyDeprecatedValue 2722 2723 if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedRegex()).(interface{ Validate() error }); ok { 2724 if err := v.Validate(); err != nil { 2725 return QueryParameterMatcherValidationError{ 2726 field: "HiddenEnvoyDeprecatedRegex", 2727 reason: "embedded message failed validation", 2728 cause: err, 2729 } 2730 } 2731 } 2732 2733 switch m.QueryParameterMatchSpecifier.(type) { 2734 2735 case *QueryParameterMatcher_StringMatch: 2736 2737 if m.GetStringMatch() == nil { 2738 return QueryParameterMatcherValidationError{ 2739 field: "StringMatch", 2740 reason: "value is required", 2741 } 2742 } 2743 2744 if v, ok := interface{}(m.GetStringMatch()).(interface{ Validate() error }); ok { 2745 if err := v.Validate(); err != nil { 2746 return QueryParameterMatcherValidationError{ 2747 field: "StringMatch", 2748 reason: "embedded message failed validation", 2749 cause: err, 2750 } 2751 } 2752 } 2753 2754 case *QueryParameterMatcher_PresentMatch: 2755 // no validation rules for PresentMatch 2756 2757 } 2758 2759 return nil 2760 } 2761 2762 // QueryParameterMatcherValidationError is the validation error returned by 2763 // QueryParameterMatcher.Validate if the designated constraints aren't met. 2764 type QueryParameterMatcherValidationError struct { 2765 field string 2766 reason string 2767 cause error 2768 key bool 2769 } 2770 2771 // Field function returns field value. 2772 func (e QueryParameterMatcherValidationError) Field() string { return e.field } 2773 2774 // Reason function returns reason value. 2775 func (e QueryParameterMatcherValidationError) Reason() string { return e.reason } 2776 2777 // Cause function returns cause value. 2778 func (e QueryParameterMatcherValidationError) Cause() error { return e.cause } 2779 2780 // Key function returns key value. 2781 func (e QueryParameterMatcherValidationError) Key() bool { return e.key } 2782 2783 // ErrorName returns error name. 2784 func (e QueryParameterMatcherValidationError) ErrorName() string { 2785 return "QueryParameterMatcherValidationError" 2786 } 2787 2788 // Error satisfies the builtin error interface 2789 func (e QueryParameterMatcherValidationError) Error() string { 2790 cause := "" 2791 if e.cause != nil { 2792 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2793 } 2794 2795 key := "" 2796 if e.key { 2797 key = "key for " 2798 } 2799 2800 return fmt.Sprintf( 2801 "invalid %sQueryParameterMatcher.%s: %s%s", 2802 key, 2803 e.field, 2804 e.reason, 2805 cause) 2806 } 2807 2808 var _ error = QueryParameterMatcherValidationError{} 2809 2810 var _ interface { 2811 Field() string 2812 Reason() string 2813 Key() bool 2814 Cause() error 2815 ErrorName() string 2816 } = QueryParameterMatcherValidationError{} 2817 2818 // Validate checks the field values on InternalRedirectPolicy with the rules 2819 // defined in the proto definition for this message. If any rules are 2820 // violated, an error is returned. 2821 func (m *InternalRedirectPolicy) Validate() error { 2822 if m == nil { 2823 return nil 2824 } 2825 2826 if v, ok := interface{}(m.GetMaxInternalRedirects()).(interface{ Validate() error }); ok { 2827 if err := v.Validate(); err != nil { 2828 return InternalRedirectPolicyValidationError{ 2829 field: "MaxInternalRedirects", 2830 reason: "embedded message failed validation", 2831 cause: err, 2832 } 2833 } 2834 } 2835 2836 if len(m.GetRedirectResponseCodes()) > 5 { 2837 return InternalRedirectPolicyValidationError{ 2838 field: "RedirectResponseCodes", 2839 reason: "value must contain no more than 5 item(s)", 2840 } 2841 } 2842 2843 for idx, item := range m.GetPredicates() { 2844 _, _ = idx, item 2845 2846 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 2847 if err := v.Validate(); err != nil { 2848 return InternalRedirectPolicyValidationError{ 2849 field: fmt.Sprintf("Predicates[%v]", idx), 2850 reason: "embedded message failed validation", 2851 cause: err, 2852 } 2853 } 2854 } 2855 2856 } 2857 2858 // no validation rules for AllowCrossSchemeRedirect 2859 2860 return nil 2861 } 2862 2863 // InternalRedirectPolicyValidationError is the validation error returned by 2864 // InternalRedirectPolicy.Validate if the designated constraints aren't met. 2865 type InternalRedirectPolicyValidationError struct { 2866 field string 2867 reason string 2868 cause error 2869 key bool 2870 } 2871 2872 // Field function returns field value. 2873 func (e InternalRedirectPolicyValidationError) Field() string { return e.field } 2874 2875 // Reason function returns reason value. 2876 func (e InternalRedirectPolicyValidationError) Reason() string { return e.reason } 2877 2878 // Cause function returns cause value. 2879 func (e InternalRedirectPolicyValidationError) Cause() error { return e.cause } 2880 2881 // Key function returns key value. 2882 func (e InternalRedirectPolicyValidationError) Key() bool { return e.key } 2883 2884 // ErrorName returns error name. 2885 func (e InternalRedirectPolicyValidationError) ErrorName() string { 2886 return "InternalRedirectPolicyValidationError" 2887 } 2888 2889 // Error satisfies the builtin error interface 2890 func (e InternalRedirectPolicyValidationError) Error() string { 2891 cause := "" 2892 if e.cause != nil { 2893 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2894 } 2895 2896 key := "" 2897 if e.key { 2898 key = "key for " 2899 } 2900 2901 return fmt.Sprintf( 2902 "invalid %sInternalRedirectPolicy.%s: %s%s", 2903 key, 2904 e.field, 2905 e.reason, 2906 cause) 2907 } 2908 2909 var _ error = InternalRedirectPolicyValidationError{} 2910 2911 var _ interface { 2912 Field() string 2913 Reason() string 2914 Key() bool 2915 Cause() error 2916 ErrorName() string 2917 } = InternalRedirectPolicyValidationError{} 2918 2919 // Validate checks the field values on FilterConfig with the rules defined in 2920 // the proto definition for this message. If any rules are violated, an error 2921 // is returned. 2922 func (m *FilterConfig) Validate() error { 2923 if m == nil { 2924 return nil 2925 } 2926 2927 if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { 2928 if err := v.Validate(); err != nil { 2929 return FilterConfigValidationError{ 2930 field: "Config", 2931 reason: "embedded message failed validation", 2932 cause: err, 2933 } 2934 } 2935 } 2936 2937 // no validation rules for IsOptional 2938 2939 return nil 2940 } 2941 2942 // FilterConfigValidationError is the validation error returned by 2943 // FilterConfig.Validate if the designated constraints aren't met. 2944 type FilterConfigValidationError struct { 2945 field string 2946 reason string 2947 cause error 2948 key bool 2949 } 2950 2951 // Field function returns field value. 2952 func (e FilterConfigValidationError) Field() string { return e.field } 2953 2954 // Reason function returns reason value. 2955 func (e FilterConfigValidationError) Reason() string { return e.reason } 2956 2957 // Cause function returns cause value. 2958 func (e FilterConfigValidationError) Cause() error { return e.cause } 2959 2960 // Key function returns key value. 2961 func (e FilterConfigValidationError) Key() bool { return e.key } 2962 2963 // ErrorName returns error name. 2964 func (e FilterConfigValidationError) ErrorName() string { return "FilterConfigValidationError" } 2965 2966 // Error satisfies the builtin error interface 2967 func (e FilterConfigValidationError) Error() string { 2968 cause := "" 2969 if e.cause != nil { 2970 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2971 } 2972 2973 key := "" 2974 if e.key { 2975 key = "key for " 2976 } 2977 2978 return fmt.Sprintf( 2979 "invalid %sFilterConfig.%s: %s%s", 2980 key, 2981 e.field, 2982 e.reason, 2983 cause) 2984 } 2985 2986 var _ error = FilterConfigValidationError{} 2987 2988 var _ interface { 2989 Field() string 2990 Reason() string 2991 Key() bool 2992 Cause() error 2993 ErrorName() string 2994 } = FilterConfigValidationError{} 2995 2996 // Validate checks the field values on WeightedCluster_ClusterWeight with the 2997 // rules defined in the proto definition for this message. If any rules are 2998 // violated, an error is returned. 2999 func (m *WeightedCluster_ClusterWeight) Validate() error { 3000 if m == nil { 3001 return nil 3002 } 3003 3004 // no validation rules for Name 3005 3006 if !_WeightedCluster_ClusterWeight_ClusterHeader_Pattern.MatchString(m.GetClusterHeader()) { 3007 return WeightedCluster_ClusterWeightValidationError{ 3008 field: "ClusterHeader", 3009 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3010 } 3011 } 3012 3013 if v, ok := interface{}(m.GetWeight()).(interface{ Validate() error }); ok { 3014 if err := v.Validate(); err != nil { 3015 return WeightedCluster_ClusterWeightValidationError{ 3016 field: "Weight", 3017 reason: "embedded message failed validation", 3018 cause: err, 3019 } 3020 } 3021 } 3022 3023 if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { 3024 if err := v.Validate(); err != nil { 3025 return WeightedCluster_ClusterWeightValidationError{ 3026 field: "MetadataMatch", 3027 reason: "embedded message failed validation", 3028 cause: err, 3029 } 3030 } 3031 } 3032 3033 if len(m.GetRequestHeadersToAdd()) > 1000 { 3034 return WeightedCluster_ClusterWeightValidationError{ 3035 field: "RequestHeadersToAdd", 3036 reason: "value must contain no more than 1000 item(s)", 3037 } 3038 } 3039 3040 for idx, item := range m.GetRequestHeadersToAdd() { 3041 _, _ = idx, item 3042 3043 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 3044 if err := v.Validate(); err != nil { 3045 return WeightedCluster_ClusterWeightValidationError{ 3046 field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), 3047 reason: "embedded message failed validation", 3048 cause: err, 3049 } 3050 } 3051 } 3052 3053 } 3054 3055 for idx, item := range m.GetRequestHeadersToRemove() { 3056 _, _ = idx, item 3057 3058 if !_WeightedCluster_ClusterWeight_RequestHeadersToRemove_Pattern.MatchString(item) { 3059 return WeightedCluster_ClusterWeightValidationError{ 3060 field: fmt.Sprintf("RequestHeadersToRemove[%v]", idx), 3061 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3062 } 3063 } 3064 3065 } 3066 3067 if len(m.GetResponseHeadersToAdd()) > 1000 { 3068 return WeightedCluster_ClusterWeightValidationError{ 3069 field: "ResponseHeadersToAdd", 3070 reason: "value must contain no more than 1000 item(s)", 3071 } 3072 } 3073 3074 for idx, item := range m.GetResponseHeadersToAdd() { 3075 _, _ = idx, item 3076 3077 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 3078 if err := v.Validate(); err != nil { 3079 return WeightedCluster_ClusterWeightValidationError{ 3080 field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), 3081 reason: "embedded message failed validation", 3082 cause: err, 3083 } 3084 } 3085 } 3086 3087 } 3088 3089 for idx, item := range m.GetResponseHeadersToRemove() { 3090 _, _ = idx, item 3091 3092 if !_WeightedCluster_ClusterWeight_ResponseHeadersToRemove_Pattern.MatchString(item) { 3093 return WeightedCluster_ClusterWeightValidationError{ 3094 field: fmt.Sprintf("ResponseHeadersToRemove[%v]", idx), 3095 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3096 } 3097 } 3098 3099 } 3100 3101 for key, val := range m.GetTypedPerFilterConfig() { 3102 _ = val 3103 3104 // no validation rules for TypedPerFilterConfig[key] 3105 3106 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 3107 if err := v.Validate(); err != nil { 3108 return WeightedCluster_ClusterWeightValidationError{ 3109 field: fmt.Sprintf("TypedPerFilterConfig[%v]", key), 3110 reason: "embedded message failed validation", 3111 cause: err, 3112 } 3113 } 3114 } 3115 3116 } 3117 3118 for key, val := range m.GetHiddenEnvoyDeprecatedPerFilterConfig() { 3119 _ = val 3120 3121 // no validation rules for HiddenEnvoyDeprecatedPerFilterConfig[key] 3122 3123 if v, ok := interface{}(val).(interface{ Validate() error }); ok { 3124 if err := v.Validate(); err != nil { 3125 return WeightedCluster_ClusterWeightValidationError{ 3126 field: fmt.Sprintf("HiddenEnvoyDeprecatedPerFilterConfig[%v]", key), 3127 reason: "embedded message failed validation", 3128 cause: err, 3129 } 3130 } 3131 } 3132 3133 } 3134 3135 switch m.HostRewriteSpecifier.(type) { 3136 3137 case *WeightedCluster_ClusterWeight_HostRewriteLiteral: 3138 3139 if !_WeightedCluster_ClusterWeight_HostRewriteLiteral_Pattern.MatchString(m.GetHostRewriteLiteral()) { 3140 return WeightedCluster_ClusterWeightValidationError{ 3141 field: "HostRewriteLiteral", 3142 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3143 } 3144 } 3145 3146 } 3147 3148 return nil 3149 } 3150 3151 // WeightedCluster_ClusterWeightValidationError is the validation error 3152 // returned by WeightedCluster_ClusterWeight.Validate if the designated 3153 // constraints aren't met. 3154 type WeightedCluster_ClusterWeightValidationError struct { 3155 field string 3156 reason string 3157 cause error 3158 key bool 3159 } 3160 3161 // Field function returns field value. 3162 func (e WeightedCluster_ClusterWeightValidationError) Field() string { return e.field } 3163 3164 // Reason function returns reason value. 3165 func (e WeightedCluster_ClusterWeightValidationError) Reason() string { return e.reason } 3166 3167 // Cause function returns cause value. 3168 func (e WeightedCluster_ClusterWeightValidationError) Cause() error { return e.cause } 3169 3170 // Key function returns key value. 3171 func (e WeightedCluster_ClusterWeightValidationError) Key() bool { return e.key } 3172 3173 // ErrorName returns error name. 3174 func (e WeightedCluster_ClusterWeightValidationError) ErrorName() string { 3175 return "WeightedCluster_ClusterWeightValidationError" 3176 } 3177 3178 // Error satisfies the builtin error interface 3179 func (e WeightedCluster_ClusterWeightValidationError) Error() string { 3180 cause := "" 3181 if e.cause != nil { 3182 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3183 } 3184 3185 key := "" 3186 if e.key { 3187 key = "key for " 3188 } 3189 3190 return fmt.Sprintf( 3191 "invalid %sWeightedCluster_ClusterWeight.%s: %s%s", 3192 key, 3193 e.field, 3194 e.reason, 3195 cause) 3196 } 3197 3198 var _ error = WeightedCluster_ClusterWeightValidationError{} 3199 3200 var _ interface { 3201 Field() string 3202 Reason() string 3203 Key() bool 3204 Cause() error 3205 ErrorName() string 3206 } = WeightedCluster_ClusterWeightValidationError{} 3207 3208 var _WeightedCluster_ClusterWeight_ClusterHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3209 3210 var _WeightedCluster_ClusterWeight_RequestHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3211 3212 var _WeightedCluster_ClusterWeight_ResponseHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3213 3214 var _WeightedCluster_ClusterWeight_HostRewriteLiteral_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3215 3216 // Validate checks the field values on RouteMatch_GrpcRouteMatchOptions with 3217 // the rules defined in the proto definition for this message. If any rules 3218 // are violated, an error is returned. 3219 func (m *RouteMatch_GrpcRouteMatchOptions) Validate() error { 3220 if m == nil { 3221 return nil 3222 } 3223 3224 return nil 3225 } 3226 3227 // RouteMatch_GrpcRouteMatchOptionsValidationError is the validation error 3228 // returned by RouteMatch_GrpcRouteMatchOptions.Validate if the designated 3229 // constraints aren't met. 3230 type RouteMatch_GrpcRouteMatchOptionsValidationError struct { 3231 field string 3232 reason string 3233 cause error 3234 key bool 3235 } 3236 3237 // Field function returns field value. 3238 func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Field() string { return e.field } 3239 3240 // Reason function returns reason value. 3241 func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Reason() string { return e.reason } 3242 3243 // Cause function returns cause value. 3244 func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Cause() error { return e.cause } 3245 3246 // Key function returns key value. 3247 func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Key() bool { return e.key } 3248 3249 // ErrorName returns error name. 3250 func (e RouteMatch_GrpcRouteMatchOptionsValidationError) ErrorName() string { 3251 return "RouteMatch_GrpcRouteMatchOptionsValidationError" 3252 } 3253 3254 // Error satisfies the builtin error interface 3255 func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Error() string { 3256 cause := "" 3257 if e.cause != nil { 3258 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3259 } 3260 3261 key := "" 3262 if e.key { 3263 key = "key for " 3264 } 3265 3266 return fmt.Sprintf( 3267 "invalid %sRouteMatch_GrpcRouteMatchOptions.%s: %s%s", 3268 key, 3269 e.field, 3270 e.reason, 3271 cause) 3272 } 3273 3274 var _ error = RouteMatch_GrpcRouteMatchOptionsValidationError{} 3275 3276 var _ interface { 3277 Field() string 3278 Reason() string 3279 Key() bool 3280 Cause() error 3281 ErrorName() string 3282 } = RouteMatch_GrpcRouteMatchOptionsValidationError{} 3283 3284 // Validate checks the field values on RouteMatch_TlsContextMatchOptions with 3285 // the rules defined in the proto definition for this message. If any rules 3286 // are violated, an error is returned. 3287 func (m *RouteMatch_TlsContextMatchOptions) Validate() error { 3288 if m == nil { 3289 return nil 3290 } 3291 3292 if v, ok := interface{}(m.GetPresented()).(interface{ Validate() error }); ok { 3293 if err := v.Validate(); err != nil { 3294 return RouteMatch_TlsContextMatchOptionsValidationError{ 3295 field: "Presented", 3296 reason: "embedded message failed validation", 3297 cause: err, 3298 } 3299 } 3300 } 3301 3302 if v, ok := interface{}(m.GetValidated()).(interface{ Validate() error }); ok { 3303 if err := v.Validate(); err != nil { 3304 return RouteMatch_TlsContextMatchOptionsValidationError{ 3305 field: "Validated", 3306 reason: "embedded message failed validation", 3307 cause: err, 3308 } 3309 } 3310 } 3311 3312 return nil 3313 } 3314 3315 // RouteMatch_TlsContextMatchOptionsValidationError is the validation error 3316 // returned by RouteMatch_TlsContextMatchOptions.Validate if the designated 3317 // constraints aren't met. 3318 type RouteMatch_TlsContextMatchOptionsValidationError struct { 3319 field string 3320 reason string 3321 cause error 3322 key bool 3323 } 3324 3325 // Field function returns field value. 3326 func (e RouteMatch_TlsContextMatchOptionsValidationError) Field() string { return e.field } 3327 3328 // Reason function returns reason value. 3329 func (e RouteMatch_TlsContextMatchOptionsValidationError) Reason() string { return e.reason } 3330 3331 // Cause function returns cause value. 3332 func (e RouteMatch_TlsContextMatchOptionsValidationError) Cause() error { return e.cause } 3333 3334 // Key function returns key value. 3335 func (e RouteMatch_TlsContextMatchOptionsValidationError) Key() bool { return e.key } 3336 3337 // ErrorName returns error name. 3338 func (e RouteMatch_TlsContextMatchOptionsValidationError) ErrorName() string { 3339 return "RouteMatch_TlsContextMatchOptionsValidationError" 3340 } 3341 3342 // Error satisfies the builtin error interface 3343 func (e RouteMatch_TlsContextMatchOptionsValidationError) Error() string { 3344 cause := "" 3345 if e.cause != nil { 3346 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3347 } 3348 3349 key := "" 3350 if e.key { 3351 key = "key for " 3352 } 3353 3354 return fmt.Sprintf( 3355 "invalid %sRouteMatch_TlsContextMatchOptions.%s: %s%s", 3356 key, 3357 e.field, 3358 e.reason, 3359 cause) 3360 } 3361 3362 var _ error = RouteMatch_TlsContextMatchOptionsValidationError{} 3363 3364 var _ interface { 3365 Field() string 3366 Reason() string 3367 Key() bool 3368 Cause() error 3369 ErrorName() string 3370 } = RouteMatch_TlsContextMatchOptionsValidationError{} 3371 3372 // Validate checks the field values on RouteMatch_ConnectMatcher with the rules 3373 // defined in the proto definition for this message. If any rules are 3374 // violated, an error is returned. 3375 func (m *RouteMatch_ConnectMatcher) Validate() error { 3376 if m == nil { 3377 return nil 3378 } 3379 3380 return nil 3381 } 3382 3383 // RouteMatch_ConnectMatcherValidationError is the validation error returned by 3384 // RouteMatch_ConnectMatcher.Validate if the designated constraints aren't met. 3385 type RouteMatch_ConnectMatcherValidationError struct { 3386 field string 3387 reason string 3388 cause error 3389 key bool 3390 } 3391 3392 // Field function returns field value. 3393 func (e RouteMatch_ConnectMatcherValidationError) Field() string { return e.field } 3394 3395 // Reason function returns reason value. 3396 func (e RouteMatch_ConnectMatcherValidationError) Reason() string { return e.reason } 3397 3398 // Cause function returns cause value. 3399 func (e RouteMatch_ConnectMatcherValidationError) Cause() error { return e.cause } 3400 3401 // Key function returns key value. 3402 func (e RouteMatch_ConnectMatcherValidationError) Key() bool { return e.key } 3403 3404 // ErrorName returns error name. 3405 func (e RouteMatch_ConnectMatcherValidationError) ErrorName() string { 3406 return "RouteMatch_ConnectMatcherValidationError" 3407 } 3408 3409 // Error satisfies the builtin error interface 3410 func (e RouteMatch_ConnectMatcherValidationError) Error() string { 3411 cause := "" 3412 if e.cause != nil { 3413 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3414 } 3415 3416 key := "" 3417 if e.key { 3418 key = "key for " 3419 } 3420 3421 return fmt.Sprintf( 3422 "invalid %sRouteMatch_ConnectMatcher.%s: %s%s", 3423 key, 3424 e.field, 3425 e.reason, 3426 cause) 3427 } 3428 3429 var _ error = RouteMatch_ConnectMatcherValidationError{} 3430 3431 var _ interface { 3432 Field() string 3433 Reason() string 3434 Key() bool 3435 Cause() error 3436 ErrorName() string 3437 } = RouteMatch_ConnectMatcherValidationError{} 3438 3439 // Validate checks the field values on RouteAction_RequestMirrorPolicy with the 3440 // rules defined in the proto definition for this message. If any rules are 3441 // violated, an error is returned. 3442 func (m *RouteAction_RequestMirrorPolicy) Validate() error { 3443 if m == nil { 3444 return nil 3445 } 3446 3447 if utf8.RuneCountInString(m.GetCluster()) < 1 { 3448 return RouteAction_RequestMirrorPolicyValidationError{ 3449 field: "Cluster", 3450 reason: "value length must be at least 1 runes", 3451 } 3452 } 3453 3454 if v, ok := interface{}(m.GetRuntimeFraction()).(interface{ Validate() error }); ok { 3455 if err := v.Validate(); err != nil { 3456 return RouteAction_RequestMirrorPolicyValidationError{ 3457 field: "RuntimeFraction", 3458 reason: "embedded message failed validation", 3459 cause: err, 3460 } 3461 } 3462 } 3463 3464 if v, ok := interface{}(m.GetTraceSampled()).(interface{ Validate() error }); ok { 3465 if err := v.Validate(); err != nil { 3466 return RouteAction_RequestMirrorPolicyValidationError{ 3467 field: "TraceSampled", 3468 reason: "embedded message failed validation", 3469 cause: err, 3470 } 3471 } 3472 } 3473 3474 // no validation rules for HiddenEnvoyDeprecatedRuntimeKey 3475 3476 return nil 3477 } 3478 3479 // RouteAction_RequestMirrorPolicyValidationError is the validation error 3480 // returned by RouteAction_RequestMirrorPolicy.Validate if the designated 3481 // constraints aren't met. 3482 type RouteAction_RequestMirrorPolicyValidationError struct { 3483 field string 3484 reason string 3485 cause error 3486 key bool 3487 } 3488 3489 // Field function returns field value. 3490 func (e RouteAction_RequestMirrorPolicyValidationError) Field() string { return e.field } 3491 3492 // Reason function returns reason value. 3493 func (e RouteAction_RequestMirrorPolicyValidationError) Reason() string { return e.reason } 3494 3495 // Cause function returns cause value. 3496 func (e RouteAction_RequestMirrorPolicyValidationError) Cause() error { return e.cause } 3497 3498 // Key function returns key value. 3499 func (e RouteAction_RequestMirrorPolicyValidationError) Key() bool { return e.key } 3500 3501 // ErrorName returns error name. 3502 func (e RouteAction_RequestMirrorPolicyValidationError) ErrorName() string { 3503 return "RouteAction_RequestMirrorPolicyValidationError" 3504 } 3505 3506 // Error satisfies the builtin error interface 3507 func (e RouteAction_RequestMirrorPolicyValidationError) Error() string { 3508 cause := "" 3509 if e.cause != nil { 3510 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3511 } 3512 3513 key := "" 3514 if e.key { 3515 key = "key for " 3516 } 3517 3518 return fmt.Sprintf( 3519 "invalid %sRouteAction_RequestMirrorPolicy.%s: %s%s", 3520 key, 3521 e.field, 3522 e.reason, 3523 cause) 3524 } 3525 3526 var _ error = RouteAction_RequestMirrorPolicyValidationError{} 3527 3528 var _ interface { 3529 Field() string 3530 Reason() string 3531 Key() bool 3532 Cause() error 3533 ErrorName() string 3534 } = RouteAction_RequestMirrorPolicyValidationError{} 3535 3536 // Validate checks the field values on RouteAction_HashPolicy with the rules 3537 // defined in the proto definition for this message. If any rules are 3538 // violated, an error is returned. 3539 func (m *RouteAction_HashPolicy) Validate() error { 3540 if m == nil { 3541 return nil 3542 } 3543 3544 // no validation rules for Terminal 3545 3546 switch m.PolicySpecifier.(type) { 3547 3548 case *RouteAction_HashPolicy_Header_: 3549 3550 if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok { 3551 if err := v.Validate(); err != nil { 3552 return RouteAction_HashPolicyValidationError{ 3553 field: "Header", 3554 reason: "embedded message failed validation", 3555 cause: err, 3556 } 3557 } 3558 } 3559 3560 case *RouteAction_HashPolicy_Cookie_: 3561 3562 if v, ok := interface{}(m.GetCookie()).(interface{ Validate() error }); ok { 3563 if err := v.Validate(); err != nil { 3564 return RouteAction_HashPolicyValidationError{ 3565 field: "Cookie", 3566 reason: "embedded message failed validation", 3567 cause: err, 3568 } 3569 } 3570 } 3571 3572 case *RouteAction_HashPolicy_ConnectionProperties_: 3573 3574 if v, ok := interface{}(m.GetConnectionProperties()).(interface{ Validate() error }); ok { 3575 if err := v.Validate(); err != nil { 3576 return RouteAction_HashPolicyValidationError{ 3577 field: "ConnectionProperties", 3578 reason: "embedded message failed validation", 3579 cause: err, 3580 } 3581 } 3582 } 3583 3584 case *RouteAction_HashPolicy_QueryParameter_: 3585 3586 if v, ok := interface{}(m.GetQueryParameter()).(interface{ Validate() error }); ok { 3587 if err := v.Validate(); err != nil { 3588 return RouteAction_HashPolicyValidationError{ 3589 field: "QueryParameter", 3590 reason: "embedded message failed validation", 3591 cause: err, 3592 } 3593 } 3594 } 3595 3596 case *RouteAction_HashPolicy_FilterState_: 3597 3598 if v, ok := interface{}(m.GetFilterState()).(interface{ Validate() error }); ok { 3599 if err := v.Validate(); err != nil { 3600 return RouteAction_HashPolicyValidationError{ 3601 field: "FilterState", 3602 reason: "embedded message failed validation", 3603 cause: err, 3604 } 3605 } 3606 } 3607 3608 default: 3609 return RouteAction_HashPolicyValidationError{ 3610 field: "PolicySpecifier", 3611 reason: "value is required", 3612 } 3613 3614 } 3615 3616 return nil 3617 } 3618 3619 // RouteAction_HashPolicyValidationError is the validation error returned by 3620 // RouteAction_HashPolicy.Validate if the designated constraints aren't met. 3621 type RouteAction_HashPolicyValidationError struct { 3622 field string 3623 reason string 3624 cause error 3625 key bool 3626 } 3627 3628 // Field function returns field value. 3629 func (e RouteAction_HashPolicyValidationError) Field() string { return e.field } 3630 3631 // Reason function returns reason value. 3632 func (e RouteAction_HashPolicyValidationError) Reason() string { return e.reason } 3633 3634 // Cause function returns cause value. 3635 func (e RouteAction_HashPolicyValidationError) Cause() error { return e.cause } 3636 3637 // Key function returns key value. 3638 func (e RouteAction_HashPolicyValidationError) Key() bool { return e.key } 3639 3640 // ErrorName returns error name. 3641 func (e RouteAction_HashPolicyValidationError) ErrorName() string { 3642 return "RouteAction_HashPolicyValidationError" 3643 } 3644 3645 // Error satisfies the builtin error interface 3646 func (e RouteAction_HashPolicyValidationError) Error() string { 3647 cause := "" 3648 if e.cause != nil { 3649 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3650 } 3651 3652 key := "" 3653 if e.key { 3654 key = "key for " 3655 } 3656 3657 return fmt.Sprintf( 3658 "invalid %sRouteAction_HashPolicy.%s: %s%s", 3659 key, 3660 e.field, 3661 e.reason, 3662 cause) 3663 } 3664 3665 var _ error = RouteAction_HashPolicyValidationError{} 3666 3667 var _ interface { 3668 Field() string 3669 Reason() string 3670 Key() bool 3671 Cause() error 3672 ErrorName() string 3673 } = RouteAction_HashPolicyValidationError{} 3674 3675 // Validate checks the field values on RouteAction_UpgradeConfig with the rules 3676 // defined in the proto definition for this message. If any rules are 3677 // violated, an error is returned. 3678 func (m *RouteAction_UpgradeConfig) Validate() error { 3679 if m == nil { 3680 return nil 3681 } 3682 3683 if utf8.RuneCountInString(m.GetUpgradeType()) < 1 { 3684 return RouteAction_UpgradeConfigValidationError{ 3685 field: "UpgradeType", 3686 reason: "value length must be at least 1 runes", 3687 } 3688 } 3689 3690 if !_RouteAction_UpgradeConfig_UpgradeType_Pattern.MatchString(m.GetUpgradeType()) { 3691 return RouteAction_UpgradeConfigValidationError{ 3692 field: "UpgradeType", 3693 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3694 } 3695 } 3696 3697 if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok { 3698 if err := v.Validate(); err != nil { 3699 return RouteAction_UpgradeConfigValidationError{ 3700 field: "Enabled", 3701 reason: "embedded message failed validation", 3702 cause: err, 3703 } 3704 } 3705 } 3706 3707 if v, ok := interface{}(m.GetConnectConfig()).(interface{ Validate() error }); ok { 3708 if err := v.Validate(); err != nil { 3709 return RouteAction_UpgradeConfigValidationError{ 3710 field: "ConnectConfig", 3711 reason: "embedded message failed validation", 3712 cause: err, 3713 } 3714 } 3715 } 3716 3717 return nil 3718 } 3719 3720 // RouteAction_UpgradeConfigValidationError is the validation error returned by 3721 // RouteAction_UpgradeConfig.Validate if the designated constraints aren't met. 3722 type RouteAction_UpgradeConfigValidationError struct { 3723 field string 3724 reason string 3725 cause error 3726 key bool 3727 } 3728 3729 // Field function returns field value. 3730 func (e RouteAction_UpgradeConfigValidationError) Field() string { return e.field } 3731 3732 // Reason function returns reason value. 3733 func (e RouteAction_UpgradeConfigValidationError) Reason() string { return e.reason } 3734 3735 // Cause function returns cause value. 3736 func (e RouteAction_UpgradeConfigValidationError) Cause() error { return e.cause } 3737 3738 // Key function returns key value. 3739 func (e RouteAction_UpgradeConfigValidationError) Key() bool { return e.key } 3740 3741 // ErrorName returns error name. 3742 func (e RouteAction_UpgradeConfigValidationError) ErrorName() string { 3743 return "RouteAction_UpgradeConfigValidationError" 3744 } 3745 3746 // Error satisfies the builtin error interface 3747 func (e RouteAction_UpgradeConfigValidationError) Error() string { 3748 cause := "" 3749 if e.cause != nil { 3750 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3751 } 3752 3753 key := "" 3754 if e.key { 3755 key = "key for " 3756 } 3757 3758 return fmt.Sprintf( 3759 "invalid %sRouteAction_UpgradeConfig.%s: %s%s", 3760 key, 3761 e.field, 3762 e.reason, 3763 cause) 3764 } 3765 3766 var _ error = RouteAction_UpgradeConfigValidationError{} 3767 3768 var _ interface { 3769 Field() string 3770 Reason() string 3771 Key() bool 3772 Cause() error 3773 ErrorName() string 3774 } = RouteAction_UpgradeConfigValidationError{} 3775 3776 var _RouteAction_UpgradeConfig_UpgradeType_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3777 3778 // Validate checks the field values on RouteAction_MaxStreamDuration with the 3779 // rules defined in the proto definition for this message. If any rules are 3780 // violated, an error is returned. 3781 func (m *RouteAction_MaxStreamDuration) Validate() error { 3782 if m == nil { 3783 return nil 3784 } 3785 3786 if v, ok := interface{}(m.GetMaxStreamDuration()).(interface{ Validate() error }); ok { 3787 if err := v.Validate(); err != nil { 3788 return RouteAction_MaxStreamDurationValidationError{ 3789 field: "MaxStreamDuration", 3790 reason: "embedded message failed validation", 3791 cause: err, 3792 } 3793 } 3794 } 3795 3796 if v, ok := interface{}(m.GetGrpcTimeoutHeaderMax()).(interface{ Validate() error }); ok { 3797 if err := v.Validate(); err != nil { 3798 return RouteAction_MaxStreamDurationValidationError{ 3799 field: "GrpcTimeoutHeaderMax", 3800 reason: "embedded message failed validation", 3801 cause: err, 3802 } 3803 } 3804 } 3805 3806 if v, ok := interface{}(m.GetGrpcTimeoutHeaderOffset()).(interface{ Validate() error }); ok { 3807 if err := v.Validate(); err != nil { 3808 return RouteAction_MaxStreamDurationValidationError{ 3809 field: "GrpcTimeoutHeaderOffset", 3810 reason: "embedded message failed validation", 3811 cause: err, 3812 } 3813 } 3814 } 3815 3816 return nil 3817 } 3818 3819 // RouteAction_MaxStreamDurationValidationError is the validation error 3820 // returned by RouteAction_MaxStreamDuration.Validate if the designated 3821 // constraints aren't met. 3822 type RouteAction_MaxStreamDurationValidationError struct { 3823 field string 3824 reason string 3825 cause error 3826 key bool 3827 } 3828 3829 // Field function returns field value. 3830 func (e RouteAction_MaxStreamDurationValidationError) Field() string { return e.field } 3831 3832 // Reason function returns reason value. 3833 func (e RouteAction_MaxStreamDurationValidationError) Reason() string { return e.reason } 3834 3835 // Cause function returns cause value. 3836 func (e RouteAction_MaxStreamDurationValidationError) Cause() error { return e.cause } 3837 3838 // Key function returns key value. 3839 func (e RouteAction_MaxStreamDurationValidationError) Key() bool { return e.key } 3840 3841 // ErrorName returns error name. 3842 func (e RouteAction_MaxStreamDurationValidationError) ErrorName() string { 3843 return "RouteAction_MaxStreamDurationValidationError" 3844 } 3845 3846 // Error satisfies the builtin error interface 3847 func (e RouteAction_MaxStreamDurationValidationError) Error() string { 3848 cause := "" 3849 if e.cause != nil { 3850 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3851 } 3852 3853 key := "" 3854 if e.key { 3855 key = "key for " 3856 } 3857 3858 return fmt.Sprintf( 3859 "invalid %sRouteAction_MaxStreamDuration.%s: %s%s", 3860 key, 3861 e.field, 3862 e.reason, 3863 cause) 3864 } 3865 3866 var _ error = RouteAction_MaxStreamDurationValidationError{} 3867 3868 var _ interface { 3869 Field() string 3870 Reason() string 3871 Key() bool 3872 Cause() error 3873 ErrorName() string 3874 } = RouteAction_MaxStreamDurationValidationError{} 3875 3876 // Validate checks the field values on RouteAction_HashPolicy_Header with the 3877 // rules defined in the proto definition for this message. If any rules are 3878 // violated, an error is returned. 3879 func (m *RouteAction_HashPolicy_Header) Validate() error { 3880 if m == nil { 3881 return nil 3882 } 3883 3884 if utf8.RuneCountInString(m.GetHeaderName()) < 1 { 3885 return RouteAction_HashPolicy_HeaderValidationError{ 3886 field: "HeaderName", 3887 reason: "value length must be at least 1 runes", 3888 } 3889 } 3890 3891 if !_RouteAction_HashPolicy_Header_HeaderName_Pattern.MatchString(m.GetHeaderName()) { 3892 return RouteAction_HashPolicy_HeaderValidationError{ 3893 field: "HeaderName", 3894 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 3895 } 3896 } 3897 3898 if v, ok := interface{}(m.GetRegexRewrite()).(interface{ Validate() error }); ok { 3899 if err := v.Validate(); err != nil { 3900 return RouteAction_HashPolicy_HeaderValidationError{ 3901 field: "RegexRewrite", 3902 reason: "embedded message failed validation", 3903 cause: err, 3904 } 3905 } 3906 } 3907 3908 return nil 3909 } 3910 3911 // RouteAction_HashPolicy_HeaderValidationError is the validation error 3912 // returned by RouteAction_HashPolicy_Header.Validate if the designated 3913 // constraints aren't met. 3914 type RouteAction_HashPolicy_HeaderValidationError struct { 3915 field string 3916 reason string 3917 cause error 3918 key bool 3919 } 3920 3921 // Field function returns field value. 3922 func (e RouteAction_HashPolicy_HeaderValidationError) Field() string { return e.field } 3923 3924 // Reason function returns reason value. 3925 func (e RouteAction_HashPolicy_HeaderValidationError) Reason() string { return e.reason } 3926 3927 // Cause function returns cause value. 3928 func (e RouteAction_HashPolicy_HeaderValidationError) Cause() error { return e.cause } 3929 3930 // Key function returns key value. 3931 func (e RouteAction_HashPolicy_HeaderValidationError) Key() bool { return e.key } 3932 3933 // ErrorName returns error name. 3934 func (e RouteAction_HashPolicy_HeaderValidationError) ErrorName() string { 3935 return "RouteAction_HashPolicy_HeaderValidationError" 3936 } 3937 3938 // Error satisfies the builtin error interface 3939 func (e RouteAction_HashPolicy_HeaderValidationError) Error() string { 3940 cause := "" 3941 if e.cause != nil { 3942 cause = fmt.Sprintf(" | caused by: %v", e.cause) 3943 } 3944 3945 key := "" 3946 if e.key { 3947 key = "key for " 3948 } 3949 3950 return fmt.Sprintf( 3951 "invalid %sRouteAction_HashPolicy_Header.%s: %s%s", 3952 key, 3953 e.field, 3954 e.reason, 3955 cause) 3956 } 3957 3958 var _ error = RouteAction_HashPolicy_HeaderValidationError{} 3959 3960 var _ interface { 3961 Field() string 3962 Reason() string 3963 Key() bool 3964 Cause() error 3965 ErrorName() string 3966 } = RouteAction_HashPolicy_HeaderValidationError{} 3967 3968 var _RouteAction_HashPolicy_Header_HeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 3969 3970 // Validate checks the field values on RouteAction_HashPolicy_Cookie with the 3971 // rules defined in the proto definition for this message. If any rules are 3972 // violated, an error is returned. 3973 func (m *RouteAction_HashPolicy_Cookie) Validate() error { 3974 if m == nil { 3975 return nil 3976 } 3977 3978 if utf8.RuneCountInString(m.GetName()) < 1 { 3979 return RouteAction_HashPolicy_CookieValidationError{ 3980 field: "Name", 3981 reason: "value length must be at least 1 runes", 3982 } 3983 } 3984 3985 if v, ok := interface{}(m.GetTtl()).(interface{ Validate() error }); ok { 3986 if err := v.Validate(); err != nil { 3987 return RouteAction_HashPolicy_CookieValidationError{ 3988 field: "Ttl", 3989 reason: "embedded message failed validation", 3990 cause: err, 3991 } 3992 } 3993 } 3994 3995 // no validation rules for Path 3996 3997 return nil 3998 } 3999 4000 // RouteAction_HashPolicy_CookieValidationError is the validation error 4001 // returned by RouteAction_HashPolicy_Cookie.Validate if the designated 4002 // constraints aren't met. 4003 type RouteAction_HashPolicy_CookieValidationError struct { 4004 field string 4005 reason string 4006 cause error 4007 key bool 4008 } 4009 4010 // Field function returns field value. 4011 func (e RouteAction_HashPolicy_CookieValidationError) Field() string { return e.field } 4012 4013 // Reason function returns reason value. 4014 func (e RouteAction_HashPolicy_CookieValidationError) Reason() string { return e.reason } 4015 4016 // Cause function returns cause value. 4017 func (e RouteAction_HashPolicy_CookieValidationError) Cause() error { return e.cause } 4018 4019 // Key function returns key value. 4020 func (e RouteAction_HashPolicy_CookieValidationError) Key() bool { return e.key } 4021 4022 // ErrorName returns error name. 4023 func (e RouteAction_HashPolicy_CookieValidationError) ErrorName() string { 4024 return "RouteAction_HashPolicy_CookieValidationError" 4025 } 4026 4027 // Error satisfies the builtin error interface 4028 func (e RouteAction_HashPolicy_CookieValidationError) Error() string { 4029 cause := "" 4030 if e.cause != nil { 4031 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4032 } 4033 4034 key := "" 4035 if e.key { 4036 key = "key for " 4037 } 4038 4039 return fmt.Sprintf( 4040 "invalid %sRouteAction_HashPolicy_Cookie.%s: %s%s", 4041 key, 4042 e.field, 4043 e.reason, 4044 cause) 4045 } 4046 4047 var _ error = RouteAction_HashPolicy_CookieValidationError{} 4048 4049 var _ interface { 4050 Field() string 4051 Reason() string 4052 Key() bool 4053 Cause() error 4054 ErrorName() string 4055 } = RouteAction_HashPolicy_CookieValidationError{} 4056 4057 // Validate checks the field values on 4058 // RouteAction_HashPolicy_ConnectionProperties with the rules defined in the 4059 // proto definition for this message. If any rules are violated, an error is returned. 4060 func (m *RouteAction_HashPolicy_ConnectionProperties) Validate() error { 4061 if m == nil { 4062 return nil 4063 } 4064 4065 // no validation rules for SourceIp 4066 4067 return nil 4068 } 4069 4070 // RouteAction_HashPolicy_ConnectionPropertiesValidationError is the validation 4071 // error returned by RouteAction_HashPolicy_ConnectionProperties.Validate if 4072 // the designated constraints aren't met. 4073 type RouteAction_HashPolicy_ConnectionPropertiesValidationError struct { 4074 field string 4075 reason string 4076 cause error 4077 key bool 4078 } 4079 4080 // Field function returns field value. 4081 func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Field() string { return e.field } 4082 4083 // Reason function returns reason value. 4084 func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Reason() string { return e.reason } 4085 4086 // Cause function returns cause value. 4087 func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Cause() error { return e.cause } 4088 4089 // Key function returns key value. 4090 func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Key() bool { return e.key } 4091 4092 // ErrorName returns error name. 4093 func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) ErrorName() string { 4094 return "RouteAction_HashPolicy_ConnectionPropertiesValidationError" 4095 } 4096 4097 // Error satisfies the builtin error interface 4098 func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Error() string { 4099 cause := "" 4100 if e.cause != nil { 4101 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4102 } 4103 4104 key := "" 4105 if e.key { 4106 key = "key for " 4107 } 4108 4109 return fmt.Sprintf( 4110 "invalid %sRouteAction_HashPolicy_ConnectionProperties.%s: %s%s", 4111 key, 4112 e.field, 4113 e.reason, 4114 cause) 4115 } 4116 4117 var _ error = RouteAction_HashPolicy_ConnectionPropertiesValidationError{} 4118 4119 var _ interface { 4120 Field() string 4121 Reason() string 4122 Key() bool 4123 Cause() error 4124 ErrorName() string 4125 } = RouteAction_HashPolicy_ConnectionPropertiesValidationError{} 4126 4127 // Validate checks the field values on RouteAction_HashPolicy_QueryParameter 4128 // with the rules defined in the proto definition for this message. If any 4129 // rules are violated, an error is returned. 4130 func (m *RouteAction_HashPolicy_QueryParameter) Validate() error { 4131 if m == nil { 4132 return nil 4133 } 4134 4135 if utf8.RuneCountInString(m.GetName()) < 1 { 4136 return RouteAction_HashPolicy_QueryParameterValidationError{ 4137 field: "Name", 4138 reason: "value length must be at least 1 runes", 4139 } 4140 } 4141 4142 return nil 4143 } 4144 4145 // RouteAction_HashPolicy_QueryParameterValidationError is the validation error 4146 // returned by RouteAction_HashPolicy_QueryParameter.Validate if the 4147 // designated constraints aren't met. 4148 type RouteAction_HashPolicy_QueryParameterValidationError struct { 4149 field string 4150 reason string 4151 cause error 4152 key bool 4153 } 4154 4155 // Field function returns field value. 4156 func (e RouteAction_HashPolicy_QueryParameterValidationError) Field() string { return e.field } 4157 4158 // Reason function returns reason value. 4159 func (e RouteAction_HashPolicy_QueryParameterValidationError) Reason() string { return e.reason } 4160 4161 // Cause function returns cause value. 4162 func (e RouteAction_HashPolicy_QueryParameterValidationError) Cause() error { return e.cause } 4163 4164 // Key function returns key value. 4165 func (e RouteAction_HashPolicy_QueryParameterValidationError) Key() bool { return e.key } 4166 4167 // ErrorName returns error name. 4168 func (e RouteAction_HashPolicy_QueryParameterValidationError) ErrorName() string { 4169 return "RouteAction_HashPolicy_QueryParameterValidationError" 4170 } 4171 4172 // Error satisfies the builtin error interface 4173 func (e RouteAction_HashPolicy_QueryParameterValidationError) Error() string { 4174 cause := "" 4175 if e.cause != nil { 4176 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4177 } 4178 4179 key := "" 4180 if e.key { 4181 key = "key for " 4182 } 4183 4184 return fmt.Sprintf( 4185 "invalid %sRouteAction_HashPolicy_QueryParameter.%s: %s%s", 4186 key, 4187 e.field, 4188 e.reason, 4189 cause) 4190 } 4191 4192 var _ error = RouteAction_HashPolicy_QueryParameterValidationError{} 4193 4194 var _ interface { 4195 Field() string 4196 Reason() string 4197 Key() bool 4198 Cause() error 4199 ErrorName() string 4200 } = RouteAction_HashPolicy_QueryParameterValidationError{} 4201 4202 // Validate checks the field values on RouteAction_HashPolicy_FilterState with 4203 // the rules defined in the proto definition for this message. If any rules 4204 // are violated, an error is returned. 4205 func (m *RouteAction_HashPolicy_FilterState) Validate() error { 4206 if m == nil { 4207 return nil 4208 } 4209 4210 if utf8.RuneCountInString(m.GetKey()) < 1 { 4211 return RouteAction_HashPolicy_FilterStateValidationError{ 4212 field: "Key", 4213 reason: "value length must be at least 1 runes", 4214 } 4215 } 4216 4217 return nil 4218 } 4219 4220 // RouteAction_HashPolicy_FilterStateValidationError is the validation error 4221 // returned by RouteAction_HashPolicy_FilterState.Validate if the designated 4222 // constraints aren't met. 4223 type RouteAction_HashPolicy_FilterStateValidationError struct { 4224 field string 4225 reason string 4226 cause error 4227 key bool 4228 } 4229 4230 // Field function returns field value. 4231 func (e RouteAction_HashPolicy_FilterStateValidationError) Field() string { return e.field } 4232 4233 // Reason function returns reason value. 4234 func (e RouteAction_HashPolicy_FilterStateValidationError) Reason() string { return e.reason } 4235 4236 // Cause function returns cause value. 4237 func (e RouteAction_HashPolicy_FilterStateValidationError) Cause() error { return e.cause } 4238 4239 // Key function returns key value. 4240 func (e RouteAction_HashPolicy_FilterStateValidationError) Key() bool { return e.key } 4241 4242 // ErrorName returns error name. 4243 func (e RouteAction_HashPolicy_FilterStateValidationError) ErrorName() string { 4244 return "RouteAction_HashPolicy_FilterStateValidationError" 4245 } 4246 4247 // Error satisfies the builtin error interface 4248 func (e RouteAction_HashPolicy_FilterStateValidationError) Error() string { 4249 cause := "" 4250 if e.cause != nil { 4251 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4252 } 4253 4254 key := "" 4255 if e.key { 4256 key = "key for " 4257 } 4258 4259 return fmt.Sprintf( 4260 "invalid %sRouteAction_HashPolicy_FilterState.%s: %s%s", 4261 key, 4262 e.field, 4263 e.reason, 4264 cause) 4265 } 4266 4267 var _ error = RouteAction_HashPolicy_FilterStateValidationError{} 4268 4269 var _ interface { 4270 Field() string 4271 Reason() string 4272 Key() bool 4273 Cause() error 4274 ErrorName() string 4275 } = RouteAction_HashPolicy_FilterStateValidationError{} 4276 4277 // Validate checks the field values on RouteAction_UpgradeConfig_ConnectConfig 4278 // with the rules defined in the proto definition for this message. If any 4279 // rules are violated, an error is returned. 4280 func (m *RouteAction_UpgradeConfig_ConnectConfig) Validate() error { 4281 if m == nil { 4282 return nil 4283 } 4284 4285 if v, ok := interface{}(m.GetProxyProtocolConfig()).(interface{ Validate() error }); ok { 4286 if err := v.Validate(); err != nil { 4287 return RouteAction_UpgradeConfig_ConnectConfigValidationError{ 4288 field: "ProxyProtocolConfig", 4289 reason: "embedded message failed validation", 4290 cause: err, 4291 } 4292 } 4293 } 4294 4295 // no validation rules for AllowPost 4296 4297 return nil 4298 } 4299 4300 // RouteAction_UpgradeConfig_ConnectConfigValidationError is the validation 4301 // error returned by RouteAction_UpgradeConfig_ConnectConfig.Validate if the 4302 // designated constraints aren't met. 4303 type RouteAction_UpgradeConfig_ConnectConfigValidationError struct { 4304 field string 4305 reason string 4306 cause error 4307 key bool 4308 } 4309 4310 // Field function returns field value. 4311 func (e RouteAction_UpgradeConfig_ConnectConfigValidationError) Field() string { return e.field } 4312 4313 // Reason function returns reason value. 4314 func (e RouteAction_UpgradeConfig_ConnectConfigValidationError) Reason() string { return e.reason } 4315 4316 // Cause function returns cause value. 4317 func (e RouteAction_UpgradeConfig_ConnectConfigValidationError) Cause() error { return e.cause } 4318 4319 // Key function returns key value. 4320 func (e RouteAction_UpgradeConfig_ConnectConfigValidationError) Key() bool { return e.key } 4321 4322 // ErrorName returns error name. 4323 func (e RouteAction_UpgradeConfig_ConnectConfigValidationError) ErrorName() string { 4324 return "RouteAction_UpgradeConfig_ConnectConfigValidationError" 4325 } 4326 4327 // Error satisfies the builtin error interface 4328 func (e RouteAction_UpgradeConfig_ConnectConfigValidationError) Error() string { 4329 cause := "" 4330 if e.cause != nil { 4331 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4332 } 4333 4334 key := "" 4335 if e.key { 4336 key = "key for " 4337 } 4338 4339 return fmt.Sprintf( 4340 "invalid %sRouteAction_UpgradeConfig_ConnectConfig.%s: %s%s", 4341 key, 4342 e.field, 4343 e.reason, 4344 cause) 4345 } 4346 4347 var _ error = RouteAction_UpgradeConfig_ConnectConfigValidationError{} 4348 4349 var _ interface { 4350 Field() string 4351 Reason() string 4352 Key() bool 4353 Cause() error 4354 ErrorName() string 4355 } = RouteAction_UpgradeConfig_ConnectConfigValidationError{} 4356 4357 // Validate checks the field values on RetryPolicy_RetryPriority with the rules 4358 // defined in the proto definition for this message. If any rules are 4359 // violated, an error is returned. 4360 func (m *RetryPolicy_RetryPriority) Validate() error { 4361 if m == nil { 4362 return nil 4363 } 4364 4365 if utf8.RuneCountInString(m.GetName()) < 1 { 4366 return RetryPolicy_RetryPriorityValidationError{ 4367 field: "Name", 4368 reason: "value length must be at least 1 runes", 4369 } 4370 } 4371 4372 switch m.ConfigType.(type) { 4373 4374 case *RetryPolicy_RetryPriority_TypedConfig: 4375 4376 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 4377 if err := v.Validate(); err != nil { 4378 return RetryPolicy_RetryPriorityValidationError{ 4379 field: "TypedConfig", 4380 reason: "embedded message failed validation", 4381 cause: err, 4382 } 4383 } 4384 } 4385 4386 case *RetryPolicy_RetryPriority_HiddenEnvoyDeprecatedConfig: 4387 4388 if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedConfig()).(interface{ Validate() error }); ok { 4389 if err := v.Validate(); err != nil { 4390 return RetryPolicy_RetryPriorityValidationError{ 4391 field: "HiddenEnvoyDeprecatedConfig", 4392 reason: "embedded message failed validation", 4393 cause: err, 4394 } 4395 } 4396 } 4397 4398 } 4399 4400 return nil 4401 } 4402 4403 // RetryPolicy_RetryPriorityValidationError is the validation error returned by 4404 // RetryPolicy_RetryPriority.Validate if the designated constraints aren't met. 4405 type RetryPolicy_RetryPriorityValidationError struct { 4406 field string 4407 reason string 4408 cause error 4409 key bool 4410 } 4411 4412 // Field function returns field value. 4413 func (e RetryPolicy_RetryPriorityValidationError) Field() string { return e.field } 4414 4415 // Reason function returns reason value. 4416 func (e RetryPolicy_RetryPriorityValidationError) Reason() string { return e.reason } 4417 4418 // Cause function returns cause value. 4419 func (e RetryPolicy_RetryPriorityValidationError) Cause() error { return e.cause } 4420 4421 // Key function returns key value. 4422 func (e RetryPolicy_RetryPriorityValidationError) Key() bool { return e.key } 4423 4424 // ErrorName returns error name. 4425 func (e RetryPolicy_RetryPriorityValidationError) ErrorName() string { 4426 return "RetryPolicy_RetryPriorityValidationError" 4427 } 4428 4429 // Error satisfies the builtin error interface 4430 func (e RetryPolicy_RetryPriorityValidationError) Error() string { 4431 cause := "" 4432 if e.cause != nil { 4433 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4434 } 4435 4436 key := "" 4437 if e.key { 4438 key = "key for " 4439 } 4440 4441 return fmt.Sprintf( 4442 "invalid %sRetryPolicy_RetryPriority.%s: %s%s", 4443 key, 4444 e.field, 4445 e.reason, 4446 cause) 4447 } 4448 4449 var _ error = RetryPolicy_RetryPriorityValidationError{} 4450 4451 var _ interface { 4452 Field() string 4453 Reason() string 4454 Key() bool 4455 Cause() error 4456 ErrorName() string 4457 } = RetryPolicy_RetryPriorityValidationError{} 4458 4459 // Validate checks the field values on RetryPolicy_RetryHostPredicate with the 4460 // rules defined in the proto definition for this message. If any rules are 4461 // violated, an error is returned. 4462 func (m *RetryPolicy_RetryHostPredicate) Validate() error { 4463 if m == nil { 4464 return nil 4465 } 4466 4467 if utf8.RuneCountInString(m.GetName()) < 1 { 4468 return RetryPolicy_RetryHostPredicateValidationError{ 4469 field: "Name", 4470 reason: "value length must be at least 1 runes", 4471 } 4472 } 4473 4474 switch m.ConfigType.(type) { 4475 4476 case *RetryPolicy_RetryHostPredicate_TypedConfig: 4477 4478 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 4479 if err := v.Validate(); err != nil { 4480 return RetryPolicy_RetryHostPredicateValidationError{ 4481 field: "TypedConfig", 4482 reason: "embedded message failed validation", 4483 cause: err, 4484 } 4485 } 4486 } 4487 4488 case *RetryPolicy_RetryHostPredicate_HiddenEnvoyDeprecatedConfig: 4489 4490 if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedConfig()).(interface{ Validate() error }); ok { 4491 if err := v.Validate(); err != nil { 4492 return RetryPolicy_RetryHostPredicateValidationError{ 4493 field: "HiddenEnvoyDeprecatedConfig", 4494 reason: "embedded message failed validation", 4495 cause: err, 4496 } 4497 } 4498 } 4499 4500 } 4501 4502 return nil 4503 } 4504 4505 // RetryPolicy_RetryHostPredicateValidationError is the validation error 4506 // returned by RetryPolicy_RetryHostPredicate.Validate if the designated 4507 // constraints aren't met. 4508 type RetryPolicy_RetryHostPredicateValidationError struct { 4509 field string 4510 reason string 4511 cause error 4512 key bool 4513 } 4514 4515 // Field function returns field value. 4516 func (e RetryPolicy_RetryHostPredicateValidationError) Field() string { return e.field } 4517 4518 // Reason function returns reason value. 4519 func (e RetryPolicy_RetryHostPredicateValidationError) Reason() string { return e.reason } 4520 4521 // Cause function returns cause value. 4522 func (e RetryPolicy_RetryHostPredicateValidationError) Cause() error { return e.cause } 4523 4524 // Key function returns key value. 4525 func (e RetryPolicy_RetryHostPredicateValidationError) Key() bool { return e.key } 4526 4527 // ErrorName returns error name. 4528 func (e RetryPolicy_RetryHostPredicateValidationError) ErrorName() string { 4529 return "RetryPolicy_RetryHostPredicateValidationError" 4530 } 4531 4532 // Error satisfies the builtin error interface 4533 func (e RetryPolicy_RetryHostPredicateValidationError) Error() string { 4534 cause := "" 4535 if e.cause != nil { 4536 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4537 } 4538 4539 key := "" 4540 if e.key { 4541 key = "key for " 4542 } 4543 4544 return fmt.Sprintf( 4545 "invalid %sRetryPolicy_RetryHostPredicate.%s: %s%s", 4546 key, 4547 e.field, 4548 e.reason, 4549 cause) 4550 } 4551 4552 var _ error = RetryPolicy_RetryHostPredicateValidationError{} 4553 4554 var _ interface { 4555 Field() string 4556 Reason() string 4557 Key() bool 4558 Cause() error 4559 ErrorName() string 4560 } = RetryPolicy_RetryHostPredicateValidationError{} 4561 4562 // Validate checks the field values on RetryPolicy_RetryBackOff with the rules 4563 // defined in the proto definition for this message. If any rules are 4564 // violated, an error is returned. 4565 func (m *RetryPolicy_RetryBackOff) Validate() error { 4566 if m == nil { 4567 return nil 4568 } 4569 4570 if m.GetBaseInterval() == nil { 4571 return RetryPolicy_RetryBackOffValidationError{ 4572 field: "BaseInterval", 4573 reason: "value is required", 4574 } 4575 } 4576 4577 if d := m.GetBaseInterval(); d != nil { 4578 dur, err := d.AsDuration(), d.CheckValid() 4579 if err != nil { 4580 return RetryPolicy_RetryBackOffValidationError{ 4581 field: "BaseInterval", 4582 reason: "value is not a valid duration", 4583 cause: err, 4584 } 4585 } 4586 4587 gt := time.Duration(0*time.Second + 0*time.Nanosecond) 4588 4589 if dur <= gt { 4590 return RetryPolicy_RetryBackOffValidationError{ 4591 field: "BaseInterval", 4592 reason: "value must be greater than 0s", 4593 } 4594 } 4595 4596 } 4597 4598 if d := m.GetMaxInterval(); d != nil { 4599 dur, err := d.AsDuration(), d.CheckValid() 4600 if err != nil { 4601 return RetryPolicy_RetryBackOffValidationError{ 4602 field: "MaxInterval", 4603 reason: "value is not a valid duration", 4604 cause: err, 4605 } 4606 } 4607 4608 gt := time.Duration(0*time.Second + 0*time.Nanosecond) 4609 4610 if dur <= gt { 4611 return RetryPolicy_RetryBackOffValidationError{ 4612 field: "MaxInterval", 4613 reason: "value must be greater than 0s", 4614 } 4615 } 4616 4617 } 4618 4619 return nil 4620 } 4621 4622 // RetryPolicy_RetryBackOffValidationError is the validation error returned by 4623 // RetryPolicy_RetryBackOff.Validate if the designated constraints aren't met. 4624 type RetryPolicy_RetryBackOffValidationError struct { 4625 field string 4626 reason string 4627 cause error 4628 key bool 4629 } 4630 4631 // Field function returns field value. 4632 func (e RetryPolicy_RetryBackOffValidationError) Field() string { return e.field } 4633 4634 // Reason function returns reason value. 4635 func (e RetryPolicy_RetryBackOffValidationError) Reason() string { return e.reason } 4636 4637 // Cause function returns cause value. 4638 func (e RetryPolicy_RetryBackOffValidationError) Cause() error { return e.cause } 4639 4640 // Key function returns key value. 4641 func (e RetryPolicy_RetryBackOffValidationError) Key() bool { return e.key } 4642 4643 // ErrorName returns error name. 4644 func (e RetryPolicy_RetryBackOffValidationError) ErrorName() string { 4645 return "RetryPolicy_RetryBackOffValidationError" 4646 } 4647 4648 // Error satisfies the builtin error interface 4649 func (e RetryPolicy_RetryBackOffValidationError) Error() string { 4650 cause := "" 4651 if e.cause != nil { 4652 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4653 } 4654 4655 key := "" 4656 if e.key { 4657 key = "key for " 4658 } 4659 4660 return fmt.Sprintf( 4661 "invalid %sRetryPolicy_RetryBackOff.%s: %s%s", 4662 key, 4663 e.field, 4664 e.reason, 4665 cause) 4666 } 4667 4668 var _ error = RetryPolicy_RetryBackOffValidationError{} 4669 4670 var _ interface { 4671 Field() string 4672 Reason() string 4673 Key() bool 4674 Cause() error 4675 ErrorName() string 4676 } = RetryPolicy_RetryBackOffValidationError{} 4677 4678 // Validate checks the field values on RetryPolicy_ResetHeader with the rules 4679 // defined in the proto definition for this message. If any rules are 4680 // violated, an error is returned. 4681 func (m *RetryPolicy_ResetHeader) Validate() error { 4682 if m == nil { 4683 return nil 4684 } 4685 4686 if utf8.RuneCountInString(m.GetName()) < 1 { 4687 return RetryPolicy_ResetHeaderValidationError{ 4688 field: "Name", 4689 reason: "value length must be at least 1 runes", 4690 } 4691 } 4692 4693 if !_RetryPolicy_ResetHeader_Name_Pattern.MatchString(m.GetName()) { 4694 return RetryPolicy_ResetHeaderValidationError{ 4695 field: "Name", 4696 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 4697 } 4698 } 4699 4700 if _, ok := RetryPolicy_ResetHeaderFormat_name[int32(m.GetFormat())]; !ok { 4701 return RetryPolicy_ResetHeaderValidationError{ 4702 field: "Format", 4703 reason: "value must be one of the defined enum values", 4704 } 4705 } 4706 4707 return nil 4708 } 4709 4710 // RetryPolicy_ResetHeaderValidationError is the validation error returned by 4711 // RetryPolicy_ResetHeader.Validate if the designated constraints aren't met. 4712 type RetryPolicy_ResetHeaderValidationError struct { 4713 field string 4714 reason string 4715 cause error 4716 key bool 4717 } 4718 4719 // Field function returns field value. 4720 func (e RetryPolicy_ResetHeaderValidationError) Field() string { return e.field } 4721 4722 // Reason function returns reason value. 4723 func (e RetryPolicy_ResetHeaderValidationError) Reason() string { return e.reason } 4724 4725 // Cause function returns cause value. 4726 func (e RetryPolicy_ResetHeaderValidationError) Cause() error { return e.cause } 4727 4728 // Key function returns key value. 4729 func (e RetryPolicy_ResetHeaderValidationError) Key() bool { return e.key } 4730 4731 // ErrorName returns error name. 4732 func (e RetryPolicy_ResetHeaderValidationError) ErrorName() string { 4733 return "RetryPolicy_ResetHeaderValidationError" 4734 } 4735 4736 // Error satisfies the builtin error interface 4737 func (e RetryPolicy_ResetHeaderValidationError) Error() string { 4738 cause := "" 4739 if e.cause != nil { 4740 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4741 } 4742 4743 key := "" 4744 if e.key { 4745 key = "key for " 4746 } 4747 4748 return fmt.Sprintf( 4749 "invalid %sRetryPolicy_ResetHeader.%s: %s%s", 4750 key, 4751 e.field, 4752 e.reason, 4753 cause) 4754 } 4755 4756 var _ error = RetryPolicy_ResetHeaderValidationError{} 4757 4758 var _ interface { 4759 Field() string 4760 Reason() string 4761 Key() bool 4762 Cause() error 4763 ErrorName() string 4764 } = RetryPolicy_ResetHeaderValidationError{} 4765 4766 var _RetryPolicy_ResetHeader_Name_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 4767 4768 // Validate checks the field values on RetryPolicy_RateLimitedRetryBackOff with 4769 // the rules defined in the proto definition for this message. If any rules 4770 // are violated, an error is returned. 4771 func (m *RetryPolicy_RateLimitedRetryBackOff) Validate() error { 4772 if m == nil { 4773 return nil 4774 } 4775 4776 if len(m.GetResetHeaders()) < 1 { 4777 return RetryPolicy_RateLimitedRetryBackOffValidationError{ 4778 field: "ResetHeaders", 4779 reason: "value must contain at least 1 item(s)", 4780 } 4781 } 4782 4783 for idx, item := range m.GetResetHeaders() { 4784 _, _ = idx, item 4785 4786 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 4787 if err := v.Validate(); err != nil { 4788 return RetryPolicy_RateLimitedRetryBackOffValidationError{ 4789 field: fmt.Sprintf("ResetHeaders[%v]", idx), 4790 reason: "embedded message failed validation", 4791 cause: err, 4792 } 4793 } 4794 } 4795 4796 } 4797 4798 if d := m.GetMaxInterval(); d != nil { 4799 dur, err := d.AsDuration(), d.CheckValid() 4800 if err != nil { 4801 return RetryPolicy_RateLimitedRetryBackOffValidationError{ 4802 field: "MaxInterval", 4803 reason: "value is not a valid duration", 4804 cause: err, 4805 } 4806 } 4807 4808 gt := time.Duration(0*time.Second + 0*time.Nanosecond) 4809 4810 if dur <= gt { 4811 return RetryPolicy_RateLimitedRetryBackOffValidationError{ 4812 field: "MaxInterval", 4813 reason: "value must be greater than 0s", 4814 } 4815 } 4816 4817 } 4818 4819 return nil 4820 } 4821 4822 // RetryPolicy_RateLimitedRetryBackOffValidationError is the validation error 4823 // returned by RetryPolicy_RateLimitedRetryBackOff.Validate if the designated 4824 // constraints aren't met. 4825 type RetryPolicy_RateLimitedRetryBackOffValidationError struct { 4826 field string 4827 reason string 4828 cause error 4829 key bool 4830 } 4831 4832 // Field function returns field value. 4833 func (e RetryPolicy_RateLimitedRetryBackOffValidationError) Field() string { return e.field } 4834 4835 // Reason function returns reason value. 4836 func (e RetryPolicy_RateLimitedRetryBackOffValidationError) Reason() string { return e.reason } 4837 4838 // Cause function returns cause value. 4839 func (e RetryPolicy_RateLimitedRetryBackOffValidationError) Cause() error { return e.cause } 4840 4841 // Key function returns key value. 4842 func (e RetryPolicy_RateLimitedRetryBackOffValidationError) Key() bool { return e.key } 4843 4844 // ErrorName returns error name. 4845 func (e RetryPolicy_RateLimitedRetryBackOffValidationError) ErrorName() string { 4846 return "RetryPolicy_RateLimitedRetryBackOffValidationError" 4847 } 4848 4849 // Error satisfies the builtin error interface 4850 func (e RetryPolicy_RateLimitedRetryBackOffValidationError) Error() string { 4851 cause := "" 4852 if e.cause != nil { 4853 cause = fmt.Sprintf(" | caused by: %v", e.cause) 4854 } 4855 4856 key := "" 4857 if e.key { 4858 key = "key for " 4859 } 4860 4861 return fmt.Sprintf( 4862 "invalid %sRetryPolicy_RateLimitedRetryBackOff.%s: %s%s", 4863 key, 4864 e.field, 4865 e.reason, 4866 cause) 4867 } 4868 4869 var _ error = RetryPolicy_RateLimitedRetryBackOffValidationError{} 4870 4871 var _ interface { 4872 Field() string 4873 Reason() string 4874 Key() bool 4875 Cause() error 4876 ErrorName() string 4877 } = RetryPolicy_RateLimitedRetryBackOffValidationError{} 4878 4879 // Validate checks the field values on RateLimit_Action with the rules defined 4880 // in the proto definition for this message. If any rules are violated, an 4881 // error is returned. 4882 func (m *RateLimit_Action) Validate() error { 4883 if m == nil { 4884 return nil 4885 } 4886 4887 switch m.ActionSpecifier.(type) { 4888 4889 case *RateLimit_Action_SourceCluster_: 4890 4891 if v, ok := interface{}(m.GetSourceCluster()).(interface{ Validate() error }); ok { 4892 if err := v.Validate(); err != nil { 4893 return RateLimit_ActionValidationError{ 4894 field: "SourceCluster", 4895 reason: "embedded message failed validation", 4896 cause: err, 4897 } 4898 } 4899 } 4900 4901 case *RateLimit_Action_DestinationCluster_: 4902 4903 if v, ok := interface{}(m.GetDestinationCluster()).(interface{ Validate() error }); ok { 4904 if err := v.Validate(); err != nil { 4905 return RateLimit_ActionValidationError{ 4906 field: "DestinationCluster", 4907 reason: "embedded message failed validation", 4908 cause: err, 4909 } 4910 } 4911 } 4912 4913 case *RateLimit_Action_RequestHeaders_: 4914 4915 if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { 4916 if err := v.Validate(); err != nil { 4917 return RateLimit_ActionValidationError{ 4918 field: "RequestHeaders", 4919 reason: "embedded message failed validation", 4920 cause: err, 4921 } 4922 } 4923 } 4924 4925 case *RateLimit_Action_RemoteAddress_: 4926 4927 if v, ok := interface{}(m.GetRemoteAddress()).(interface{ Validate() error }); ok { 4928 if err := v.Validate(); err != nil { 4929 return RateLimit_ActionValidationError{ 4930 field: "RemoteAddress", 4931 reason: "embedded message failed validation", 4932 cause: err, 4933 } 4934 } 4935 } 4936 4937 case *RateLimit_Action_GenericKey_: 4938 4939 if v, ok := interface{}(m.GetGenericKey()).(interface{ Validate() error }); ok { 4940 if err := v.Validate(); err != nil { 4941 return RateLimit_ActionValidationError{ 4942 field: "GenericKey", 4943 reason: "embedded message failed validation", 4944 cause: err, 4945 } 4946 } 4947 } 4948 4949 case *RateLimit_Action_HeaderValueMatch_: 4950 4951 if v, ok := interface{}(m.GetHeaderValueMatch()).(interface{ Validate() error }); ok { 4952 if err := v.Validate(); err != nil { 4953 return RateLimit_ActionValidationError{ 4954 field: "HeaderValueMatch", 4955 reason: "embedded message failed validation", 4956 cause: err, 4957 } 4958 } 4959 } 4960 4961 case *RateLimit_Action_DynamicMetadata: 4962 4963 if v, ok := interface{}(m.GetDynamicMetadata()).(interface{ Validate() error }); ok { 4964 if err := v.Validate(); err != nil { 4965 return RateLimit_ActionValidationError{ 4966 field: "DynamicMetadata", 4967 reason: "embedded message failed validation", 4968 cause: err, 4969 } 4970 } 4971 } 4972 4973 case *RateLimit_Action_Metadata: 4974 4975 if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { 4976 if err := v.Validate(); err != nil { 4977 return RateLimit_ActionValidationError{ 4978 field: "Metadata", 4979 reason: "embedded message failed validation", 4980 cause: err, 4981 } 4982 } 4983 } 4984 4985 case *RateLimit_Action_Extension: 4986 4987 if v, ok := interface{}(m.GetExtension()).(interface{ Validate() error }); ok { 4988 if err := v.Validate(); err != nil { 4989 return RateLimit_ActionValidationError{ 4990 field: "Extension", 4991 reason: "embedded message failed validation", 4992 cause: err, 4993 } 4994 } 4995 } 4996 4997 default: 4998 return RateLimit_ActionValidationError{ 4999 field: "ActionSpecifier", 5000 reason: "value is required", 5001 } 5002 5003 } 5004 5005 return nil 5006 } 5007 5008 // RateLimit_ActionValidationError is the validation error returned by 5009 // RateLimit_Action.Validate if the designated constraints aren't met. 5010 type RateLimit_ActionValidationError struct { 5011 field string 5012 reason string 5013 cause error 5014 key bool 5015 } 5016 5017 // Field function returns field value. 5018 func (e RateLimit_ActionValidationError) Field() string { return e.field } 5019 5020 // Reason function returns reason value. 5021 func (e RateLimit_ActionValidationError) Reason() string { return e.reason } 5022 5023 // Cause function returns cause value. 5024 func (e RateLimit_ActionValidationError) Cause() error { return e.cause } 5025 5026 // Key function returns key value. 5027 func (e RateLimit_ActionValidationError) Key() bool { return e.key } 5028 5029 // ErrorName returns error name. 5030 func (e RateLimit_ActionValidationError) ErrorName() string { return "RateLimit_ActionValidationError" } 5031 5032 // Error satisfies the builtin error interface 5033 func (e RateLimit_ActionValidationError) Error() string { 5034 cause := "" 5035 if e.cause != nil { 5036 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5037 } 5038 5039 key := "" 5040 if e.key { 5041 key = "key for " 5042 } 5043 5044 return fmt.Sprintf( 5045 "invalid %sRateLimit_Action.%s: %s%s", 5046 key, 5047 e.field, 5048 e.reason, 5049 cause) 5050 } 5051 5052 var _ error = RateLimit_ActionValidationError{} 5053 5054 var _ interface { 5055 Field() string 5056 Reason() string 5057 Key() bool 5058 Cause() error 5059 ErrorName() string 5060 } = RateLimit_ActionValidationError{} 5061 5062 // Validate checks the field values on RateLimit_Override with the rules 5063 // defined in the proto definition for this message. If any rules are 5064 // violated, an error is returned. 5065 func (m *RateLimit_Override) Validate() error { 5066 if m == nil { 5067 return nil 5068 } 5069 5070 switch m.OverrideSpecifier.(type) { 5071 5072 case *RateLimit_Override_DynamicMetadata_: 5073 5074 if v, ok := interface{}(m.GetDynamicMetadata()).(interface{ Validate() error }); ok { 5075 if err := v.Validate(); err != nil { 5076 return RateLimit_OverrideValidationError{ 5077 field: "DynamicMetadata", 5078 reason: "embedded message failed validation", 5079 cause: err, 5080 } 5081 } 5082 } 5083 5084 default: 5085 return RateLimit_OverrideValidationError{ 5086 field: "OverrideSpecifier", 5087 reason: "value is required", 5088 } 5089 5090 } 5091 5092 return nil 5093 } 5094 5095 // RateLimit_OverrideValidationError is the validation error returned by 5096 // RateLimit_Override.Validate if the designated constraints aren't met. 5097 type RateLimit_OverrideValidationError struct { 5098 field string 5099 reason string 5100 cause error 5101 key bool 5102 } 5103 5104 // Field function returns field value. 5105 func (e RateLimit_OverrideValidationError) Field() string { return e.field } 5106 5107 // Reason function returns reason value. 5108 func (e RateLimit_OverrideValidationError) Reason() string { return e.reason } 5109 5110 // Cause function returns cause value. 5111 func (e RateLimit_OverrideValidationError) Cause() error { return e.cause } 5112 5113 // Key function returns key value. 5114 func (e RateLimit_OverrideValidationError) Key() bool { return e.key } 5115 5116 // ErrorName returns error name. 5117 func (e RateLimit_OverrideValidationError) ErrorName() string { 5118 return "RateLimit_OverrideValidationError" 5119 } 5120 5121 // Error satisfies the builtin error interface 5122 func (e RateLimit_OverrideValidationError) Error() string { 5123 cause := "" 5124 if e.cause != nil { 5125 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5126 } 5127 5128 key := "" 5129 if e.key { 5130 key = "key for " 5131 } 5132 5133 return fmt.Sprintf( 5134 "invalid %sRateLimit_Override.%s: %s%s", 5135 key, 5136 e.field, 5137 e.reason, 5138 cause) 5139 } 5140 5141 var _ error = RateLimit_OverrideValidationError{} 5142 5143 var _ interface { 5144 Field() string 5145 Reason() string 5146 Key() bool 5147 Cause() error 5148 ErrorName() string 5149 } = RateLimit_OverrideValidationError{} 5150 5151 // Validate checks the field values on RateLimit_Action_SourceCluster with the 5152 // rules defined in the proto definition for this message. If any rules are 5153 // violated, an error is returned. 5154 func (m *RateLimit_Action_SourceCluster) Validate() error { 5155 if m == nil { 5156 return nil 5157 } 5158 5159 return nil 5160 } 5161 5162 // RateLimit_Action_SourceClusterValidationError is the validation error 5163 // returned by RateLimit_Action_SourceCluster.Validate if the designated 5164 // constraints aren't met. 5165 type RateLimit_Action_SourceClusterValidationError struct { 5166 field string 5167 reason string 5168 cause error 5169 key bool 5170 } 5171 5172 // Field function returns field value. 5173 func (e RateLimit_Action_SourceClusterValidationError) Field() string { return e.field } 5174 5175 // Reason function returns reason value. 5176 func (e RateLimit_Action_SourceClusterValidationError) Reason() string { return e.reason } 5177 5178 // Cause function returns cause value. 5179 func (e RateLimit_Action_SourceClusterValidationError) Cause() error { return e.cause } 5180 5181 // Key function returns key value. 5182 func (e RateLimit_Action_SourceClusterValidationError) Key() bool { return e.key } 5183 5184 // ErrorName returns error name. 5185 func (e RateLimit_Action_SourceClusterValidationError) ErrorName() string { 5186 return "RateLimit_Action_SourceClusterValidationError" 5187 } 5188 5189 // Error satisfies the builtin error interface 5190 func (e RateLimit_Action_SourceClusterValidationError) Error() string { 5191 cause := "" 5192 if e.cause != nil { 5193 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5194 } 5195 5196 key := "" 5197 if e.key { 5198 key = "key for " 5199 } 5200 5201 return fmt.Sprintf( 5202 "invalid %sRateLimit_Action_SourceCluster.%s: %s%s", 5203 key, 5204 e.field, 5205 e.reason, 5206 cause) 5207 } 5208 5209 var _ error = RateLimit_Action_SourceClusterValidationError{} 5210 5211 var _ interface { 5212 Field() string 5213 Reason() string 5214 Key() bool 5215 Cause() error 5216 ErrorName() string 5217 } = RateLimit_Action_SourceClusterValidationError{} 5218 5219 // Validate checks the field values on RateLimit_Action_DestinationCluster with 5220 // the rules defined in the proto definition for this message. If any rules 5221 // are violated, an error is returned. 5222 func (m *RateLimit_Action_DestinationCluster) Validate() error { 5223 if m == nil { 5224 return nil 5225 } 5226 5227 return nil 5228 } 5229 5230 // RateLimit_Action_DestinationClusterValidationError is the validation error 5231 // returned by RateLimit_Action_DestinationCluster.Validate if the designated 5232 // constraints aren't met. 5233 type RateLimit_Action_DestinationClusterValidationError struct { 5234 field string 5235 reason string 5236 cause error 5237 key bool 5238 } 5239 5240 // Field function returns field value. 5241 func (e RateLimit_Action_DestinationClusterValidationError) Field() string { return e.field } 5242 5243 // Reason function returns reason value. 5244 func (e RateLimit_Action_DestinationClusterValidationError) Reason() string { return e.reason } 5245 5246 // Cause function returns cause value. 5247 func (e RateLimit_Action_DestinationClusterValidationError) Cause() error { return e.cause } 5248 5249 // Key function returns key value. 5250 func (e RateLimit_Action_DestinationClusterValidationError) Key() bool { return e.key } 5251 5252 // ErrorName returns error name. 5253 func (e RateLimit_Action_DestinationClusterValidationError) ErrorName() string { 5254 return "RateLimit_Action_DestinationClusterValidationError" 5255 } 5256 5257 // Error satisfies the builtin error interface 5258 func (e RateLimit_Action_DestinationClusterValidationError) Error() string { 5259 cause := "" 5260 if e.cause != nil { 5261 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5262 } 5263 5264 key := "" 5265 if e.key { 5266 key = "key for " 5267 } 5268 5269 return fmt.Sprintf( 5270 "invalid %sRateLimit_Action_DestinationCluster.%s: %s%s", 5271 key, 5272 e.field, 5273 e.reason, 5274 cause) 5275 } 5276 5277 var _ error = RateLimit_Action_DestinationClusterValidationError{} 5278 5279 var _ interface { 5280 Field() string 5281 Reason() string 5282 Key() bool 5283 Cause() error 5284 ErrorName() string 5285 } = RateLimit_Action_DestinationClusterValidationError{} 5286 5287 // Validate checks the field values on RateLimit_Action_RequestHeaders with the 5288 // rules defined in the proto definition for this message. If any rules are 5289 // violated, an error is returned. 5290 func (m *RateLimit_Action_RequestHeaders) Validate() error { 5291 if m == nil { 5292 return nil 5293 } 5294 5295 if utf8.RuneCountInString(m.GetHeaderName()) < 1 { 5296 return RateLimit_Action_RequestHeadersValidationError{ 5297 field: "HeaderName", 5298 reason: "value length must be at least 1 runes", 5299 } 5300 } 5301 5302 if !_RateLimit_Action_RequestHeaders_HeaderName_Pattern.MatchString(m.GetHeaderName()) { 5303 return RateLimit_Action_RequestHeadersValidationError{ 5304 field: "HeaderName", 5305 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 5306 } 5307 } 5308 5309 if utf8.RuneCountInString(m.GetDescriptorKey()) < 1 { 5310 return RateLimit_Action_RequestHeadersValidationError{ 5311 field: "DescriptorKey", 5312 reason: "value length must be at least 1 runes", 5313 } 5314 } 5315 5316 // no validation rules for SkipIfAbsent 5317 5318 return nil 5319 } 5320 5321 // RateLimit_Action_RequestHeadersValidationError is the validation error 5322 // returned by RateLimit_Action_RequestHeaders.Validate if the designated 5323 // constraints aren't met. 5324 type RateLimit_Action_RequestHeadersValidationError struct { 5325 field string 5326 reason string 5327 cause error 5328 key bool 5329 } 5330 5331 // Field function returns field value. 5332 func (e RateLimit_Action_RequestHeadersValidationError) Field() string { return e.field } 5333 5334 // Reason function returns reason value. 5335 func (e RateLimit_Action_RequestHeadersValidationError) Reason() string { return e.reason } 5336 5337 // Cause function returns cause value. 5338 func (e RateLimit_Action_RequestHeadersValidationError) Cause() error { return e.cause } 5339 5340 // Key function returns key value. 5341 func (e RateLimit_Action_RequestHeadersValidationError) Key() bool { return e.key } 5342 5343 // ErrorName returns error name. 5344 func (e RateLimit_Action_RequestHeadersValidationError) ErrorName() string { 5345 return "RateLimit_Action_RequestHeadersValidationError" 5346 } 5347 5348 // Error satisfies the builtin error interface 5349 func (e RateLimit_Action_RequestHeadersValidationError) Error() string { 5350 cause := "" 5351 if e.cause != nil { 5352 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5353 } 5354 5355 key := "" 5356 if e.key { 5357 key = "key for " 5358 } 5359 5360 return fmt.Sprintf( 5361 "invalid %sRateLimit_Action_RequestHeaders.%s: %s%s", 5362 key, 5363 e.field, 5364 e.reason, 5365 cause) 5366 } 5367 5368 var _ error = RateLimit_Action_RequestHeadersValidationError{} 5369 5370 var _ interface { 5371 Field() string 5372 Reason() string 5373 Key() bool 5374 Cause() error 5375 ErrorName() string 5376 } = RateLimit_Action_RequestHeadersValidationError{} 5377 5378 var _RateLimit_Action_RequestHeaders_HeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 5379 5380 // Validate checks the field values on RateLimit_Action_RemoteAddress with the 5381 // rules defined in the proto definition for this message. If any rules are 5382 // violated, an error is returned. 5383 func (m *RateLimit_Action_RemoteAddress) Validate() error { 5384 if m == nil { 5385 return nil 5386 } 5387 5388 return nil 5389 } 5390 5391 // RateLimit_Action_RemoteAddressValidationError is the validation error 5392 // returned by RateLimit_Action_RemoteAddress.Validate if the designated 5393 // constraints aren't met. 5394 type RateLimit_Action_RemoteAddressValidationError struct { 5395 field string 5396 reason string 5397 cause error 5398 key bool 5399 } 5400 5401 // Field function returns field value. 5402 func (e RateLimit_Action_RemoteAddressValidationError) Field() string { return e.field } 5403 5404 // Reason function returns reason value. 5405 func (e RateLimit_Action_RemoteAddressValidationError) Reason() string { return e.reason } 5406 5407 // Cause function returns cause value. 5408 func (e RateLimit_Action_RemoteAddressValidationError) Cause() error { return e.cause } 5409 5410 // Key function returns key value. 5411 func (e RateLimit_Action_RemoteAddressValidationError) Key() bool { return e.key } 5412 5413 // ErrorName returns error name. 5414 func (e RateLimit_Action_RemoteAddressValidationError) ErrorName() string { 5415 return "RateLimit_Action_RemoteAddressValidationError" 5416 } 5417 5418 // Error satisfies the builtin error interface 5419 func (e RateLimit_Action_RemoteAddressValidationError) Error() string { 5420 cause := "" 5421 if e.cause != nil { 5422 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5423 } 5424 5425 key := "" 5426 if e.key { 5427 key = "key for " 5428 } 5429 5430 return fmt.Sprintf( 5431 "invalid %sRateLimit_Action_RemoteAddress.%s: %s%s", 5432 key, 5433 e.field, 5434 e.reason, 5435 cause) 5436 } 5437 5438 var _ error = RateLimit_Action_RemoteAddressValidationError{} 5439 5440 var _ interface { 5441 Field() string 5442 Reason() string 5443 Key() bool 5444 Cause() error 5445 ErrorName() string 5446 } = RateLimit_Action_RemoteAddressValidationError{} 5447 5448 // Validate checks the field values on RateLimit_Action_GenericKey with the 5449 // rules defined in the proto definition for this message. If any rules are 5450 // violated, an error is returned. 5451 func (m *RateLimit_Action_GenericKey) Validate() error { 5452 if m == nil { 5453 return nil 5454 } 5455 5456 if utf8.RuneCountInString(m.GetDescriptorValue()) < 1 { 5457 return RateLimit_Action_GenericKeyValidationError{ 5458 field: "DescriptorValue", 5459 reason: "value length must be at least 1 runes", 5460 } 5461 } 5462 5463 // no validation rules for DescriptorKey 5464 5465 return nil 5466 } 5467 5468 // RateLimit_Action_GenericKeyValidationError is the validation error returned 5469 // by RateLimit_Action_GenericKey.Validate if the designated constraints 5470 // aren't met. 5471 type RateLimit_Action_GenericKeyValidationError struct { 5472 field string 5473 reason string 5474 cause error 5475 key bool 5476 } 5477 5478 // Field function returns field value. 5479 func (e RateLimit_Action_GenericKeyValidationError) Field() string { return e.field } 5480 5481 // Reason function returns reason value. 5482 func (e RateLimit_Action_GenericKeyValidationError) Reason() string { return e.reason } 5483 5484 // Cause function returns cause value. 5485 func (e RateLimit_Action_GenericKeyValidationError) Cause() error { return e.cause } 5486 5487 // Key function returns key value. 5488 func (e RateLimit_Action_GenericKeyValidationError) Key() bool { return e.key } 5489 5490 // ErrorName returns error name. 5491 func (e RateLimit_Action_GenericKeyValidationError) ErrorName() string { 5492 return "RateLimit_Action_GenericKeyValidationError" 5493 } 5494 5495 // Error satisfies the builtin error interface 5496 func (e RateLimit_Action_GenericKeyValidationError) Error() string { 5497 cause := "" 5498 if e.cause != nil { 5499 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5500 } 5501 5502 key := "" 5503 if e.key { 5504 key = "key for " 5505 } 5506 5507 return fmt.Sprintf( 5508 "invalid %sRateLimit_Action_GenericKey.%s: %s%s", 5509 key, 5510 e.field, 5511 e.reason, 5512 cause) 5513 } 5514 5515 var _ error = RateLimit_Action_GenericKeyValidationError{} 5516 5517 var _ interface { 5518 Field() string 5519 Reason() string 5520 Key() bool 5521 Cause() error 5522 ErrorName() string 5523 } = RateLimit_Action_GenericKeyValidationError{} 5524 5525 // Validate checks the field values on RateLimit_Action_HeaderValueMatch with 5526 // the rules defined in the proto definition for this message. If any rules 5527 // are violated, an error is returned. 5528 func (m *RateLimit_Action_HeaderValueMatch) Validate() error { 5529 if m == nil { 5530 return nil 5531 } 5532 5533 if utf8.RuneCountInString(m.GetDescriptorValue()) < 1 { 5534 return RateLimit_Action_HeaderValueMatchValidationError{ 5535 field: "DescriptorValue", 5536 reason: "value length must be at least 1 runes", 5537 } 5538 } 5539 5540 if v, ok := interface{}(m.GetExpectMatch()).(interface{ Validate() error }); ok { 5541 if err := v.Validate(); err != nil { 5542 return RateLimit_Action_HeaderValueMatchValidationError{ 5543 field: "ExpectMatch", 5544 reason: "embedded message failed validation", 5545 cause: err, 5546 } 5547 } 5548 } 5549 5550 if len(m.GetHeaders()) < 1 { 5551 return RateLimit_Action_HeaderValueMatchValidationError{ 5552 field: "Headers", 5553 reason: "value must contain at least 1 item(s)", 5554 } 5555 } 5556 5557 for idx, item := range m.GetHeaders() { 5558 _, _ = idx, item 5559 5560 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 5561 if err := v.Validate(); err != nil { 5562 return RateLimit_Action_HeaderValueMatchValidationError{ 5563 field: fmt.Sprintf("Headers[%v]", idx), 5564 reason: "embedded message failed validation", 5565 cause: err, 5566 } 5567 } 5568 } 5569 5570 } 5571 5572 return nil 5573 } 5574 5575 // RateLimit_Action_HeaderValueMatchValidationError is the validation error 5576 // returned by RateLimit_Action_HeaderValueMatch.Validate if the designated 5577 // constraints aren't met. 5578 type RateLimit_Action_HeaderValueMatchValidationError struct { 5579 field string 5580 reason string 5581 cause error 5582 key bool 5583 } 5584 5585 // Field function returns field value. 5586 func (e RateLimit_Action_HeaderValueMatchValidationError) Field() string { return e.field } 5587 5588 // Reason function returns reason value. 5589 func (e RateLimit_Action_HeaderValueMatchValidationError) Reason() string { return e.reason } 5590 5591 // Cause function returns cause value. 5592 func (e RateLimit_Action_HeaderValueMatchValidationError) Cause() error { return e.cause } 5593 5594 // Key function returns key value. 5595 func (e RateLimit_Action_HeaderValueMatchValidationError) Key() bool { return e.key } 5596 5597 // ErrorName returns error name. 5598 func (e RateLimit_Action_HeaderValueMatchValidationError) ErrorName() string { 5599 return "RateLimit_Action_HeaderValueMatchValidationError" 5600 } 5601 5602 // Error satisfies the builtin error interface 5603 func (e RateLimit_Action_HeaderValueMatchValidationError) Error() string { 5604 cause := "" 5605 if e.cause != nil { 5606 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5607 } 5608 5609 key := "" 5610 if e.key { 5611 key = "key for " 5612 } 5613 5614 return fmt.Sprintf( 5615 "invalid %sRateLimit_Action_HeaderValueMatch.%s: %s%s", 5616 key, 5617 e.field, 5618 e.reason, 5619 cause) 5620 } 5621 5622 var _ error = RateLimit_Action_HeaderValueMatchValidationError{} 5623 5624 var _ interface { 5625 Field() string 5626 Reason() string 5627 Key() bool 5628 Cause() error 5629 ErrorName() string 5630 } = RateLimit_Action_HeaderValueMatchValidationError{} 5631 5632 // Validate checks the field values on RateLimit_Action_DynamicMetaData with 5633 // the rules defined in the proto definition for this message. If any rules 5634 // are violated, an error is returned. 5635 func (m *RateLimit_Action_DynamicMetaData) Validate() error { 5636 if m == nil { 5637 return nil 5638 } 5639 5640 if utf8.RuneCountInString(m.GetDescriptorKey()) < 1 { 5641 return RateLimit_Action_DynamicMetaDataValidationError{ 5642 field: "DescriptorKey", 5643 reason: "value length must be at least 1 runes", 5644 } 5645 } 5646 5647 if m.GetMetadataKey() == nil { 5648 return RateLimit_Action_DynamicMetaDataValidationError{ 5649 field: "MetadataKey", 5650 reason: "value is required", 5651 } 5652 } 5653 5654 if v, ok := interface{}(m.GetMetadataKey()).(interface{ Validate() error }); ok { 5655 if err := v.Validate(); err != nil { 5656 return RateLimit_Action_DynamicMetaDataValidationError{ 5657 field: "MetadataKey", 5658 reason: "embedded message failed validation", 5659 cause: err, 5660 } 5661 } 5662 } 5663 5664 // no validation rules for DefaultValue 5665 5666 return nil 5667 } 5668 5669 // RateLimit_Action_DynamicMetaDataValidationError is the validation error 5670 // returned by RateLimit_Action_DynamicMetaData.Validate if the designated 5671 // constraints aren't met. 5672 type RateLimit_Action_DynamicMetaDataValidationError struct { 5673 field string 5674 reason string 5675 cause error 5676 key bool 5677 } 5678 5679 // Field function returns field value. 5680 func (e RateLimit_Action_DynamicMetaDataValidationError) Field() string { return e.field } 5681 5682 // Reason function returns reason value. 5683 func (e RateLimit_Action_DynamicMetaDataValidationError) Reason() string { return e.reason } 5684 5685 // Cause function returns cause value. 5686 func (e RateLimit_Action_DynamicMetaDataValidationError) Cause() error { return e.cause } 5687 5688 // Key function returns key value. 5689 func (e RateLimit_Action_DynamicMetaDataValidationError) Key() bool { return e.key } 5690 5691 // ErrorName returns error name. 5692 func (e RateLimit_Action_DynamicMetaDataValidationError) ErrorName() string { 5693 return "RateLimit_Action_DynamicMetaDataValidationError" 5694 } 5695 5696 // Error satisfies the builtin error interface 5697 func (e RateLimit_Action_DynamicMetaDataValidationError) Error() string { 5698 cause := "" 5699 if e.cause != nil { 5700 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5701 } 5702 5703 key := "" 5704 if e.key { 5705 key = "key for " 5706 } 5707 5708 return fmt.Sprintf( 5709 "invalid %sRateLimit_Action_DynamicMetaData.%s: %s%s", 5710 key, 5711 e.field, 5712 e.reason, 5713 cause) 5714 } 5715 5716 var _ error = RateLimit_Action_DynamicMetaDataValidationError{} 5717 5718 var _ interface { 5719 Field() string 5720 Reason() string 5721 Key() bool 5722 Cause() error 5723 ErrorName() string 5724 } = RateLimit_Action_DynamicMetaDataValidationError{} 5725 5726 // Validate checks the field values on RateLimit_Action_MetaData with the rules 5727 // defined in the proto definition for this message. If any rules are 5728 // violated, an error is returned. 5729 func (m *RateLimit_Action_MetaData) Validate() error { 5730 if m == nil { 5731 return nil 5732 } 5733 5734 if utf8.RuneCountInString(m.GetDescriptorKey()) < 1 { 5735 return RateLimit_Action_MetaDataValidationError{ 5736 field: "DescriptorKey", 5737 reason: "value length must be at least 1 runes", 5738 } 5739 } 5740 5741 if m.GetMetadataKey() == nil { 5742 return RateLimit_Action_MetaDataValidationError{ 5743 field: "MetadataKey", 5744 reason: "value is required", 5745 } 5746 } 5747 5748 if v, ok := interface{}(m.GetMetadataKey()).(interface{ Validate() error }); ok { 5749 if err := v.Validate(); err != nil { 5750 return RateLimit_Action_MetaDataValidationError{ 5751 field: "MetadataKey", 5752 reason: "embedded message failed validation", 5753 cause: err, 5754 } 5755 } 5756 } 5757 5758 // no validation rules for DefaultValue 5759 5760 if _, ok := RateLimit_Action_MetaData_Source_name[int32(m.GetSource())]; !ok { 5761 return RateLimit_Action_MetaDataValidationError{ 5762 field: "Source", 5763 reason: "value must be one of the defined enum values", 5764 } 5765 } 5766 5767 return nil 5768 } 5769 5770 // RateLimit_Action_MetaDataValidationError is the validation error returned by 5771 // RateLimit_Action_MetaData.Validate if the designated constraints aren't met. 5772 type RateLimit_Action_MetaDataValidationError struct { 5773 field string 5774 reason string 5775 cause error 5776 key bool 5777 } 5778 5779 // Field function returns field value. 5780 func (e RateLimit_Action_MetaDataValidationError) Field() string { return e.field } 5781 5782 // Reason function returns reason value. 5783 func (e RateLimit_Action_MetaDataValidationError) Reason() string { return e.reason } 5784 5785 // Cause function returns cause value. 5786 func (e RateLimit_Action_MetaDataValidationError) Cause() error { return e.cause } 5787 5788 // Key function returns key value. 5789 func (e RateLimit_Action_MetaDataValidationError) Key() bool { return e.key } 5790 5791 // ErrorName returns error name. 5792 func (e RateLimit_Action_MetaDataValidationError) ErrorName() string { 5793 return "RateLimit_Action_MetaDataValidationError" 5794 } 5795 5796 // Error satisfies the builtin error interface 5797 func (e RateLimit_Action_MetaDataValidationError) Error() string { 5798 cause := "" 5799 if e.cause != nil { 5800 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5801 } 5802 5803 key := "" 5804 if e.key { 5805 key = "key for " 5806 } 5807 5808 return fmt.Sprintf( 5809 "invalid %sRateLimit_Action_MetaData.%s: %s%s", 5810 key, 5811 e.field, 5812 e.reason, 5813 cause) 5814 } 5815 5816 var _ error = RateLimit_Action_MetaDataValidationError{} 5817 5818 var _ interface { 5819 Field() string 5820 Reason() string 5821 Key() bool 5822 Cause() error 5823 ErrorName() string 5824 } = RateLimit_Action_MetaDataValidationError{} 5825 5826 // Validate checks the field values on RateLimit_Override_DynamicMetadata with 5827 // the rules defined in the proto definition for this message. If any rules 5828 // are violated, an error is returned. 5829 func (m *RateLimit_Override_DynamicMetadata) Validate() error { 5830 if m == nil { 5831 return nil 5832 } 5833 5834 if m.GetMetadataKey() == nil { 5835 return RateLimit_Override_DynamicMetadataValidationError{ 5836 field: "MetadataKey", 5837 reason: "value is required", 5838 } 5839 } 5840 5841 if v, ok := interface{}(m.GetMetadataKey()).(interface{ Validate() error }); ok { 5842 if err := v.Validate(); err != nil { 5843 return RateLimit_Override_DynamicMetadataValidationError{ 5844 field: "MetadataKey", 5845 reason: "embedded message failed validation", 5846 cause: err, 5847 } 5848 } 5849 } 5850 5851 return nil 5852 } 5853 5854 // RateLimit_Override_DynamicMetadataValidationError is the validation error 5855 // returned by RateLimit_Override_DynamicMetadata.Validate if the designated 5856 // constraints aren't met. 5857 type RateLimit_Override_DynamicMetadataValidationError struct { 5858 field string 5859 reason string 5860 cause error 5861 key bool 5862 } 5863 5864 // Field function returns field value. 5865 func (e RateLimit_Override_DynamicMetadataValidationError) Field() string { return e.field } 5866 5867 // Reason function returns reason value. 5868 func (e RateLimit_Override_DynamicMetadataValidationError) Reason() string { return e.reason } 5869 5870 // Cause function returns cause value. 5871 func (e RateLimit_Override_DynamicMetadataValidationError) Cause() error { return e.cause } 5872 5873 // Key function returns key value. 5874 func (e RateLimit_Override_DynamicMetadataValidationError) Key() bool { return e.key } 5875 5876 // ErrorName returns error name. 5877 func (e RateLimit_Override_DynamicMetadataValidationError) ErrorName() string { 5878 return "RateLimit_Override_DynamicMetadataValidationError" 5879 } 5880 5881 // Error satisfies the builtin error interface 5882 func (e RateLimit_Override_DynamicMetadataValidationError) Error() string { 5883 cause := "" 5884 if e.cause != nil { 5885 cause = fmt.Sprintf(" | caused by: %v", e.cause) 5886 } 5887 5888 key := "" 5889 if e.key { 5890 key = "key for " 5891 } 5892 5893 return fmt.Sprintf( 5894 "invalid %sRateLimit_Override_DynamicMetadata.%s: %s%s", 5895 key, 5896 e.field, 5897 e.reason, 5898 cause) 5899 } 5900 5901 var _ error = RateLimit_Override_DynamicMetadataValidationError{} 5902 5903 var _ interface { 5904 Field() string 5905 Reason() string 5906 Key() bool 5907 Cause() error 5908 ErrorName() string 5909 } = RateLimit_Override_DynamicMetadataValidationError{}