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