github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/service/health/v3/hds.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/service/health/v3/hds.proto 3 4 package envoy_service_health_v3 5 6 import ( 7 "bytes" 8 "errors" 9 "fmt" 10 "net" 11 "net/mail" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 "google.golang.org/protobuf/types/known/anypb" 19 20 v3 "github.com/hxx258456/ccgo/go-control-plane/envoy/config/core/v3" 21 ) 22 23 // ensure the imports are used 24 var ( 25 _ = bytes.MinRead 26 _ = errors.New("") 27 _ = fmt.Print 28 _ = utf8.UTFMax 29 _ = (*regexp.Regexp)(nil) 30 _ = (*strings.Reader)(nil) 31 _ = net.IPv4len 32 _ = time.Duration(0) 33 _ = (*url.URL)(nil) 34 _ = (*mail.Address)(nil) 35 _ = anypb.Any{} 36 37 _ = v3.HealthStatus(0) 38 ) 39 40 // Validate checks the field values on Capability with the rules defined in the 41 // proto definition for this message. If any rules are violated, an error is returned. 42 func (m *Capability) Validate() error { 43 if m == nil { 44 return nil 45 } 46 47 return nil 48 } 49 50 // CapabilityValidationError is the validation error returned by 51 // Capability.Validate if the designated constraints aren't met. 52 type CapabilityValidationError struct { 53 field string 54 reason string 55 cause error 56 key bool 57 } 58 59 // Field function returns field value. 60 func (e CapabilityValidationError) Field() string { return e.field } 61 62 // Reason function returns reason value. 63 func (e CapabilityValidationError) Reason() string { return e.reason } 64 65 // Cause function returns cause value. 66 func (e CapabilityValidationError) Cause() error { return e.cause } 67 68 // Key function returns key value. 69 func (e CapabilityValidationError) Key() bool { return e.key } 70 71 // ErrorName returns error name. 72 func (e CapabilityValidationError) ErrorName() string { return "CapabilityValidationError" } 73 74 // Error satisfies the builtin error interface 75 func (e CapabilityValidationError) Error() string { 76 cause := "" 77 if e.cause != nil { 78 cause = fmt.Sprintf(" | caused by: %v", e.cause) 79 } 80 81 key := "" 82 if e.key { 83 key = "key for " 84 } 85 86 return fmt.Sprintf( 87 "invalid %sCapability.%s: %s%s", 88 key, 89 e.field, 90 e.reason, 91 cause) 92 } 93 94 var _ error = CapabilityValidationError{} 95 96 var _ interface { 97 Field() string 98 Reason() string 99 Key() bool 100 Cause() error 101 ErrorName() string 102 } = CapabilityValidationError{} 103 104 // Validate checks the field values on HealthCheckRequest with the rules 105 // defined in the proto definition for this message. If any rules are 106 // violated, an error is returned. 107 func (m *HealthCheckRequest) Validate() error { 108 if m == nil { 109 return nil 110 } 111 112 if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { 113 if err := v.Validate(); err != nil { 114 return HealthCheckRequestValidationError{ 115 field: "Node", 116 reason: "embedded message failed validation", 117 cause: err, 118 } 119 } 120 } 121 122 if v, ok := interface{}(m.GetCapability()).(interface{ Validate() error }); ok { 123 if err := v.Validate(); err != nil { 124 return HealthCheckRequestValidationError{ 125 field: "Capability", 126 reason: "embedded message failed validation", 127 cause: err, 128 } 129 } 130 } 131 132 return nil 133 } 134 135 // HealthCheckRequestValidationError is the validation error returned by 136 // HealthCheckRequest.Validate if the designated constraints aren't met. 137 type HealthCheckRequestValidationError struct { 138 field string 139 reason string 140 cause error 141 key bool 142 } 143 144 // Field function returns field value. 145 func (e HealthCheckRequestValidationError) Field() string { return e.field } 146 147 // Reason function returns reason value. 148 func (e HealthCheckRequestValidationError) Reason() string { return e.reason } 149 150 // Cause function returns cause value. 151 func (e HealthCheckRequestValidationError) Cause() error { return e.cause } 152 153 // Key function returns key value. 154 func (e HealthCheckRequestValidationError) Key() bool { return e.key } 155 156 // ErrorName returns error name. 157 func (e HealthCheckRequestValidationError) ErrorName() string { 158 return "HealthCheckRequestValidationError" 159 } 160 161 // Error satisfies the builtin error interface 162 func (e HealthCheckRequestValidationError) Error() string { 163 cause := "" 164 if e.cause != nil { 165 cause = fmt.Sprintf(" | caused by: %v", e.cause) 166 } 167 168 key := "" 169 if e.key { 170 key = "key for " 171 } 172 173 return fmt.Sprintf( 174 "invalid %sHealthCheckRequest.%s: %s%s", 175 key, 176 e.field, 177 e.reason, 178 cause) 179 } 180 181 var _ error = HealthCheckRequestValidationError{} 182 183 var _ interface { 184 Field() string 185 Reason() string 186 Key() bool 187 Cause() error 188 ErrorName() string 189 } = HealthCheckRequestValidationError{} 190 191 // Validate checks the field values on EndpointHealth with the rules defined in 192 // the proto definition for this message. If any rules are violated, an error 193 // is returned. 194 func (m *EndpointHealth) Validate() error { 195 if m == nil { 196 return nil 197 } 198 199 if v, ok := interface{}(m.GetEndpoint()).(interface{ Validate() error }); ok { 200 if err := v.Validate(); err != nil { 201 return EndpointHealthValidationError{ 202 field: "Endpoint", 203 reason: "embedded message failed validation", 204 cause: err, 205 } 206 } 207 } 208 209 // no validation rules for HealthStatus 210 211 return nil 212 } 213 214 // EndpointHealthValidationError is the validation error returned by 215 // EndpointHealth.Validate if the designated constraints aren't met. 216 type EndpointHealthValidationError struct { 217 field string 218 reason string 219 cause error 220 key bool 221 } 222 223 // Field function returns field value. 224 func (e EndpointHealthValidationError) Field() string { return e.field } 225 226 // Reason function returns reason value. 227 func (e EndpointHealthValidationError) Reason() string { return e.reason } 228 229 // Cause function returns cause value. 230 func (e EndpointHealthValidationError) Cause() error { return e.cause } 231 232 // Key function returns key value. 233 func (e EndpointHealthValidationError) Key() bool { return e.key } 234 235 // ErrorName returns error name. 236 func (e EndpointHealthValidationError) ErrorName() string { return "EndpointHealthValidationError" } 237 238 // Error satisfies the builtin error interface 239 func (e EndpointHealthValidationError) Error() string { 240 cause := "" 241 if e.cause != nil { 242 cause = fmt.Sprintf(" | caused by: %v", e.cause) 243 } 244 245 key := "" 246 if e.key { 247 key = "key for " 248 } 249 250 return fmt.Sprintf( 251 "invalid %sEndpointHealth.%s: %s%s", 252 key, 253 e.field, 254 e.reason, 255 cause) 256 } 257 258 var _ error = EndpointHealthValidationError{} 259 260 var _ interface { 261 Field() string 262 Reason() string 263 Key() bool 264 Cause() error 265 ErrorName() string 266 } = EndpointHealthValidationError{} 267 268 // Validate checks the field values on LocalityEndpointsHealth with the rules 269 // defined in the proto definition for this message. If any rules are 270 // violated, an error is returned. 271 func (m *LocalityEndpointsHealth) Validate() error { 272 if m == nil { 273 return nil 274 } 275 276 if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { 277 if err := v.Validate(); err != nil { 278 return LocalityEndpointsHealthValidationError{ 279 field: "Locality", 280 reason: "embedded message failed validation", 281 cause: err, 282 } 283 } 284 } 285 286 for idx, item := range m.GetEndpointsHealth() { 287 _, _ = idx, item 288 289 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 290 if err := v.Validate(); err != nil { 291 return LocalityEndpointsHealthValidationError{ 292 field: fmt.Sprintf("EndpointsHealth[%v]", idx), 293 reason: "embedded message failed validation", 294 cause: err, 295 } 296 } 297 } 298 299 } 300 301 return nil 302 } 303 304 // LocalityEndpointsHealthValidationError is the validation error returned by 305 // LocalityEndpointsHealth.Validate if the designated constraints aren't met. 306 type LocalityEndpointsHealthValidationError struct { 307 field string 308 reason string 309 cause error 310 key bool 311 } 312 313 // Field function returns field value. 314 func (e LocalityEndpointsHealthValidationError) Field() string { return e.field } 315 316 // Reason function returns reason value. 317 func (e LocalityEndpointsHealthValidationError) Reason() string { return e.reason } 318 319 // Cause function returns cause value. 320 func (e LocalityEndpointsHealthValidationError) Cause() error { return e.cause } 321 322 // Key function returns key value. 323 func (e LocalityEndpointsHealthValidationError) Key() bool { return e.key } 324 325 // ErrorName returns error name. 326 func (e LocalityEndpointsHealthValidationError) ErrorName() string { 327 return "LocalityEndpointsHealthValidationError" 328 } 329 330 // Error satisfies the builtin error interface 331 func (e LocalityEndpointsHealthValidationError) Error() string { 332 cause := "" 333 if e.cause != nil { 334 cause = fmt.Sprintf(" | caused by: %v", e.cause) 335 } 336 337 key := "" 338 if e.key { 339 key = "key for " 340 } 341 342 return fmt.Sprintf( 343 "invalid %sLocalityEndpointsHealth.%s: %s%s", 344 key, 345 e.field, 346 e.reason, 347 cause) 348 } 349 350 var _ error = LocalityEndpointsHealthValidationError{} 351 352 var _ interface { 353 Field() string 354 Reason() string 355 Key() bool 356 Cause() error 357 ErrorName() string 358 } = LocalityEndpointsHealthValidationError{} 359 360 // Validate checks the field values on ClusterEndpointsHealth with the rules 361 // defined in the proto definition for this message. If any rules are 362 // violated, an error is returned. 363 func (m *ClusterEndpointsHealth) Validate() error { 364 if m == nil { 365 return nil 366 } 367 368 // no validation rules for ClusterName 369 370 for idx, item := range m.GetLocalityEndpointsHealth() { 371 _, _ = idx, item 372 373 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 374 if err := v.Validate(); err != nil { 375 return ClusterEndpointsHealthValidationError{ 376 field: fmt.Sprintf("LocalityEndpointsHealth[%v]", idx), 377 reason: "embedded message failed validation", 378 cause: err, 379 } 380 } 381 } 382 383 } 384 385 return nil 386 } 387 388 // ClusterEndpointsHealthValidationError is the validation error returned by 389 // ClusterEndpointsHealth.Validate if the designated constraints aren't met. 390 type ClusterEndpointsHealthValidationError struct { 391 field string 392 reason string 393 cause error 394 key bool 395 } 396 397 // Field function returns field value. 398 func (e ClusterEndpointsHealthValidationError) Field() string { return e.field } 399 400 // Reason function returns reason value. 401 func (e ClusterEndpointsHealthValidationError) Reason() string { return e.reason } 402 403 // Cause function returns cause value. 404 func (e ClusterEndpointsHealthValidationError) Cause() error { return e.cause } 405 406 // Key function returns key value. 407 func (e ClusterEndpointsHealthValidationError) Key() bool { return e.key } 408 409 // ErrorName returns error name. 410 func (e ClusterEndpointsHealthValidationError) ErrorName() string { 411 return "ClusterEndpointsHealthValidationError" 412 } 413 414 // Error satisfies the builtin error interface 415 func (e ClusterEndpointsHealthValidationError) Error() string { 416 cause := "" 417 if e.cause != nil { 418 cause = fmt.Sprintf(" | caused by: %v", e.cause) 419 } 420 421 key := "" 422 if e.key { 423 key = "key for " 424 } 425 426 return fmt.Sprintf( 427 "invalid %sClusterEndpointsHealth.%s: %s%s", 428 key, 429 e.field, 430 e.reason, 431 cause) 432 } 433 434 var _ error = ClusterEndpointsHealthValidationError{} 435 436 var _ interface { 437 Field() string 438 Reason() string 439 Key() bool 440 Cause() error 441 ErrorName() string 442 } = ClusterEndpointsHealthValidationError{} 443 444 // Validate checks the field values on EndpointHealthResponse with the rules 445 // defined in the proto definition for this message. If any rules are 446 // violated, an error is returned. 447 func (m *EndpointHealthResponse) Validate() error { 448 if m == nil { 449 return nil 450 } 451 452 for idx, item := range m.GetEndpointsHealth() { 453 _, _ = idx, item 454 455 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 456 if err := v.Validate(); err != nil { 457 return EndpointHealthResponseValidationError{ 458 field: fmt.Sprintf("EndpointsHealth[%v]", idx), 459 reason: "embedded message failed validation", 460 cause: err, 461 } 462 } 463 } 464 465 } 466 467 for idx, item := range m.GetClusterEndpointsHealth() { 468 _, _ = idx, item 469 470 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 471 if err := v.Validate(); err != nil { 472 return EndpointHealthResponseValidationError{ 473 field: fmt.Sprintf("ClusterEndpointsHealth[%v]", idx), 474 reason: "embedded message failed validation", 475 cause: err, 476 } 477 } 478 } 479 480 } 481 482 return nil 483 } 484 485 // EndpointHealthResponseValidationError is the validation error returned by 486 // EndpointHealthResponse.Validate if the designated constraints aren't met. 487 type EndpointHealthResponseValidationError struct { 488 field string 489 reason string 490 cause error 491 key bool 492 } 493 494 // Field function returns field value. 495 func (e EndpointHealthResponseValidationError) Field() string { return e.field } 496 497 // Reason function returns reason value. 498 func (e EndpointHealthResponseValidationError) Reason() string { return e.reason } 499 500 // Cause function returns cause value. 501 func (e EndpointHealthResponseValidationError) Cause() error { return e.cause } 502 503 // Key function returns key value. 504 func (e EndpointHealthResponseValidationError) Key() bool { return e.key } 505 506 // ErrorName returns error name. 507 func (e EndpointHealthResponseValidationError) ErrorName() string { 508 return "EndpointHealthResponseValidationError" 509 } 510 511 // Error satisfies the builtin error interface 512 func (e EndpointHealthResponseValidationError) Error() string { 513 cause := "" 514 if e.cause != nil { 515 cause = fmt.Sprintf(" | caused by: %v", e.cause) 516 } 517 518 key := "" 519 if e.key { 520 key = "key for " 521 } 522 523 return fmt.Sprintf( 524 "invalid %sEndpointHealthResponse.%s: %s%s", 525 key, 526 e.field, 527 e.reason, 528 cause) 529 } 530 531 var _ error = EndpointHealthResponseValidationError{} 532 533 var _ interface { 534 Field() string 535 Reason() string 536 Key() bool 537 Cause() error 538 ErrorName() string 539 } = EndpointHealthResponseValidationError{} 540 541 // Validate checks the field values on 542 // HealthCheckRequestOrEndpointHealthResponse with the rules defined in the 543 // proto definition for this message. If any rules are violated, an error is returned. 544 func (m *HealthCheckRequestOrEndpointHealthResponse) Validate() error { 545 if m == nil { 546 return nil 547 } 548 549 switch m.RequestType.(type) { 550 551 case *HealthCheckRequestOrEndpointHealthResponse_HealthCheckRequest: 552 553 if v, ok := interface{}(m.GetHealthCheckRequest()).(interface{ Validate() error }); ok { 554 if err := v.Validate(); err != nil { 555 return HealthCheckRequestOrEndpointHealthResponseValidationError{ 556 field: "HealthCheckRequest", 557 reason: "embedded message failed validation", 558 cause: err, 559 } 560 } 561 } 562 563 case *HealthCheckRequestOrEndpointHealthResponse_EndpointHealthResponse: 564 565 if v, ok := interface{}(m.GetEndpointHealthResponse()).(interface{ Validate() error }); ok { 566 if err := v.Validate(); err != nil { 567 return HealthCheckRequestOrEndpointHealthResponseValidationError{ 568 field: "EndpointHealthResponse", 569 reason: "embedded message failed validation", 570 cause: err, 571 } 572 } 573 } 574 575 } 576 577 return nil 578 } 579 580 // HealthCheckRequestOrEndpointHealthResponseValidationError is the validation 581 // error returned by HealthCheckRequestOrEndpointHealthResponse.Validate if 582 // the designated constraints aren't met. 583 type HealthCheckRequestOrEndpointHealthResponseValidationError struct { 584 field string 585 reason string 586 cause error 587 key bool 588 } 589 590 // Field function returns field value. 591 func (e HealthCheckRequestOrEndpointHealthResponseValidationError) Field() string { return e.field } 592 593 // Reason function returns reason value. 594 func (e HealthCheckRequestOrEndpointHealthResponseValidationError) Reason() string { return e.reason } 595 596 // Cause function returns cause value. 597 func (e HealthCheckRequestOrEndpointHealthResponseValidationError) Cause() error { return e.cause } 598 599 // Key function returns key value. 600 func (e HealthCheckRequestOrEndpointHealthResponseValidationError) Key() bool { return e.key } 601 602 // ErrorName returns error name. 603 func (e HealthCheckRequestOrEndpointHealthResponseValidationError) ErrorName() string { 604 return "HealthCheckRequestOrEndpointHealthResponseValidationError" 605 } 606 607 // Error satisfies the builtin error interface 608 func (e HealthCheckRequestOrEndpointHealthResponseValidationError) Error() string { 609 cause := "" 610 if e.cause != nil { 611 cause = fmt.Sprintf(" | caused by: %v", e.cause) 612 } 613 614 key := "" 615 if e.key { 616 key = "key for " 617 } 618 619 return fmt.Sprintf( 620 "invalid %sHealthCheckRequestOrEndpointHealthResponse.%s: %s%s", 621 key, 622 e.field, 623 e.reason, 624 cause) 625 } 626 627 var _ error = HealthCheckRequestOrEndpointHealthResponseValidationError{} 628 629 var _ interface { 630 Field() string 631 Reason() string 632 Key() bool 633 Cause() error 634 ErrorName() string 635 } = HealthCheckRequestOrEndpointHealthResponseValidationError{} 636 637 // Validate checks the field values on LocalityEndpoints with the rules defined 638 // in the proto definition for this message. If any rules are violated, an 639 // error is returned. 640 func (m *LocalityEndpoints) Validate() error { 641 if m == nil { 642 return nil 643 } 644 645 if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { 646 if err := v.Validate(); err != nil { 647 return LocalityEndpointsValidationError{ 648 field: "Locality", 649 reason: "embedded message failed validation", 650 cause: err, 651 } 652 } 653 } 654 655 for idx, item := range m.GetEndpoints() { 656 _, _ = idx, item 657 658 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 659 if err := v.Validate(); err != nil { 660 return LocalityEndpointsValidationError{ 661 field: fmt.Sprintf("Endpoints[%v]", idx), 662 reason: "embedded message failed validation", 663 cause: err, 664 } 665 } 666 } 667 668 } 669 670 return nil 671 } 672 673 // LocalityEndpointsValidationError is the validation error returned by 674 // LocalityEndpoints.Validate if the designated constraints aren't met. 675 type LocalityEndpointsValidationError struct { 676 field string 677 reason string 678 cause error 679 key bool 680 } 681 682 // Field function returns field value. 683 func (e LocalityEndpointsValidationError) Field() string { return e.field } 684 685 // Reason function returns reason value. 686 func (e LocalityEndpointsValidationError) Reason() string { return e.reason } 687 688 // Cause function returns cause value. 689 func (e LocalityEndpointsValidationError) Cause() error { return e.cause } 690 691 // Key function returns key value. 692 func (e LocalityEndpointsValidationError) Key() bool { return e.key } 693 694 // ErrorName returns error name. 695 func (e LocalityEndpointsValidationError) ErrorName() string { 696 return "LocalityEndpointsValidationError" 697 } 698 699 // Error satisfies the builtin error interface 700 func (e LocalityEndpointsValidationError) Error() string { 701 cause := "" 702 if e.cause != nil { 703 cause = fmt.Sprintf(" | caused by: %v", e.cause) 704 } 705 706 key := "" 707 if e.key { 708 key = "key for " 709 } 710 711 return fmt.Sprintf( 712 "invalid %sLocalityEndpoints.%s: %s%s", 713 key, 714 e.field, 715 e.reason, 716 cause) 717 } 718 719 var _ error = LocalityEndpointsValidationError{} 720 721 var _ interface { 722 Field() string 723 Reason() string 724 Key() bool 725 Cause() error 726 ErrorName() string 727 } = LocalityEndpointsValidationError{} 728 729 // Validate checks the field values on ClusterHealthCheck with the rules 730 // defined in the proto definition for this message. If any rules are 731 // violated, an error is returned. 732 func (m *ClusterHealthCheck) Validate() error { 733 if m == nil { 734 return nil 735 } 736 737 // no validation rules for ClusterName 738 739 for idx, item := range m.GetHealthChecks() { 740 _, _ = idx, item 741 742 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 743 if err := v.Validate(); err != nil { 744 return ClusterHealthCheckValidationError{ 745 field: fmt.Sprintf("HealthChecks[%v]", idx), 746 reason: "embedded message failed validation", 747 cause: err, 748 } 749 } 750 } 751 752 } 753 754 for idx, item := range m.GetLocalityEndpoints() { 755 _, _ = idx, item 756 757 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 758 if err := v.Validate(); err != nil { 759 return ClusterHealthCheckValidationError{ 760 field: fmt.Sprintf("LocalityEndpoints[%v]", idx), 761 reason: "embedded message failed validation", 762 cause: err, 763 } 764 } 765 } 766 767 } 768 769 for idx, item := range m.GetTransportSocketMatches() { 770 _, _ = idx, item 771 772 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 773 if err := v.Validate(); err != nil { 774 return ClusterHealthCheckValidationError{ 775 field: fmt.Sprintf("TransportSocketMatches[%v]", idx), 776 reason: "embedded message failed validation", 777 cause: err, 778 } 779 } 780 } 781 782 } 783 784 return nil 785 } 786 787 // ClusterHealthCheckValidationError is the validation error returned by 788 // ClusterHealthCheck.Validate if the designated constraints aren't met. 789 type ClusterHealthCheckValidationError struct { 790 field string 791 reason string 792 cause error 793 key bool 794 } 795 796 // Field function returns field value. 797 func (e ClusterHealthCheckValidationError) Field() string { return e.field } 798 799 // Reason function returns reason value. 800 func (e ClusterHealthCheckValidationError) Reason() string { return e.reason } 801 802 // Cause function returns cause value. 803 func (e ClusterHealthCheckValidationError) Cause() error { return e.cause } 804 805 // Key function returns key value. 806 func (e ClusterHealthCheckValidationError) Key() bool { return e.key } 807 808 // ErrorName returns error name. 809 func (e ClusterHealthCheckValidationError) ErrorName() string { 810 return "ClusterHealthCheckValidationError" 811 } 812 813 // Error satisfies the builtin error interface 814 func (e ClusterHealthCheckValidationError) Error() string { 815 cause := "" 816 if e.cause != nil { 817 cause = fmt.Sprintf(" | caused by: %v", e.cause) 818 } 819 820 key := "" 821 if e.key { 822 key = "key for " 823 } 824 825 return fmt.Sprintf( 826 "invalid %sClusterHealthCheck.%s: %s%s", 827 key, 828 e.field, 829 e.reason, 830 cause) 831 } 832 833 var _ error = ClusterHealthCheckValidationError{} 834 835 var _ interface { 836 Field() string 837 Reason() string 838 Key() bool 839 Cause() error 840 ErrorName() string 841 } = ClusterHealthCheckValidationError{} 842 843 // Validate checks the field values on HealthCheckSpecifier with the rules 844 // defined in the proto definition for this message. If any rules are 845 // violated, an error is returned. 846 func (m *HealthCheckSpecifier) Validate() error { 847 if m == nil { 848 return nil 849 } 850 851 for idx, item := range m.GetClusterHealthChecks() { 852 _, _ = idx, item 853 854 if v, ok := interface{}(item).(interface{ Validate() error }); ok { 855 if err := v.Validate(); err != nil { 856 return HealthCheckSpecifierValidationError{ 857 field: fmt.Sprintf("ClusterHealthChecks[%v]", idx), 858 reason: "embedded message failed validation", 859 cause: err, 860 } 861 } 862 } 863 864 } 865 866 if v, ok := interface{}(m.GetInterval()).(interface{ Validate() error }); ok { 867 if err := v.Validate(); err != nil { 868 return HealthCheckSpecifierValidationError{ 869 field: "Interval", 870 reason: "embedded message failed validation", 871 cause: err, 872 } 873 } 874 } 875 876 return nil 877 } 878 879 // HealthCheckSpecifierValidationError is the validation error returned by 880 // HealthCheckSpecifier.Validate if the designated constraints aren't met. 881 type HealthCheckSpecifierValidationError struct { 882 field string 883 reason string 884 cause error 885 key bool 886 } 887 888 // Field function returns field value. 889 func (e HealthCheckSpecifierValidationError) Field() string { return e.field } 890 891 // Reason function returns reason value. 892 func (e HealthCheckSpecifierValidationError) Reason() string { return e.reason } 893 894 // Cause function returns cause value. 895 func (e HealthCheckSpecifierValidationError) Cause() error { return e.cause } 896 897 // Key function returns key value. 898 func (e HealthCheckSpecifierValidationError) Key() bool { return e.key } 899 900 // ErrorName returns error name. 901 func (e HealthCheckSpecifierValidationError) ErrorName() string { 902 return "HealthCheckSpecifierValidationError" 903 } 904 905 // Error satisfies the builtin error interface 906 func (e HealthCheckSpecifierValidationError) Error() string { 907 cause := "" 908 if e.cause != nil { 909 cause = fmt.Sprintf(" | caused by: %v", e.cause) 910 } 911 912 key := "" 913 if e.key { 914 key = "key for " 915 } 916 917 return fmt.Sprintf( 918 "invalid %sHealthCheckSpecifier.%s: %s%s", 919 key, 920 e.field, 921 e.reason, 922 cause) 923 } 924 925 var _ error = HealthCheckSpecifierValidationError{} 926 927 var _ interface { 928 Field() string 929 Reason() string 930 Key() bool 931 Cause() error 932 ErrorName() string 933 } = HealthCheckSpecifierValidationError{} 934 935 // Validate checks the field values on HdsDummy with the rules defined in the 936 // proto definition for this message. If any rules are violated, an error is returned. 937 func (m *HdsDummy) Validate() error { 938 if m == nil { 939 return nil 940 } 941 942 return nil 943 } 944 945 // HdsDummyValidationError is the validation error returned by 946 // HdsDummy.Validate if the designated constraints aren't met. 947 type HdsDummyValidationError struct { 948 field string 949 reason string 950 cause error 951 key bool 952 } 953 954 // Field function returns field value. 955 func (e HdsDummyValidationError) Field() string { return e.field } 956 957 // Reason function returns reason value. 958 func (e HdsDummyValidationError) Reason() string { return e.reason } 959 960 // Cause function returns cause value. 961 func (e HdsDummyValidationError) Cause() error { return e.cause } 962 963 // Key function returns key value. 964 func (e HdsDummyValidationError) Key() bool { return e.key } 965 966 // ErrorName returns error name. 967 func (e HdsDummyValidationError) ErrorName() string { return "HdsDummyValidationError" } 968 969 // Error satisfies the builtin error interface 970 func (e HdsDummyValidationError) Error() string { 971 cause := "" 972 if e.cause != nil { 973 cause = fmt.Sprintf(" | caused by: %v", e.cause) 974 } 975 976 key := "" 977 if e.key { 978 key = "key for " 979 } 980 981 return fmt.Sprintf( 982 "invalid %sHdsDummy.%s: %s%s", 983 key, 984 e.field, 985 e.reason, 986 cause) 987 } 988 989 var _ error = HdsDummyValidationError{} 990 991 var _ interface { 992 Field() string 993 Reason() string 994 Key() bool 995 Cause() error 996 ErrorName() string 997 } = HdsDummyValidationError{}