1// Code generated by protoc-gen-validate. DO NOT EDIT. 2// source: envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto 3 4package envoy_extensions_filters_network_http_connection_manager_v4alpha 5 6import ( 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 "github.com/golang/protobuf/ptypes" 19) 20 21// ensure the imports are used 22var ( 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 _ = ptypes.DynamicAny{} 34) 35 36// Validate checks the field values on HttpConnectionManager with the rules 37// defined in the proto definition for this message. If any rules are 38// violated, an error is returned. 39func (m *HttpConnectionManager) Validate() error { 40 if m == nil { 41 return nil 42 } 43 44 if _, ok := HttpConnectionManager_CodecType_name[int32(m.GetCodecType())]; !ok { 45 return HttpConnectionManagerValidationError{ 46 field: "CodecType", 47 reason: "value must be one of the defined enum values", 48 } 49 } 50 51 if utf8.RuneCountInString(m.GetStatPrefix()) < 1 { 52 return HttpConnectionManagerValidationError{ 53 field: "StatPrefix", 54 reason: "value length must be at least 1 runes", 55 } 56 } 57 58 for idx, item := range m.GetHttpFilters() { 59 _, _ = idx, item 60 61 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 62 if err := v.Validate(); err != nil { 63 return HttpConnectionManagerValidationError{ 64 field: fmt.Sprintf("HttpFilters[%v]", idx), 65 reason: "embedded message failed validation", 66 cause: err, 67 } 68 } 69 } 70 71 } 72 73 if v, ok := interface{}(m.GetAddUserAgent()).(interface{ Validate() error }); ok { 74 if err := v.Validate(); err != nil { 75 return HttpConnectionManagerValidationError{ 76 field: "AddUserAgent", 77 reason: "embedded message failed validation", 78 cause: err, 79 } 80 } 81 } 82 83 if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok { 84 if err := v.Validate(); err != nil { 85 return HttpConnectionManagerValidationError{ 86 field: "Tracing", 87 reason: "embedded message failed validation", 88 cause: err, 89 } 90 } 91 } 92 93 if v, ok := interface{}(m.GetCommonHttpProtocolOptions()).(interface{ Validate() error }); ok { 94 if err := v.Validate(); err != nil { 95 return HttpConnectionManagerValidationError{ 96 field: "CommonHttpProtocolOptions", 97 reason: "embedded message failed validation", 98 cause: err, 99 } 100 } 101 } 102 103 if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok { 104 if err := v.Validate(); err != nil { 105 return HttpConnectionManagerValidationError{ 106 field: "HttpProtocolOptions", 107 reason: "embedded message failed validation", 108 cause: err, 109 } 110 } 111 } 112 113 if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok { 114 if err := v.Validate(); err != nil { 115 return HttpConnectionManagerValidationError{ 116 field: "Http2ProtocolOptions", 117 reason: "embedded message failed validation", 118 cause: err, 119 } 120 } 121 } 122 123 if v, ok := interface{}(m.GetHttp3ProtocolOptions()).(interface{ Validate() error }); ok { 124 if err := v.Validate(); err != nil { 125 return HttpConnectionManagerValidationError{ 126 field: "Http3ProtocolOptions", 127 reason: "embedded message failed validation", 128 cause: err, 129 } 130 } 131 } 132 133 if !_HttpConnectionManager_ServerName_Pattern.MatchString(m.GetServerName()) { 134 return HttpConnectionManagerValidationError{ 135 field: "ServerName", 136 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 137 } 138 } 139 140 if _, ok := HttpConnectionManager_ServerHeaderTransformation_name[int32(m.GetServerHeaderTransformation())]; !ok { 141 return HttpConnectionManagerValidationError{ 142 field: "ServerHeaderTransformation", 143 reason: "value must be one of the defined enum values", 144 } 145 } 146 147 if wrapper := m.GetMaxRequestHeadersKb(); wrapper != nil { 148 149 if val := wrapper.GetValue(); val <= 0 || val > 8192 { 150 return HttpConnectionManagerValidationError{ 151 field: "MaxRequestHeadersKb", 152 reason: "value must be inside range (0, 8192]", 153 } 154 } 155 156 } 157 158 if v, ok := interface{}(m.GetStreamIdleTimeout()).(interface{ Validate() error }); ok { 159 if err := v.Validate(); err != nil { 160 return HttpConnectionManagerValidationError{ 161 field: "StreamIdleTimeout", 162 reason: "embedded message failed validation", 163 cause: err, 164 } 165 } 166 } 167 168 if v, ok := interface{}(m.GetRequestTimeout()).(interface{ Validate() error }); ok { 169 if err := v.Validate(); err != nil { 170 return HttpConnectionManagerValidationError{ 171 field: "RequestTimeout", 172 reason: "embedded message failed validation", 173 cause: err, 174 } 175 } 176 } 177 178 if d := m.GetRequestHeadersTimeout(); d != nil { 179 dur, err := ptypes.Duration(d) 180 if err != nil { 181 return HttpConnectionManagerValidationError{ 182 field: "RequestHeadersTimeout", 183 reason: "value is not a valid duration", 184 cause: err, 185 } 186 } 187 188 gte := time.Duration(0*time.Second + 0*time.Nanosecond) 189 190 if dur < gte { 191 return HttpConnectionManagerValidationError{ 192 field: "RequestHeadersTimeout", 193 reason: "value must be greater than or equal to 0s", 194 } 195 } 196 197 } 198 199 if v, ok := interface{}(m.GetDrainTimeout()).(interface{ Validate() error }); ok { 200 if err := v.Validate(); err != nil { 201 return HttpConnectionManagerValidationError{ 202 field: "DrainTimeout", 203 reason: "embedded message failed validation", 204 cause: err, 205 } 206 } 207 } 208 209 if v, ok := interface{}(m.GetDelayedCloseTimeout()).(interface{ Validate() error }); ok { 210 if err := v.Validate(); err != nil { 211 return HttpConnectionManagerValidationError{ 212 field: "DelayedCloseTimeout", 213 reason: "embedded message failed validation", 214 cause: err, 215 } 216 } 217 } 218 219 for idx, item := range m.GetAccessLog() { 220 _, _ = idx, item 221 222 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 223 if err := v.Validate(); err != nil { 224 return HttpConnectionManagerValidationError{ 225 field: fmt.Sprintf("AccessLog[%v]", idx), 226 reason: "embedded message failed validation", 227 cause: err, 228 } 229 } 230 } 231 232 } 233 234 if v, ok := interface{}(m.GetUseRemoteAddress()).(interface{ Validate() error }); ok { 235 if err := v.Validate(); err != nil { 236 return HttpConnectionManagerValidationError{ 237 field: "UseRemoteAddress", 238 reason: "embedded message failed validation", 239 cause: err, 240 } 241 } 242 } 243 244 // no validation rules for HiddenEnvoyDeprecatedXffNumTrustedHops 245 246 for idx, item := range m.GetOriginalIpDetectionExtensions() { 247 _, _ = idx, item 248 249 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 250 if err := v.Validate(); err != nil { 251 return HttpConnectionManagerValidationError{ 252 field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx), 253 reason: "embedded message failed validation", 254 cause: err, 255 } 256 } 257 } 258 259 } 260 261 if v, ok := interface{}(m.GetInternalAddressConfig()).(interface{ Validate() error }); ok { 262 if err := v.Validate(); err != nil { 263 return HttpConnectionManagerValidationError{ 264 field: "InternalAddressConfig", 265 reason: "embedded message failed validation", 266 cause: err, 267 } 268 } 269 } 270 271 // no validation rules for SkipXffAppend 272 273 if !_HttpConnectionManager_Via_Pattern.MatchString(m.GetVia()) { 274 return HttpConnectionManagerValidationError{ 275 field: "Via", 276 reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"", 277 } 278 } 279 280 if v, ok := interface{}(m.GetGenerateRequestId()).(interface{ Validate() error }); ok { 281 if err := v.Validate(); err != nil { 282 return HttpConnectionManagerValidationError{ 283 field: "GenerateRequestId", 284 reason: "embedded message failed validation", 285 cause: err, 286 } 287 } 288 } 289 290 // no validation rules for PreserveExternalRequestId 291 292 // no validation rules for AlwaysSetRequestIdInResponse 293 294 if _, ok := HttpConnectionManager_ForwardClientCertDetails_name[int32(m.GetForwardClientCertDetails())]; !ok { 295 return HttpConnectionManagerValidationError{ 296 field: "ForwardClientCertDetails", 297 reason: "value must be one of the defined enum values", 298 } 299 } 300 301 if v, ok := interface{}(m.GetSetCurrentClientCertDetails()).(interface{ Validate() error }); ok { 302 if err := v.Validate(); err != nil { 303 return HttpConnectionManagerValidationError{ 304 field: "SetCurrentClientCertDetails", 305 reason: "embedded message failed validation", 306 cause: err, 307 } 308 } 309 } 310 311 // no validation rules for Proxy_100Continue 312 313 // no validation rules for RepresentIpv4RemoteAddressAsIpv4MappedIpv6 314 315 for idx, item := range m.GetUpgradeConfigs() { 316 _, _ = idx, item 317 318 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 319 if err := v.Validate(); err != nil { 320 return HttpConnectionManagerValidationError{ 321 field: fmt.Sprintf("UpgradeConfigs[%v]", idx), 322 reason: "embedded message failed validation", 323 cause: err, 324 } 325 } 326 } 327 328 } 329 330 if v, ok := interface{}(m.GetNormalizePath()).(interface{ Validate() error }); ok { 331 if err := v.Validate(); err != nil { 332 return HttpConnectionManagerValidationError{ 333 field: "NormalizePath", 334 reason: "embedded message failed validation", 335 cause: err, 336 } 337 } 338 } 339 340 // no validation rules for MergeSlashes 341 342 // no validation rules for PathWithEscapedSlashesAction 343 344 if v, ok := interface{}(m.GetRequestIdExtension()).(interface{ Validate() error }); ok { 345 if err := v.Validate(); err != nil { 346 return HttpConnectionManagerValidationError{ 347 field: "RequestIdExtension", 348 reason: "embedded message failed validation", 349 cause: err, 350 } 351 } 352 } 353 354 if v, ok := interface{}(m.GetLocalReplyConfig()).(interface{ Validate() error }); ok { 355 if err := v.Validate(); err != nil { 356 return HttpConnectionManagerValidationError{ 357 field: "LocalReplyConfig", 358 reason: "embedded message failed validation", 359 cause: err, 360 } 361 } 362 } 363 364 if v, ok := interface{}(m.GetStreamErrorOnInvalidHttpMessage()).(interface{ Validate() error }); ok { 365 if err := v.Validate(); err != nil { 366 return HttpConnectionManagerValidationError{ 367 field: "StreamErrorOnInvalidHttpMessage", 368 reason: "embedded message failed validation", 369 cause: err, 370 } 371 } 372 } 373 374 if v, ok := interface{}(m.GetPathNormalizationOptions()).(interface{ Validate() error }); ok { 375 if err := v.Validate(); err != nil { 376 return HttpConnectionManagerValidationError{ 377 field: "PathNormalizationOptions", 378 reason: "embedded message failed validation", 379 cause: err, 380 } 381 } 382 } 383 384 switch m.RouteSpecifier.(type) { 385 386 case *HttpConnectionManager_Rds: 387 388 if v, ok := interface{}(m.GetRds()).(interface{ Validate() error }); ok { 389 if err := v.Validate(); err != nil { 390 return HttpConnectionManagerValidationError{ 391 field: "Rds", 392 reason: "embedded message failed validation", 393 cause: err, 394 } 395 } 396 } 397 398 case *HttpConnectionManager_RouteConfig: 399 400 if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok { 401 if err := v.Validate(); err != nil { 402 return HttpConnectionManagerValidationError{ 403 field: "RouteConfig", 404 reason: "embedded message failed validation", 405 cause: err, 406 } 407 } 408 } 409 410 case *HttpConnectionManager_ScopedRoutes: 411 412 if v, ok := interface{}(m.GetScopedRoutes()).(interface{ Validate() error }); ok { 413 if err := v.Validate(); err != nil { 414 return HttpConnectionManagerValidationError{ 415 field: "ScopedRoutes", 416 reason: "embedded message failed validation", 417 cause: err, 418 } 419 } 420 } 421 422 default: 423 return HttpConnectionManagerValidationError{ 424 field: "RouteSpecifier", 425 reason: "value is required", 426 } 427 428 } 429 430 switch m.StripPortMode.(type) { 431 432 case *HttpConnectionManager_StripMatchingHostPort: 433 // no validation rules for StripMatchingHostPort 434 435 case *HttpConnectionManager_StripAnyHostPort: 436 // no validation rules for StripAnyHostPort 437 438 } 439 440 return nil 441} 442 443// HttpConnectionManagerValidationError is the validation error returned by 444// HttpConnectionManager.Validate if the designated constraints aren't met. 445type HttpConnectionManagerValidationError struct { 446 field string 447 reason string 448 cause error 449 key bool 450} 451 452// Field function returns field value. 453func (e HttpConnectionManagerValidationError) Field() string { return e.field } 454 455// Reason function returns reason value. 456func (e HttpConnectionManagerValidationError) Reason() string { return e.reason } 457 458// Cause function returns cause value. 459func (e HttpConnectionManagerValidationError) Cause() error { return e.cause } 460 461// Key function returns key value. 462func (e HttpConnectionManagerValidationError) Key() bool { return e.key } 463 464// ErrorName returns error name. 465func (e HttpConnectionManagerValidationError) ErrorName() string { 466 return "HttpConnectionManagerValidationError" 467} 468 469// Error satisfies the builtin error interface 470func (e HttpConnectionManagerValidationError) Error() string { 471 cause := "" 472 if e.cause != nil { 473 cause = fmt.Sprintf(" | caused by: %v", e.cause) 474 } 475 476 key := "" 477 if e.key { 478 key = "key for " 479 } 480 481 return fmt.Sprintf( 482 "invalid %sHttpConnectionManager.%s: %s%s", 483 key, 484 e.field, 485 e.reason, 486 cause) 487} 488 489var _ error = HttpConnectionManagerValidationError{} 490 491var _ interface { 492 Field() string 493 Reason() string 494 Key() bool 495 Cause() error 496 ErrorName() string 497} = HttpConnectionManagerValidationError{} 498 499var _HttpConnectionManager_ServerName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 500 501var _HttpConnectionManager_Via_Pattern = regexp.MustCompile("^[^\x00\n\r]*$") 502 503// Validate checks the field values on LocalReplyConfig with the rules defined 504// in the proto definition for this message. If any rules are violated, an 505// error is returned. 506func (m *LocalReplyConfig) Validate() error { 507 if m == nil { 508 return nil 509 } 510 511 for idx, item := range m.GetMappers() { 512 _, _ = idx, item 513 514 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 515 if err := v.Validate(); err != nil { 516 return LocalReplyConfigValidationError{ 517 field: fmt.Sprintf("Mappers[%v]", idx), 518 reason: "embedded message failed validation", 519 cause: err, 520 } 521 } 522 } 523 524 } 525 526 if v, ok := interface{}(m.GetBodyFormat()).(interface{ Validate() error }); ok { 527 if err := v.Validate(); err != nil { 528 return LocalReplyConfigValidationError{ 529 field: "BodyFormat", 530 reason: "embedded message failed validation", 531 cause: err, 532 } 533 } 534 } 535 536 return nil 537} 538 539// LocalReplyConfigValidationError is the validation error returned by 540// LocalReplyConfig.Validate if the designated constraints aren't met. 541type LocalReplyConfigValidationError struct { 542 field string 543 reason string 544 cause error 545 key bool 546} 547 548// Field function returns field value. 549func (e LocalReplyConfigValidationError) Field() string { return e.field } 550 551// Reason function returns reason value. 552func (e LocalReplyConfigValidationError) Reason() string { return e.reason } 553 554// Cause function returns cause value. 555func (e LocalReplyConfigValidationError) Cause() error { return e.cause } 556 557// Key function returns key value. 558func (e LocalReplyConfigValidationError) Key() bool { return e.key } 559 560// ErrorName returns error name. 561func (e LocalReplyConfigValidationError) ErrorName() string { return "LocalReplyConfigValidationError" } 562 563// Error satisfies the builtin error interface 564func (e LocalReplyConfigValidationError) Error() string { 565 cause := "" 566 if e.cause != nil { 567 cause = fmt.Sprintf(" | caused by: %v", e.cause) 568 } 569 570 key := "" 571 if e.key { 572 key = "key for " 573 } 574 575 return fmt.Sprintf( 576 "invalid %sLocalReplyConfig.%s: %s%s", 577 key, 578 e.field, 579 e.reason, 580 cause) 581} 582 583var _ error = LocalReplyConfigValidationError{} 584 585var _ interface { 586 Field() string 587 Reason() string 588 Key() bool 589 Cause() error 590 ErrorName() string 591} = LocalReplyConfigValidationError{} 592 593// Validate checks the field values on ResponseMapper with the rules defined in 594// the proto definition for this message. If any rules are violated, an error 595// is returned. 596func (m *ResponseMapper) Validate() error { 597 if m == nil { 598 return nil 599 } 600 601 if m.GetFilter() == nil { 602 return ResponseMapperValidationError{ 603 field: "Filter", 604 reason: "value is required", 605 } 606 } 607 608 if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { 609 if err := v.Validate(); err != nil { 610 return ResponseMapperValidationError{ 611 field: "Filter", 612 reason: "embedded message failed validation", 613 cause: err, 614 } 615 } 616 } 617 618 if wrapper := m.GetStatusCode(); wrapper != nil { 619 620 if val := wrapper.GetValue(); val < 200 || val >= 600 { 621 return ResponseMapperValidationError{ 622 field: "StatusCode", 623 reason: "value must be inside range [200, 600)", 624 } 625 } 626 627 } 628 629 if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok { 630 if err := v.Validate(); err != nil { 631 return ResponseMapperValidationError{ 632 field: "Body", 633 reason: "embedded message failed validation", 634 cause: err, 635 } 636 } 637 } 638 639 if v, ok := interface{}(m.GetBodyFormatOverride()).(interface{ Validate() error }); ok { 640 if err := v.Validate(); err != nil { 641 return ResponseMapperValidationError{ 642 field: "BodyFormatOverride", 643 reason: "embedded message failed validation", 644 cause: err, 645 } 646 } 647 } 648 649 if len(m.GetHeadersToAdd()) > 1000 { 650 return ResponseMapperValidationError{ 651 field: "HeadersToAdd", 652 reason: "value must contain no more than 1000 item(s)", 653 } 654 } 655 656 for idx, item := range m.GetHeadersToAdd() { 657 _, _ = idx, item 658 659 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 660 if err := v.Validate(); err != nil { 661 return ResponseMapperValidationError{ 662 field: fmt.Sprintf("HeadersToAdd[%v]", idx), 663 reason: "embedded message failed validation", 664 cause: err, 665 } 666 } 667 } 668 669 } 670 671 return nil 672} 673 674// ResponseMapperValidationError is the validation error returned by 675// ResponseMapper.Validate if the designated constraints aren't met. 676type ResponseMapperValidationError struct { 677 field string 678 reason string 679 cause error 680 key bool 681} 682 683// Field function returns field value. 684func (e ResponseMapperValidationError) Field() string { return e.field } 685 686// Reason function returns reason value. 687func (e ResponseMapperValidationError) Reason() string { return e.reason } 688 689// Cause function returns cause value. 690func (e ResponseMapperValidationError) Cause() error { return e.cause } 691 692// Key function returns key value. 693func (e ResponseMapperValidationError) Key() bool { return e.key } 694 695// ErrorName returns error name. 696func (e ResponseMapperValidationError) ErrorName() string { return "ResponseMapperValidationError" } 697 698// Error satisfies the builtin error interface 699func (e ResponseMapperValidationError) Error() string { 700 cause := "" 701 if e.cause != nil { 702 cause = fmt.Sprintf(" | caused by: %v", e.cause) 703 } 704 705 key := "" 706 if e.key { 707 key = "key for " 708 } 709 710 return fmt.Sprintf( 711 "invalid %sResponseMapper.%s: %s%s", 712 key, 713 e.field, 714 e.reason, 715 cause) 716} 717 718var _ error = ResponseMapperValidationError{} 719 720var _ interface { 721 Field() string 722 Reason() string 723 Key() bool 724 Cause() error 725 ErrorName() string 726} = ResponseMapperValidationError{} 727 728// Validate checks the field values on Rds with the rules defined in the proto 729// definition for this message. If any rules are violated, an error is returned. 730func (m *Rds) Validate() error { 731 if m == nil { 732 return nil 733 } 734 735 if m.GetConfigSource() == nil { 736 return RdsValidationError{ 737 field: "ConfigSource", 738 reason: "value is required", 739 } 740 } 741 742 if v, ok := interface{}(m.GetConfigSource()).(interface{ Validate() error }); ok { 743 if err := v.Validate(); err != nil { 744 return RdsValidationError{ 745 field: "ConfigSource", 746 reason: "embedded message failed validation", 747 cause: err, 748 } 749 } 750 } 751 752 // no validation rules for RouteConfigName 753 754 return nil 755} 756 757// RdsValidationError is the validation error returned by Rds.Validate if the 758// designated constraints aren't met. 759type RdsValidationError struct { 760 field string 761 reason string 762 cause error 763 key bool 764} 765 766// Field function returns field value. 767func (e RdsValidationError) Field() string { return e.field } 768 769// Reason function returns reason value. 770func (e RdsValidationError) Reason() string { return e.reason } 771 772// Cause function returns cause value. 773func (e RdsValidationError) Cause() error { return e.cause } 774 775// Key function returns key value. 776func (e RdsValidationError) Key() bool { return e.key } 777 778// ErrorName returns error name. 779func (e RdsValidationError) ErrorName() string { return "RdsValidationError" } 780 781// Error satisfies the builtin error interface 782func (e RdsValidationError) Error() string { 783 cause := "" 784 if e.cause != nil { 785 cause = fmt.Sprintf(" | caused by: %v", e.cause) 786 } 787 788 key := "" 789 if e.key { 790 key = "key for " 791 } 792 793 return fmt.Sprintf( 794 "invalid %sRds.%s: %s%s", 795 key, 796 e.field, 797 e.reason, 798 cause) 799} 800 801var _ error = RdsValidationError{} 802 803var _ interface { 804 Field() string 805 Reason() string 806 Key() bool 807 Cause() error 808 ErrorName() string 809} = RdsValidationError{} 810 811// Validate checks the field values on ScopedRouteConfigurationsList with the 812// rules defined in the proto definition for this message. If any rules are 813// violated, an error is returned. 814func (m *ScopedRouteConfigurationsList) Validate() error { 815 if m == nil { 816 return nil 817 } 818 819 if len(m.GetScopedRouteConfigurations()) < 1 { 820 return ScopedRouteConfigurationsListValidationError{ 821 field: "ScopedRouteConfigurations", 822 reason: "value must contain at least 1 item(s)", 823 } 824 } 825 826 for idx, item := range m.GetScopedRouteConfigurations() { 827 _, _ = idx, item 828 829 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 830 if err := v.Validate(); err != nil { 831 return ScopedRouteConfigurationsListValidationError{ 832 field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx), 833 reason: "embedded message failed validation", 834 cause: err, 835 } 836 } 837 } 838 839 } 840 841 return nil 842} 843 844// ScopedRouteConfigurationsListValidationError is the validation error 845// returned by ScopedRouteConfigurationsList.Validate if the designated 846// constraints aren't met. 847type ScopedRouteConfigurationsListValidationError struct { 848 field string 849 reason string 850 cause error 851 key bool 852} 853 854// Field function returns field value. 855func (e ScopedRouteConfigurationsListValidationError) Field() string { return e.field } 856 857// Reason function returns reason value. 858func (e ScopedRouteConfigurationsListValidationError) Reason() string { return e.reason } 859 860// Cause function returns cause value. 861func (e ScopedRouteConfigurationsListValidationError) Cause() error { return e.cause } 862 863// Key function returns key value. 864func (e ScopedRouteConfigurationsListValidationError) Key() bool { return e.key } 865 866// ErrorName returns error name. 867func (e ScopedRouteConfigurationsListValidationError) ErrorName() string { 868 return "ScopedRouteConfigurationsListValidationError" 869} 870 871// Error satisfies the builtin error interface 872func (e ScopedRouteConfigurationsListValidationError) Error() string { 873 cause := "" 874 if e.cause != nil { 875 cause = fmt.Sprintf(" | caused by: %v", e.cause) 876 } 877 878 key := "" 879 if e.key { 880 key = "key for " 881 } 882 883 return fmt.Sprintf( 884 "invalid %sScopedRouteConfigurationsList.%s: %s%s", 885 key, 886 e.field, 887 e.reason, 888 cause) 889} 890 891var _ error = ScopedRouteConfigurationsListValidationError{} 892 893var _ interface { 894 Field() string 895 Reason() string 896 Key() bool 897 Cause() error 898 ErrorName() string 899} = ScopedRouteConfigurationsListValidationError{} 900 901// Validate checks the field values on ScopedRoutes with the rules defined in 902// the proto definition for this message. If any rules are violated, an error 903// is returned. 904func (m *ScopedRoutes) Validate() error { 905 if m == nil { 906 return nil 907 } 908 909 if utf8.RuneCountInString(m.GetName()) < 1 { 910 return ScopedRoutesValidationError{ 911 field: "Name", 912 reason: "value length must be at least 1 runes", 913 } 914 } 915 916 if m.GetScopeKeyBuilder() == nil { 917 return ScopedRoutesValidationError{ 918 field: "ScopeKeyBuilder", 919 reason: "value is required", 920 } 921 } 922 923 if v, ok := interface{}(m.GetScopeKeyBuilder()).(interface{ Validate() error }); ok { 924 if err := v.Validate(); err != nil { 925 return ScopedRoutesValidationError{ 926 field: "ScopeKeyBuilder", 927 reason: "embedded message failed validation", 928 cause: err, 929 } 930 } 931 } 932 933 if m.GetRdsConfigSource() == nil { 934 return ScopedRoutesValidationError{ 935 field: "RdsConfigSource", 936 reason: "value is required", 937 } 938 } 939 940 if v, ok := interface{}(m.GetRdsConfigSource()).(interface{ Validate() error }); ok { 941 if err := v.Validate(); err != nil { 942 return ScopedRoutesValidationError{ 943 field: "RdsConfigSource", 944 reason: "embedded message failed validation", 945 cause: err, 946 } 947 } 948 } 949 950 switch m.ConfigSpecifier.(type) { 951 952 case *ScopedRoutes_ScopedRouteConfigurationsList: 953 954 if v, ok := interface{}(m.GetScopedRouteConfigurationsList()).(interface{ Validate() error }); ok { 955 if err := v.Validate(); err != nil { 956 return ScopedRoutesValidationError{ 957 field: "ScopedRouteConfigurationsList", 958 reason: "embedded message failed validation", 959 cause: err, 960 } 961 } 962 } 963 964 case *ScopedRoutes_ScopedRds: 965 966 if v, ok := interface{}(m.GetScopedRds()).(interface{ Validate() error }); ok { 967 if err := v.Validate(); err != nil { 968 return ScopedRoutesValidationError{ 969 field: "ScopedRds", 970 reason: "embedded message failed validation", 971 cause: err, 972 } 973 } 974 } 975 976 default: 977 return ScopedRoutesValidationError{ 978 field: "ConfigSpecifier", 979 reason: "value is required", 980 } 981 982 } 983 984 return nil 985} 986 987// ScopedRoutesValidationError is the validation error returned by 988// ScopedRoutes.Validate if the designated constraints aren't met. 989type ScopedRoutesValidationError struct { 990 field string 991 reason string 992 cause error 993 key bool 994} 995 996// Field function returns field value. 997func (e ScopedRoutesValidationError) Field() string { return e.field } 998 999// Reason function returns reason value. 1000func (e ScopedRoutesValidationError) Reason() string { return e.reason } 1001 1002// Cause function returns cause value. 1003func (e ScopedRoutesValidationError) Cause() error { return e.cause } 1004 1005// Key function returns key value. 1006func (e ScopedRoutesValidationError) Key() bool { return e.key } 1007 1008// ErrorName returns error name. 1009func (e ScopedRoutesValidationError) ErrorName() string { return "ScopedRoutesValidationError" } 1010 1011// Error satisfies the builtin error interface 1012func (e ScopedRoutesValidationError) Error() string { 1013 cause := "" 1014 if e.cause != nil { 1015 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1016 } 1017 1018 key := "" 1019 if e.key { 1020 key = "key for " 1021 } 1022 1023 return fmt.Sprintf( 1024 "invalid %sScopedRoutes.%s: %s%s", 1025 key, 1026 e.field, 1027 e.reason, 1028 cause) 1029} 1030 1031var _ error = ScopedRoutesValidationError{} 1032 1033var _ interface { 1034 Field() string 1035 Reason() string 1036 Key() bool 1037 Cause() error 1038 ErrorName() string 1039} = ScopedRoutesValidationError{} 1040 1041// Validate checks the field values on ScopedRds with the rules defined in the 1042// proto definition for this message. If any rules are violated, an error is returned. 1043func (m *ScopedRds) Validate() error { 1044 if m == nil { 1045 return nil 1046 } 1047 1048 if m.GetScopedRdsConfigSource() == nil { 1049 return ScopedRdsValidationError{ 1050 field: "ScopedRdsConfigSource", 1051 reason: "value is required", 1052 } 1053 } 1054 1055 if v, ok := interface{}(m.GetScopedRdsConfigSource()).(interface{ Validate() error }); ok { 1056 if err := v.Validate(); err != nil { 1057 return ScopedRdsValidationError{ 1058 field: "ScopedRdsConfigSource", 1059 reason: "embedded message failed validation", 1060 cause: err, 1061 } 1062 } 1063 } 1064 1065 // no validation rules for SrdsResourcesLocator 1066 1067 return nil 1068} 1069 1070// ScopedRdsValidationError is the validation error returned by 1071// ScopedRds.Validate if the designated constraints aren't met. 1072type ScopedRdsValidationError struct { 1073 field string 1074 reason string 1075 cause error 1076 key bool 1077} 1078 1079// Field function returns field value. 1080func (e ScopedRdsValidationError) Field() string { return e.field } 1081 1082// Reason function returns reason value. 1083func (e ScopedRdsValidationError) Reason() string { return e.reason } 1084 1085// Cause function returns cause value. 1086func (e ScopedRdsValidationError) Cause() error { return e.cause } 1087 1088// Key function returns key value. 1089func (e ScopedRdsValidationError) Key() bool { return e.key } 1090 1091// ErrorName returns error name. 1092func (e ScopedRdsValidationError) ErrorName() string { return "ScopedRdsValidationError" } 1093 1094// Error satisfies the builtin error interface 1095func (e ScopedRdsValidationError) Error() string { 1096 cause := "" 1097 if e.cause != nil { 1098 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1099 } 1100 1101 key := "" 1102 if e.key { 1103 key = "key for " 1104 } 1105 1106 return fmt.Sprintf( 1107 "invalid %sScopedRds.%s: %s%s", 1108 key, 1109 e.field, 1110 e.reason, 1111 cause) 1112} 1113 1114var _ error = ScopedRdsValidationError{} 1115 1116var _ interface { 1117 Field() string 1118 Reason() string 1119 Key() bool 1120 Cause() error 1121 ErrorName() string 1122} = ScopedRdsValidationError{} 1123 1124// Validate checks the field values on HttpFilter with the rules defined in the 1125// proto definition for this message. If any rules are violated, an error is returned. 1126func (m *HttpFilter) Validate() error { 1127 if m == nil { 1128 return nil 1129 } 1130 1131 if utf8.RuneCountInString(m.GetName()) < 1 { 1132 return HttpFilterValidationError{ 1133 field: "Name", 1134 reason: "value length must be at least 1 runes", 1135 } 1136 } 1137 1138 // no validation rules for IsOptional 1139 1140 switch m.ConfigType.(type) { 1141 1142 case *HttpFilter_TypedConfig: 1143 1144 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 1145 if err := v.Validate(); err != nil { 1146 return HttpFilterValidationError{ 1147 field: "TypedConfig", 1148 reason: "embedded message failed validation", 1149 cause: err, 1150 } 1151 } 1152 } 1153 1154 case *HttpFilter_ConfigDiscovery: 1155 1156 if v, ok := interface{}(m.GetConfigDiscovery()).(interface{ Validate() error }); ok { 1157 if err := v.Validate(); err != nil { 1158 return HttpFilterValidationError{ 1159 field: "ConfigDiscovery", 1160 reason: "embedded message failed validation", 1161 cause: err, 1162 } 1163 } 1164 } 1165 1166 } 1167 1168 return nil 1169} 1170 1171// HttpFilterValidationError is the validation error returned by 1172// HttpFilter.Validate if the designated constraints aren't met. 1173type HttpFilterValidationError struct { 1174 field string 1175 reason string 1176 cause error 1177 key bool 1178} 1179 1180// Field function returns field value. 1181func (e HttpFilterValidationError) Field() string { return e.field } 1182 1183// Reason function returns reason value. 1184func (e HttpFilterValidationError) Reason() string { return e.reason } 1185 1186// Cause function returns cause value. 1187func (e HttpFilterValidationError) Cause() error { return e.cause } 1188 1189// Key function returns key value. 1190func (e HttpFilterValidationError) Key() bool { return e.key } 1191 1192// ErrorName returns error name. 1193func (e HttpFilterValidationError) ErrorName() string { return "HttpFilterValidationError" } 1194 1195// Error satisfies the builtin error interface 1196func (e HttpFilterValidationError) Error() string { 1197 cause := "" 1198 if e.cause != nil { 1199 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1200 } 1201 1202 key := "" 1203 if e.key { 1204 key = "key for " 1205 } 1206 1207 return fmt.Sprintf( 1208 "invalid %sHttpFilter.%s: %s%s", 1209 key, 1210 e.field, 1211 e.reason, 1212 cause) 1213} 1214 1215var _ error = HttpFilterValidationError{} 1216 1217var _ interface { 1218 Field() string 1219 Reason() string 1220 Key() bool 1221 Cause() error 1222 ErrorName() string 1223} = HttpFilterValidationError{} 1224 1225// Validate checks the field values on RequestIDExtension with the rules 1226// defined in the proto definition for this message. If any rules are 1227// violated, an error is returned. 1228func (m *RequestIDExtension) Validate() error { 1229 if m == nil { 1230 return nil 1231 } 1232 1233 if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok { 1234 if err := v.Validate(); err != nil { 1235 return RequestIDExtensionValidationError{ 1236 field: "TypedConfig", 1237 reason: "embedded message failed validation", 1238 cause: err, 1239 } 1240 } 1241 } 1242 1243 return nil 1244} 1245 1246// RequestIDExtensionValidationError is the validation error returned by 1247// RequestIDExtension.Validate if the designated constraints aren't met. 1248type RequestIDExtensionValidationError struct { 1249 field string 1250 reason string 1251 cause error 1252 key bool 1253} 1254 1255// Field function returns field value. 1256func (e RequestIDExtensionValidationError) Field() string { return e.field } 1257 1258// Reason function returns reason value. 1259func (e RequestIDExtensionValidationError) Reason() string { return e.reason } 1260 1261// Cause function returns cause value. 1262func (e RequestIDExtensionValidationError) Cause() error { return e.cause } 1263 1264// Key function returns key value. 1265func (e RequestIDExtensionValidationError) Key() bool { return e.key } 1266 1267// ErrorName returns error name. 1268func (e RequestIDExtensionValidationError) ErrorName() string { 1269 return "RequestIDExtensionValidationError" 1270} 1271 1272// Error satisfies the builtin error interface 1273func (e RequestIDExtensionValidationError) Error() string { 1274 cause := "" 1275 if e.cause != nil { 1276 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1277 } 1278 1279 key := "" 1280 if e.key { 1281 key = "key for " 1282 } 1283 1284 return fmt.Sprintf( 1285 "invalid %sRequestIDExtension.%s: %s%s", 1286 key, 1287 e.field, 1288 e.reason, 1289 cause) 1290} 1291 1292var _ error = RequestIDExtensionValidationError{} 1293 1294var _ interface { 1295 Field() string 1296 Reason() string 1297 Key() bool 1298 Cause() error 1299 ErrorName() string 1300} = RequestIDExtensionValidationError{} 1301 1302// Validate checks the field values on HttpConnectionManager_Tracing with the 1303// rules defined in the proto definition for this message. If any rules are 1304// violated, an error is returned. 1305func (m *HttpConnectionManager_Tracing) Validate() error { 1306 if m == nil { 1307 return nil 1308 } 1309 1310 if v, ok := interface{}(m.GetClientSampling()).(interface{ Validate() error }); ok { 1311 if err := v.Validate(); err != nil { 1312 return HttpConnectionManager_TracingValidationError{ 1313 field: "ClientSampling", 1314 reason: "embedded message failed validation", 1315 cause: err, 1316 } 1317 } 1318 } 1319 1320 if v, ok := interface{}(m.GetRandomSampling()).(interface{ Validate() error }); ok { 1321 if err := v.Validate(); err != nil { 1322 return HttpConnectionManager_TracingValidationError{ 1323 field: "RandomSampling", 1324 reason: "embedded message failed validation", 1325 cause: err, 1326 } 1327 } 1328 } 1329 1330 if v, ok := interface{}(m.GetOverallSampling()).(interface{ Validate() error }); ok { 1331 if err := v.Validate(); err != nil { 1332 return HttpConnectionManager_TracingValidationError{ 1333 field: "OverallSampling", 1334 reason: "embedded message failed validation", 1335 cause: err, 1336 } 1337 } 1338 } 1339 1340 // no validation rules for Verbose 1341 1342 if v, ok := interface{}(m.GetMaxPathTagLength()).(interface{ Validate() error }); ok { 1343 if err := v.Validate(); err != nil { 1344 return HttpConnectionManager_TracingValidationError{ 1345 field: "MaxPathTagLength", 1346 reason: "embedded message failed validation", 1347 cause: err, 1348 } 1349 } 1350 } 1351 1352 for idx, item := range m.GetCustomTags() { 1353 _, _ = idx, item 1354 1355 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1356 if err := v.Validate(); err != nil { 1357 return HttpConnectionManager_TracingValidationError{ 1358 field: fmt.Sprintf("CustomTags[%v]", idx), 1359 reason: "embedded message failed validation", 1360 cause: err, 1361 } 1362 } 1363 } 1364 1365 } 1366 1367 if v, ok := interface{}(m.GetProvider()).(interface{ Validate() error }); ok { 1368 if err := v.Validate(); err != nil { 1369 return HttpConnectionManager_TracingValidationError{ 1370 field: "Provider", 1371 reason: "embedded message failed validation", 1372 cause: err, 1373 } 1374 } 1375 } 1376 1377 return nil 1378} 1379 1380// HttpConnectionManager_TracingValidationError is the validation error 1381// returned by HttpConnectionManager_Tracing.Validate if the designated 1382// constraints aren't met. 1383type HttpConnectionManager_TracingValidationError struct { 1384 field string 1385 reason string 1386 cause error 1387 key bool 1388} 1389 1390// Field function returns field value. 1391func (e HttpConnectionManager_TracingValidationError) Field() string { return e.field } 1392 1393// Reason function returns reason value. 1394func (e HttpConnectionManager_TracingValidationError) Reason() string { return e.reason } 1395 1396// Cause function returns cause value. 1397func (e HttpConnectionManager_TracingValidationError) Cause() error { return e.cause } 1398 1399// Key function returns key value. 1400func (e HttpConnectionManager_TracingValidationError) Key() bool { return e.key } 1401 1402// ErrorName returns error name. 1403func (e HttpConnectionManager_TracingValidationError) ErrorName() string { 1404 return "HttpConnectionManager_TracingValidationError" 1405} 1406 1407// Error satisfies the builtin error interface 1408func (e HttpConnectionManager_TracingValidationError) Error() string { 1409 cause := "" 1410 if e.cause != nil { 1411 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1412 } 1413 1414 key := "" 1415 if e.key { 1416 key = "key for " 1417 } 1418 1419 return fmt.Sprintf( 1420 "invalid %sHttpConnectionManager_Tracing.%s: %s%s", 1421 key, 1422 e.field, 1423 e.reason, 1424 cause) 1425} 1426 1427var _ error = HttpConnectionManager_TracingValidationError{} 1428 1429var _ interface { 1430 Field() string 1431 Reason() string 1432 Key() bool 1433 Cause() error 1434 ErrorName() string 1435} = HttpConnectionManager_TracingValidationError{} 1436 1437// Validate checks the field values on 1438// HttpConnectionManager_InternalAddressConfig with the rules defined in the 1439// proto definition for this message. If any rules are violated, an error is returned. 1440func (m *HttpConnectionManager_InternalAddressConfig) Validate() error { 1441 if m == nil { 1442 return nil 1443 } 1444 1445 // no validation rules for UnixSockets 1446 1447 return nil 1448} 1449 1450// HttpConnectionManager_InternalAddressConfigValidationError is the validation 1451// error returned by HttpConnectionManager_InternalAddressConfig.Validate if 1452// the designated constraints aren't met. 1453type HttpConnectionManager_InternalAddressConfigValidationError struct { 1454 field string 1455 reason string 1456 cause error 1457 key bool 1458} 1459 1460// Field function returns field value. 1461func (e HttpConnectionManager_InternalAddressConfigValidationError) Field() string { return e.field } 1462 1463// Reason function returns reason value. 1464func (e HttpConnectionManager_InternalAddressConfigValidationError) Reason() string { return e.reason } 1465 1466// Cause function returns cause value. 1467func (e HttpConnectionManager_InternalAddressConfigValidationError) Cause() error { return e.cause } 1468 1469// Key function returns key value. 1470func (e HttpConnectionManager_InternalAddressConfigValidationError) Key() bool { return e.key } 1471 1472// ErrorName returns error name. 1473func (e HttpConnectionManager_InternalAddressConfigValidationError) ErrorName() string { 1474 return "HttpConnectionManager_InternalAddressConfigValidationError" 1475} 1476 1477// Error satisfies the builtin error interface 1478func (e HttpConnectionManager_InternalAddressConfigValidationError) Error() string { 1479 cause := "" 1480 if e.cause != nil { 1481 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1482 } 1483 1484 key := "" 1485 if e.key { 1486 key = "key for " 1487 } 1488 1489 return fmt.Sprintf( 1490 "invalid %sHttpConnectionManager_InternalAddressConfig.%s: %s%s", 1491 key, 1492 e.field, 1493 e.reason, 1494 cause) 1495} 1496 1497var _ error = HttpConnectionManager_InternalAddressConfigValidationError{} 1498 1499var _ interface { 1500 Field() string 1501 Reason() string 1502 Key() bool 1503 Cause() error 1504 ErrorName() string 1505} = HttpConnectionManager_InternalAddressConfigValidationError{} 1506 1507// Validate checks the field values on 1508// HttpConnectionManager_SetCurrentClientCertDetails with the rules defined in 1509// the proto definition for this message. If any rules are violated, an error 1510// is returned. 1511func (m *HttpConnectionManager_SetCurrentClientCertDetails) Validate() error { 1512 if m == nil { 1513 return nil 1514 } 1515 1516 if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { 1517 if err := v.Validate(); err != nil { 1518 return HttpConnectionManager_SetCurrentClientCertDetailsValidationError{ 1519 field: "Subject", 1520 reason: "embedded message failed validation", 1521 cause: err, 1522 } 1523 } 1524 } 1525 1526 // no validation rules for Cert 1527 1528 // no validation rules for Chain 1529 1530 // no validation rules for Dns 1531 1532 // no validation rules for Uri 1533 1534 return nil 1535} 1536 1537// HttpConnectionManager_SetCurrentClientCertDetailsValidationError is the 1538// validation error returned by 1539// HttpConnectionManager_SetCurrentClientCertDetails.Validate if the 1540// designated constraints aren't met. 1541type HttpConnectionManager_SetCurrentClientCertDetailsValidationError struct { 1542 field string 1543 reason string 1544 cause error 1545 key bool 1546} 1547 1548// Field function returns field value. 1549func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Field() string { 1550 return e.field 1551} 1552 1553// Reason function returns reason value. 1554func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Reason() string { 1555 return e.reason 1556} 1557 1558// Cause function returns cause value. 1559func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Cause() error { 1560 return e.cause 1561} 1562 1563// Key function returns key value. 1564func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Key() bool { return e.key } 1565 1566// ErrorName returns error name. 1567func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) ErrorName() string { 1568 return "HttpConnectionManager_SetCurrentClientCertDetailsValidationError" 1569} 1570 1571// Error satisfies the builtin error interface 1572func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Error() string { 1573 cause := "" 1574 if e.cause != nil { 1575 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1576 } 1577 1578 key := "" 1579 if e.key { 1580 key = "key for " 1581 } 1582 1583 return fmt.Sprintf( 1584 "invalid %sHttpConnectionManager_SetCurrentClientCertDetails.%s: %s%s", 1585 key, 1586 e.field, 1587 e.reason, 1588 cause) 1589} 1590 1591var _ error = HttpConnectionManager_SetCurrentClientCertDetailsValidationError{} 1592 1593var _ interface { 1594 Field() string 1595 Reason() string 1596 Key() bool 1597 Cause() error 1598 ErrorName() string 1599} = HttpConnectionManager_SetCurrentClientCertDetailsValidationError{} 1600 1601// Validate checks the field values on HttpConnectionManager_UpgradeConfig with 1602// the rules defined in the proto definition for this message. If any rules 1603// are violated, an error is returned. 1604func (m *HttpConnectionManager_UpgradeConfig) Validate() error { 1605 if m == nil { 1606 return nil 1607 } 1608 1609 // no validation rules for UpgradeType 1610 1611 for idx, item := range m.GetFilters() { 1612 _, _ = idx, item 1613 1614 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1615 if err := v.Validate(); err != nil { 1616 return HttpConnectionManager_UpgradeConfigValidationError{ 1617 field: fmt.Sprintf("Filters[%v]", idx), 1618 reason: "embedded message failed validation", 1619 cause: err, 1620 } 1621 } 1622 } 1623 1624 } 1625 1626 if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok { 1627 if err := v.Validate(); err != nil { 1628 return HttpConnectionManager_UpgradeConfigValidationError{ 1629 field: "Enabled", 1630 reason: "embedded message failed validation", 1631 cause: err, 1632 } 1633 } 1634 } 1635 1636 return nil 1637} 1638 1639// HttpConnectionManager_UpgradeConfigValidationError is the validation error 1640// returned by HttpConnectionManager_UpgradeConfig.Validate if the designated 1641// constraints aren't met. 1642type HttpConnectionManager_UpgradeConfigValidationError struct { 1643 field string 1644 reason string 1645 cause error 1646 key bool 1647} 1648 1649// Field function returns field value. 1650func (e HttpConnectionManager_UpgradeConfigValidationError) Field() string { return e.field } 1651 1652// Reason function returns reason value. 1653func (e HttpConnectionManager_UpgradeConfigValidationError) Reason() string { return e.reason } 1654 1655// Cause function returns cause value. 1656func (e HttpConnectionManager_UpgradeConfigValidationError) Cause() error { return e.cause } 1657 1658// Key function returns key value. 1659func (e HttpConnectionManager_UpgradeConfigValidationError) Key() bool { return e.key } 1660 1661// ErrorName returns error name. 1662func (e HttpConnectionManager_UpgradeConfigValidationError) ErrorName() string { 1663 return "HttpConnectionManager_UpgradeConfigValidationError" 1664} 1665 1666// Error satisfies the builtin error interface 1667func (e HttpConnectionManager_UpgradeConfigValidationError) Error() string { 1668 cause := "" 1669 if e.cause != nil { 1670 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1671 } 1672 1673 key := "" 1674 if e.key { 1675 key = "key for " 1676 } 1677 1678 return fmt.Sprintf( 1679 "invalid %sHttpConnectionManager_UpgradeConfig.%s: %s%s", 1680 key, 1681 e.field, 1682 e.reason, 1683 cause) 1684} 1685 1686var _ error = HttpConnectionManager_UpgradeConfigValidationError{} 1687 1688var _ interface { 1689 Field() string 1690 Reason() string 1691 Key() bool 1692 Cause() error 1693 ErrorName() string 1694} = HttpConnectionManager_UpgradeConfigValidationError{} 1695 1696// Validate checks the field values on 1697// HttpConnectionManager_PathNormalizationOptions with the rules defined in 1698// the proto definition for this message. If any rules are violated, an error 1699// is returned. 1700func (m *HttpConnectionManager_PathNormalizationOptions) Validate() error { 1701 if m == nil { 1702 return nil 1703 } 1704 1705 if v, ok := interface{}(m.GetForwardingTransformation()).(interface{ Validate() error }); ok { 1706 if err := v.Validate(); err != nil { 1707 return HttpConnectionManager_PathNormalizationOptionsValidationError{ 1708 field: "ForwardingTransformation", 1709 reason: "embedded message failed validation", 1710 cause: err, 1711 } 1712 } 1713 } 1714 1715 if v, ok := interface{}(m.GetHttpFilterTransformation()).(interface{ Validate() error }); ok { 1716 if err := v.Validate(); err != nil { 1717 return HttpConnectionManager_PathNormalizationOptionsValidationError{ 1718 field: "HttpFilterTransformation", 1719 reason: "embedded message failed validation", 1720 cause: err, 1721 } 1722 } 1723 } 1724 1725 return nil 1726} 1727 1728// HttpConnectionManager_PathNormalizationOptionsValidationError is the 1729// validation error returned by 1730// HttpConnectionManager_PathNormalizationOptions.Validate if the designated 1731// constraints aren't met. 1732type HttpConnectionManager_PathNormalizationOptionsValidationError struct { 1733 field string 1734 reason string 1735 cause error 1736 key bool 1737} 1738 1739// Field function returns field value. 1740func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Field() string { return e.field } 1741 1742// Reason function returns reason value. 1743func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Reason() string { 1744 return e.reason 1745} 1746 1747// Cause function returns cause value. 1748func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Cause() error { return e.cause } 1749 1750// Key function returns key value. 1751func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Key() bool { return e.key } 1752 1753// ErrorName returns error name. 1754func (e HttpConnectionManager_PathNormalizationOptionsValidationError) ErrorName() string { 1755 return "HttpConnectionManager_PathNormalizationOptionsValidationError" 1756} 1757 1758// Error satisfies the builtin error interface 1759func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Error() string { 1760 cause := "" 1761 if e.cause != nil { 1762 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1763 } 1764 1765 key := "" 1766 if e.key { 1767 key = "key for " 1768 } 1769 1770 return fmt.Sprintf( 1771 "invalid %sHttpConnectionManager_PathNormalizationOptions.%s: %s%s", 1772 key, 1773 e.field, 1774 e.reason, 1775 cause) 1776} 1777 1778var _ error = HttpConnectionManager_PathNormalizationOptionsValidationError{} 1779 1780var _ interface { 1781 Field() string 1782 Reason() string 1783 Key() bool 1784 Cause() error 1785 ErrorName() string 1786} = HttpConnectionManager_PathNormalizationOptionsValidationError{} 1787 1788// Validate checks the field values on ScopedRoutes_ScopeKeyBuilder with the 1789// rules defined in the proto definition for this message. If any rules are 1790// violated, an error is returned. 1791func (m *ScopedRoutes_ScopeKeyBuilder) Validate() error { 1792 if m == nil { 1793 return nil 1794 } 1795 1796 if len(m.GetFragments()) < 1 { 1797 return ScopedRoutes_ScopeKeyBuilderValidationError{ 1798 field: "Fragments", 1799 reason: "value must contain at least 1 item(s)", 1800 } 1801 } 1802 1803 for idx, item := range m.GetFragments() { 1804 _, _ = idx, item 1805 1806 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 1807 if err := v.Validate(); err != nil { 1808 return ScopedRoutes_ScopeKeyBuilderValidationError{ 1809 field: fmt.Sprintf("Fragments[%v]", idx), 1810 reason: "embedded message failed validation", 1811 cause: err, 1812 } 1813 } 1814 } 1815 1816 } 1817 1818 return nil 1819} 1820 1821// ScopedRoutes_ScopeKeyBuilderValidationError is the validation error returned 1822// by ScopedRoutes_ScopeKeyBuilder.Validate if the designated constraints 1823// aren't met. 1824type ScopedRoutes_ScopeKeyBuilderValidationError struct { 1825 field string 1826 reason string 1827 cause error 1828 key bool 1829} 1830 1831// Field function returns field value. 1832func (e ScopedRoutes_ScopeKeyBuilderValidationError) Field() string { return e.field } 1833 1834// Reason function returns reason value. 1835func (e ScopedRoutes_ScopeKeyBuilderValidationError) Reason() string { return e.reason } 1836 1837// Cause function returns cause value. 1838func (e ScopedRoutes_ScopeKeyBuilderValidationError) Cause() error { return e.cause } 1839 1840// Key function returns key value. 1841func (e ScopedRoutes_ScopeKeyBuilderValidationError) Key() bool { return e.key } 1842 1843// ErrorName returns error name. 1844func (e ScopedRoutes_ScopeKeyBuilderValidationError) ErrorName() string { 1845 return "ScopedRoutes_ScopeKeyBuilderValidationError" 1846} 1847 1848// Error satisfies the builtin error interface 1849func (e ScopedRoutes_ScopeKeyBuilderValidationError) Error() string { 1850 cause := "" 1851 if e.cause != nil { 1852 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1853 } 1854 1855 key := "" 1856 if e.key { 1857 key = "key for " 1858 } 1859 1860 return fmt.Sprintf( 1861 "invalid %sScopedRoutes_ScopeKeyBuilder.%s: %s%s", 1862 key, 1863 e.field, 1864 e.reason, 1865 cause) 1866} 1867 1868var _ error = ScopedRoutes_ScopeKeyBuilderValidationError{} 1869 1870var _ interface { 1871 Field() string 1872 Reason() string 1873 Key() bool 1874 Cause() error 1875 ErrorName() string 1876} = ScopedRoutes_ScopeKeyBuilderValidationError{} 1877 1878// Validate checks the field values on 1879// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder with the rules defined in the 1880// proto definition for this message. If any rules are violated, an error is returned. 1881func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder) Validate() error { 1882 if m == nil { 1883 return nil 1884 } 1885 1886 switch m.Type.(type) { 1887 1888 case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_: 1889 1890 if v, ok := interface{}(m.GetHeaderValueExtractor()).(interface{ Validate() error }); ok { 1891 if err := v.Validate(); err != nil { 1892 return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{ 1893 field: "HeaderValueExtractor", 1894 reason: "embedded message failed validation", 1895 cause: err, 1896 } 1897 } 1898 } 1899 1900 default: 1901 return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{ 1902 field: "Type", 1903 reason: "value is required", 1904 } 1905 1906 } 1907 1908 return nil 1909} 1910 1911// ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError is the 1912// validation error returned by 1913// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder.Validate if the designated 1914// constraints aren't met. 1915type ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError struct { 1916 field string 1917 reason string 1918 cause error 1919 key bool 1920} 1921 1922// Field function returns field value. 1923func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Field() string { return e.field } 1924 1925// Reason function returns reason value. 1926func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Reason() string { return e.reason } 1927 1928// Cause function returns cause value. 1929func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Cause() error { return e.cause } 1930 1931// Key function returns key value. 1932func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Key() bool { return e.key } 1933 1934// ErrorName returns error name. 1935func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) ErrorName() string { 1936 return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError" 1937} 1938 1939// Error satisfies the builtin error interface 1940func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Error() string { 1941 cause := "" 1942 if e.cause != nil { 1943 cause = fmt.Sprintf(" | caused by: %v", e.cause) 1944 } 1945 1946 key := "" 1947 if e.key { 1948 key = "key for " 1949 } 1950 1951 return fmt.Sprintf( 1952 "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder.%s: %s%s", 1953 key, 1954 e.field, 1955 e.reason, 1956 cause) 1957} 1958 1959var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{} 1960 1961var _ interface { 1962 Field() string 1963 Reason() string 1964 Key() bool 1965 Cause() error 1966 ErrorName() string 1967} = ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{} 1968 1969// Validate checks the field values on 1970// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor with the 1971// rules defined in the proto definition for this message. If any rules are 1972// violated, an error is returned. 1973func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor) Validate() error { 1974 if m == nil { 1975 return nil 1976 } 1977 1978 if utf8.RuneCountInString(m.GetName()) < 1 { 1979 return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{ 1980 field: "Name", 1981 reason: "value length must be at least 1 runes", 1982 } 1983 } 1984 1985 // no validation rules for ElementSeparator 1986 1987 switch m.ExtractType.(type) { 1988 1989 case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_Index: 1990 // no validation rules for Index 1991 1992 case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_Element: 1993 1994 if v, ok := interface{}(m.GetElement()).(interface{ Validate() error }); ok { 1995 if err := v.Validate(); err != nil { 1996 return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{ 1997 field: "Element", 1998 reason: "embedded message failed validation", 1999 cause: err, 2000 } 2001 } 2002 } 2003 2004 } 2005 2006 return nil 2007} 2008 2009// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError 2010// is the validation error returned by 2011// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor.Validate 2012// if the designated constraints aren't met. 2013type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError struct { 2014 field string 2015 reason string 2016 cause error 2017 key bool 2018} 2019 2020// Field function returns field value. 2021func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Field() string { 2022 return e.field 2023} 2024 2025// Reason function returns reason value. 2026func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Reason() string { 2027 return e.reason 2028} 2029 2030// Cause function returns cause value. 2031func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Cause() error { 2032 return e.cause 2033} 2034 2035// Key function returns key value. 2036func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Key() bool { 2037 return e.key 2038} 2039 2040// ErrorName returns error name. 2041func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) ErrorName() string { 2042 return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError" 2043} 2044 2045// Error satisfies the builtin error interface 2046func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Error() string { 2047 cause := "" 2048 if e.cause != nil { 2049 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2050 } 2051 2052 key := "" 2053 if e.key { 2054 key = "key for " 2055 } 2056 2057 return fmt.Sprintf( 2058 "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor.%s: %s%s", 2059 key, 2060 e.field, 2061 e.reason, 2062 cause) 2063} 2064 2065var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{} 2066 2067var _ interface { 2068 Field() string 2069 Reason() string 2070 Key() bool 2071 Cause() error 2072 ErrorName() string 2073} = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{} 2074 2075// Validate checks the field values on 2076// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement 2077// with the rules defined in the proto definition for this message. If any 2078// rules are violated, an error is returned. 2079func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) Validate() error { 2080 if m == nil { 2081 return nil 2082 } 2083 2084 if utf8.RuneCountInString(m.GetSeparator()) < 1 { 2085 return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{ 2086 field: "Separator", 2087 reason: "value length must be at least 1 runes", 2088 } 2089 } 2090 2091 if utf8.RuneCountInString(m.GetKey()) < 1 { 2092 return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{ 2093 field: "Key", 2094 reason: "value length must be at least 1 runes", 2095 } 2096 } 2097 2098 return nil 2099} 2100 2101// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError 2102// is the validation error returned by 2103// ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement.Validate 2104// if the designated constraints aren't met. 2105type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError struct { 2106 field string 2107 reason string 2108 cause error 2109 key bool 2110} 2111 2112// Field function returns field value. 2113func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Field() string { 2114 return e.field 2115} 2116 2117// Reason function returns reason value. 2118func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Reason() string { 2119 return e.reason 2120} 2121 2122// Cause function returns cause value. 2123func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Cause() error { 2124 return e.cause 2125} 2126 2127// Key function returns key value. 2128func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Key() bool { 2129 return e.key 2130} 2131 2132// ErrorName returns error name. 2133func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) ErrorName() string { 2134 return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError" 2135} 2136 2137// Error satisfies the builtin error interface 2138func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Error() string { 2139 cause := "" 2140 if e.cause != nil { 2141 cause = fmt.Sprintf(" | caused by: %v", e.cause) 2142 } 2143 2144 key := "" 2145 if e.key { 2146 key = "key for " 2147 } 2148 2149 return fmt.Sprintf( 2150 "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement.%s: %s%s", 2151 key, 2152 e.field, 2153 e.reason, 2154 cause) 2155} 2156 2157var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{} 2158 2159var _ interface { 2160 Field() string 2161 Reason() string 2162 Key() bool 2163 Cause() error 2164 ErrorName() string 2165} = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{} 2166