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