gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/api/v2/core/health_check.pb.validate.go (about)

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/api/v2/core/health_check.proto
     3  
     4  package envoy_api_v2_core
     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  	_type "gitee.com/ks-custle/core-gm/go-control-plane/envoy/type"
    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  	_ = _type.CodecClientType(0)
    38  )
    39  
    40  // Validate checks the field values on HealthCheck with the rules defined in
    41  // the proto definition for this message. If any rules are violated, an error
    42  // is returned.
    43  func (m *HealthCheck) Validate() error {
    44  	if m == nil {
    45  		return nil
    46  	}
    47  
    48  	if m.GetTimeout() == nil {
    49  		return HealthCheckValidationError{
    50  			field:  "Timeout",
    51  			reason: "value is required",
    52  		}
    53  	}
    54  
    55  	if d := m.GetTimeout(); d != nil {
    56  		dur, err := d.AsDuration(), d.CheckValid()
    57  		if err != nil {
    58  			return HealthCheckValidationError{
    59  				field:  "Timeout",
    60  				reason: "value is not a valid duration",
    61  				cause:  err,
    62  			}
    63  		}
    64  
    65  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
    66  
    67  		if dur <= gt {
    68  			return HealthCheckValidationError{
    69  				field:  "Timeout",
    70  				reason: "value must be greater than 0s",
    71  			}
    72  		}
    73  
    74  	}
    75  
    76  	if m.GetInterval() == nil {
    77  		return HealthCheckValidationError{
    78  			field:  "Interval",
    79  			reason: "value is required",
    80  		}
    81  	}
    82  
    83  	if d := m.GetInterval(); d != nil {
    84  		dur, err := d.AsDuration(), d.CheckValid()
    85  		if err != nil {
    86  			return HealthCheckValidationError{
    87  				field:  "Interval",
    88  				reason: "value is not a valid duration",
    89  				cause:  err,
    90  			}
    91  		}
    92  
    93  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
    94  
    95  		if dur <= gt {
    96  			return HealthCheckValidationError{
    97  				field:  "Interval",
    98  				reason: "value must be greater than 0s",
    99  			}
   100  		}
   101  
   102  	}
   103  
   104  	if v, ok := interface{}(m.GetInitialJitter()).(interface{ Validate() error }); ok {
   105  		if err := v.Validate(); err != nil {
   106  			return HealthCheckValidationError{
   107  				field:  "InitialJitter",
   108  				reason: "embedded message failed validation",
   109  				cause:  err,
   110  			}
   111  		}
   112  	}
   113  
   114  	if v, ok := interface{}(m.GetIntervalJitter()).(interface{ Validate() error }); ok {
   115  		if err := v.Validate(); err != nil {
   116  			return HealthCheckValidationError{
   117  				field:  "IntervalJitter",
   118  				reason: "embedded message failed validation",
   119  				cause:  err,
   120  			}
   121  		}
   122  	}
   123  
   124  	// no validation rules for IntervalJitterPercent
   125  
   126  	if m.GetUnhealthyThreshold() == nil {
   127  		return HealthCheckValidationError{
   128  			field:  "UnhealthyThreshold",
   129  			reason: "value is required",
   130  		}
   131  	}
   132  
   133  	if v, ok := interface{}(m.GetUnhealthyThreshold()).(interface{ Validate() error }); ok {
   134  		if err := v.Validate(); err != nil {
   135  			return HealthCheckValidationError{
   136  				field:  "UnhealthyThreshold",
   137  				reason: "embedded message failed validation",
   138  				cause:  err,
   139  			}
   140  		}
   141  	}
   142  
   143  	if m.GetHealthyThreshold() == nil {
   144  		return HealthCheckValidationError{
   145  			field:  "HealthyThreshold",
   146  			reason: "value is required",
   147  		}
   148  	}
   149  
   150  	if v, ok := interface{}(m.GetHealthyThreshold()).(interface{ Validate() error }); ok {
   151  		if err := v.Validate(); err != nil {
   152  			return HealthCheckValidationError{
   153  				field:  "HealthyThreshold",
   154  				reason: "embedded message failed validation",
   155  				cause:  err,
   156  			}
   157  		}
   158  	}
   159  
   160  	if v, ok := interface{}(m.GetAltPort()).(interface{ Validate() error }); ok {
   161  		if err := v.Validate(); err != nil {
   162  			return HealthCheckValidationError{
   163  				field:  "AltPort",
   164  				reason: "embedded message failed validation",
   165  				cause:  err,
   166  			}
   167  		}
   168  	}
   169  
   170  	if v, ok := interface{}(m.GetReuseConnection()).(interface{ Validate() error }); ok {
   171  		if err := v.Validate(); err != nil {
   172  			return HealthCheckValidationError{
   173  				field:  "ReuseConnection",
   174  				reason: "embedded message failed validation",
   175  				cause:  err,
   176  			}
   177  		}
   178  	}
   179  
   180  	if d := m.GetNoTrafficInterval(); d != nil {
   181  		dur, err := d.AsDuration(), d.CheckValid()
   182  		if err != nil {
   183  			return HealthCheckValidationError{
   184  				field:  "NoTrafficInterval",
   185  				reason: "value is not a valid duration",
   186  				cause:  err,
   187  			}
   188  		}
   189  
   190  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
   191  
   192  		if dur <= gt {
   193  			return HealthCheckValidationError{
   194  				field:  "NoTrafficInterval",
   195  				reason: "value must be greater than 0s",
   196  			}
   197  		}
   198  
   199  	}
   200  
   201  	if d := m.GetUnhealthyInterval(); d != nil {
   202  		dur, err := d.AsDuration(), d.CheckValid()
   203  		if err != nil {
   204  			return HealthCheckValidationError{
   205  				field:  "UnhealthyInterval",
   206  				reason: "value is not a valid duration",
   207  				cause:  err,
   208  			}
   209  		}
   210  
   211  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
   212  
   213  		if dur <= gt {
   214  			return HealthCheckValidationError{
   215  				field:  "UnhealthyInterval",
   216  				reason: "value must be greater than 0s",
   217  			}
   218  		}
   219  
   220  	}
   221  
   222  	if d := m.GetUnhealthyEdgeInterval(); d != nil {
   223  		dur, err := d.AsDuration(), d.CheckValid()
   224  		if err != nil {
   225  			return HealthCheckValidationError{
   226  				field:  "UnhealthyEdgeInterval",
   227  				reason: "value is not a valid duration",
   228  				cause:  err,
   229  			}
   230  		}
   231  
   232  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
   233  
   234  		if dur <= gt {
   235  			return HealthCheckValidationError{
   236  				field:  "UnhealthyEdgeInterval",
   237  				reason: "value must be greater than 0s",
   238  			}
   239  		}
   240  
   241  	}
   242  
   243  	if d := m.GetHealthyEdgeInterval(); d != nil {
   244  		dur, err := d.AsDuration(), d.CheckValid()
   245  		if err != nil {
   246  			return HealthCheckValidationError{
   247  				field:  "HealthyEdgeInterval",
   248  				reason: "value is not a valid duration",
   249  				cause:  err,
   250  			}
   251  		}
   252  
   253  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
   254  
   255  		if dur <= gt {
   256  			return HealthCheckValidationError{
   257  				field:  "HealthyEdgeInterval",
   258  				reason: "value must be greater than 0s",
   259  			}
   260  		}
   261  
   262  	}
   263  
   264  	// no validation rules for EventLogPath
   265  
   266  	if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok {
   267  		if err := v.Validate(); err != nil {
   268  			return HealthCheckValidationError{
   269  				field:  "EventService",
   270  				reason: "embedded message failed validation",
   271  				cause:  err,
   272  			}
   273  		}
   274  	}
   275  
   276  	// no validation rules for AlwaysLogHealthCheckFailures
   277  
   278  	if v, ok := interface{}(m.GetTlsOptions()).(interface{ Validate() error }); ok {
   279  		if err := v.Validate(); err != nil {
   280  			return HealthCheckValidationError{
   281  				field:  "TlsOptions",
   282  				reason: "embedded message failed validation",
   283  				cause:  err,
   284  			}
   285  		}
   286  	}
   287  
   288  	switch m.HealthChecker.(type) {
   289  
   290  	case *HealthCheck_HttpHealthCheck_:
   291  
   292  		if v, ok := interface{}(m.GetHttpHealthCheck()).(interface{ Validate() error }); ok {
   293  			if err := v.Validate(); err != nil {
   294  				return HealthCheckValidationError{
   295  					field:  "HttpHealthCheck",
   296  					reason: "embedded message failed validation",
   297  					cause:  err,
   298  				}
   299  			}
   300  		}
   301  
   302  	case *HealthCheck_TcpHealthCheck_:
   303  
   304  		if v, ok := interface{}(m.GetTcpHealthCheck()).(interface{ Validate() error }); ok {
   305  			if err := v.Validate(); err != nil {
   306  				return HealthCheckValidationError{
   307  					field:  "TcpHealthCheck",
   308  					reason: "embedded message failed validation",
   309  					cause:  err,
   310  				}
   311  			}
   312  		}
   313  
   314  	case *HealthCheck_GrpcHealthCheck_:
   315  
   316  		if v, ok := interface{}(m.GetGrpcHealthCheck()).(interface{ Validate() error }); ok {
   317  			if err := v.Validate(); err != nil {
   318  				return HealthCheckValidationError{
   319  					field:  "GrpcHealthCheck",
   320  					reason: "embedded message failed validation",
   321  					cause:  err,
   322  				}
   323  			}
   324  		}
   325  
   326  	case *HealthCheck_CustomHealthCheck_:
   327  
   328  		if v, ok := interface{}(m.GetCustomHealthCheck()).(interface{ Validate() error }); ok {
   329  			if err := v.Validate(); err != nil {
   330  				return HealthCheckValidationError{
   331  					field:  "CustomHealthCheck",
   332  					reason: "embedded message failed validation",
   333  					cause:  err,
   334  				}
   335  			}
   336  		}
   337  
   338  	default:
   339  		return HealthCheckValidationError{
   340  			field:  "HealthChecker",
   341  			reason: "value is required",
   342  		}
   343  
   344  	}
   345  
   346  	return nil
   347  }
   348  
   349  // HealthCheckValidationError is the validation error returned by
   350  // HealthCheck.Validate if the designated constraints aren't met.
   351  type HealthCheckValidationError struct {
   352  	field  string
   353  	reason string
   354  	cause  error
   355  	key    bool
   356  }
   357  
   358  // Field function returns field value.
   359  func (e HealthCheckValidationError) Field() string { return e.field }
   360  
   361  // Reason function returns reason value.
   362  func (e HealthCheckValidationError) Reason() string { return e.reason }
   363  
   364  // Cause function returns cause value.
   365  func (e HealthCheckValidationError) Cause() error { return e.cause }
   366  
   367  // Key function returns key value.
   368  func (e HealthCheckValidationError) Key() bool { return e.key }
   369  
   370  // ErrorName returns error name.
   371  func (e HealthCheckValidationError) ErrorName() string { return "HealthCheckValidationError" }
   372  
   373  // Error satisfies the builtin error interface
   374  func (e HealthCheckValidationError) Error() string {
   375  	cause := ""
   376  	if e.cause != nil {
   377  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   378  	}
   379  
   380  	key := ""
   381  	if e.key {
   382  		key = "key for "
   383  	}
   384  
   385  	return fmt.Sprintf(
   386  		"invalid %sHealthCheck.%s: %s%s",
   387  		key,
   388  		e.field,
   389  		e.reason,
   390  		cause)
   391  }
   392  
   393  var _ error = HealthCheckValidationError{}
   394  
   395  var _ interface {
   396  	Field() string
   397  	Reason() string
   398  	Key() bool
   399  	Cause() error
   400  	ErrorName() string
   401  } = HealthCheckValidationError{}
   402  
   403  // Validate checks the field values on HealthCheck_Payload with the rules
   404  // defined in the proto definition for this message. If any rules are
   405  // violated, an error is returned.
   406  func (m *HealthCheck_Payload) Validate() error {
   407  	if m == nil {
   408  		return nil
   409  	}
   410  
   411  	switch m.Payload.(type) {
   412  
   413  	case *HealthCheck_Payload_Text:
   414  
   415  		if len(m.GetText()) < 1 {
   416  			return HealthCheck_PayloadValidationError{
   417  				field:  "Text",
   418  				reason: "value length must be at least 1 bytes",
   419  			}
   420  		}
   421  
   422  	case *HealthCheck_Payload_Binary:
   423  		// no validation rules for Binary
   424  
   425  	default:
   426  		return HealthCheck_PayloadValidationError{
   427  			field:  "Payload",
   428  			reason: "value is required",
   429  		}
   430  
   431  	}
   432  
   433  	return nil
   434  }
   435  
   436  // HealthCheck_PayloadValidationError is the validation error returned by
   437  // HealthCheck_Payload.Validate if the designated constraints aren't met.
   438  type HealthCheck_PayloadValidationError struct {
   439  	field  string
   440  	reason string
   441  	cause  error
   442  	key    bool
   443  }
   444  
   445  // Field function returns field value.
   446  func (e HealthCheck_PayloadValidationError) Field() string { return e.field }
   447  
   448  // Reason function returns reason value.
   449  func (e HealthCheck_PayloadValidationError) Reason() string { return e.reason }
   450  
   451  // Cause function returns cause value.
   452  func (e HealthCheck_PayloadValidationError) Cause() error { return e.cause }
   453  
   454  // Key function returns key value.
   455  func (e HealthCheck_PayloadValidationError) Key() bool { return e.key }
   456  
   457  // ErrorName returns error name.
   458  func (e HealthCheck_PayloadValidationError) ErrorName() string {
   459  	return "HealthCheck_PayloadValidationError"
   460  }
   461  
   462  // Error satisfies the builtin error interface
   463  func (e HealthCheck_PayloadValidationError) Error() string {
   464  	cause := ""
   465  	if e.cause != nil {
   466  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   467  	}
   468  
   469  	key := ""
   470  	if e.key {
   471  		key = "key for "
   472  	}
   473  
   474  	return fmt.Sprintf(
   475  		"invalid %sHealthCheck_Payload.%s: %s%s",
   476  		key,
   477  		e.field,
   478  		e.reason,
   479  		cause)
   480  }
   481  
   482  var _ error = HealthCheck_PayloadValidationError{}
   483  
   484  var _ interface {
   485  	Field() string
   486  	Reason() string
   487  	Key() bool
   488  	Cause() error
   489  	ErrorName() string
   490  } = HealthCheck_PayloadValidationError{}
   491  
   492  // Validate checks the field values on HealthCheck_HttpHealthCheck with the
   493  // rules defined in the proto definition for this message. If any rules are
   494  // violated, an error is returned.
   495  func (m *HealthCheck_HttpHealthCheck) Validate() error {
   496  	if m == nil {
   497  		return nil
   498  	}
   499  
   500  	// no validation rules for Host
   501  
   502  	if len(m.GetPath()) < 1 {
   503  		return HealthCheck_HttpHealthCheckValidationError{
   504  			field:  "Path",
   505  			reason: "value length must be at least 1 bytes",
   506  		}
   507  	}
   508  
   509  	if v, ok := interface{}(m.GetSend()).(interface{ Validate() error }); ok {
   510  		if err := v.Validate(); err != nil {
   511  			return HealthCheck_HttpHealthCheckValidationError{
   512  				field:  "Send",
   513  				reason: "embedded message failed validation",
   514  				cause:  err,
   515  			}
   516  		}
   517  	}
   518  
   519  	if v, ok := interface{}(m.GetReceive()).(interface{ Validate() error }); ok {
   520  		if err := v.Validate(); err != nil {
   521  			return HealthCheck_HttpHealthCheckValidationError{
   522  				field:  "Receive",
   523  				reason: "embedded message failed validation",
   524  				cause:  err,
   525  			}
   526  		}
   527  	}
   528  
   529  	// no validation rules for ServiceName
   530  
   531  	if len(m.GetRequestHeadersToAdd()) > 1000 {
   532  		return HealthCheck_HttpHealthCheckValidationError{
   533  			field:  "RequestHeadersToAdd",
   534  			reason: "value must contain no more than 1000 item(s)",
   535  		}
   536  	}
   537  
   538  	for idx, item := range m.GetRequestHeadersToAdd() {
   539  		_, _ = idx, item
   540  
   541  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   542  			if err := v.Validate(); err != nil {
   543  				return HealthCheck_HttpHealthCheckValidationError{
   544  					field:  fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
   545  					reason: "embedded message failed validation",
   546  					cause:  err,
   547  				}
   548  			}
   549  		}
   550  
   551  	}
   552  
   553  	// no validation rules for UseHttp2
   554  
   555  	for idx, item := range m.GetExpectedStatuses() {
   556  		_, _ = idx, item
   557  
   558  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   559  			if err := v.Validate(); err != nil {
   560  				return HealthCheck_HttpHealthCheckValidationError{
   561  					field:  fmt.Sprintf("ExpectedStatuses[%v]", idx),
   562  					reason: "embedded message failed validation",
   563  					cause:  err,
   564  				}
   565  			}
   566  		}
   567  
   568  	}
   569  
   570  	if _, ok := _type.CodecClientType_name[int32(m.GetCodecClientType())]; !ok {
   571  		return HealthCheck_HttpHealthCheckValidationError{
   572  			field:  "CodecClientType",
   573  			reason: "value must be one of the defined enum values",
   574  		}
   575  	}
   576  
   577  	if v, ok := interface{}(m.GetServiceNameMatcher()).(interface{ Validate() error }); ok {
   578  		if err := v.Validate(); err != nil {
   579  			return HealthCheck_HttpHealthCheckValidationError{
   580  				field:  "ServiceNameMatcher",
   581  				reason: "embedded message failed validation",
   582  				cause:  err,
   583  			}
   584  		}
   585  	}
   586  
   587  	return nil
   588  }
   589  
   590  // HealthCheck_HttpHealthCheckValidationError is the validation error returned
   591  // by HealthCheck_HttpHealthCheck.Validate if the designated constraints
   592  // aren't met.
   593  type HealthCheck_HttpHealthCheckValidationError struct {
   594  	field  string
   595  	reason string
   596  	cause  error
   597  	key    bool
   598  }
   599  
   600  // Field function returns field value.
   601  func (e HealthCheck_HttpHealthCheckValidationError) Field() string { return e.field }
   602  
   603  // Reason function returns reason value.
   604  func (e HealthCheck_HttpHealthCheckValidationError) Reason() string { return e.reason }
   605  
   606  // Cause function returns cause value.
   607  func (e HealthCheck_HttpHealthCheckValidationError) Cause() error { return e.cause }
   608  
   609  // Key function returns key value.
   610  func (e HealthCheck_HttpHealthCheckValidationError) Key() bool { return e.key }
   611  
   612  // ErrorName returns error name.
   613  func (e HealthCheck_HttpHealthCheckValidationError) ErrorName() string {
   614  	return "HealthCheck_HttpHealthCheckValidationError"
   615  }
   616  
   617  // Error satisfies the builtin error interface
   618  func (e HealthCheck_HttpHealthCheckValidationError) Error() string {
   619  	cause := ""
   620  	if e.cause != nil {
   621  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   622  	}
   623  
   624  	key := ""
   625  	if e.key {
   626  		key = "key for "
   627  	}
   628  
   629  	return fmt.Sprintf(
   630  		"invalid %sHealthCheck_HttpHealthCheck.%s: %s%s",
   631  		key,
   632  		e.field,
   633  		e.reason,
   634  		cause)
   635  }
   636  
   637  var _ error = HealthCheck_HttpHealthCheckValidationError{}
   638  
   639  var _ interface {
   640  	Field() string
   641  	Reason() string
   642  	Key() bool
   643  	Cause() error
   644  	ErrorName() string
   645  } = HealthCheck_HttpHealthCheckValidationError{}
   646  
   647  // Validate checks the field values on HealthCheck_TcpHealthCheck with the
   648  // rules defined in the proto definition for this message. If any rules are
   649  // violated, an error is returned.
   650  func (m *HealthCheck_TcpHealthCheck) Validate() error {
   651  	if m == nil {
   652  		return nil
   653  	}
   654  
   655  	if v, ok := interface{}(m.GetSend()).(interface{ Validate() error }); ok {
   656  		if err := v.Validate(); err != nil {
   657  			return HealthCheck_TcpHealthCheckValidationError{
   658  				field:  "Send",
   659  				reason: "embedded message failed validation",
   660  				cause:  err,
   661  			}
   662  		}
   663  	}
   664  
   665  	for idx, item := range m.GetReceive() {
   666  		_, _ = idx, item
   667  
   668  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   669  			if err := v.Validate(); err != nil {
   670  				return HealthCheck_TcpHealthCheckValidationError{
   671  					field:  fmt.Sprintf("Receive[%v]", idx),
   672  					reason: "embedded message failed validation",
   673  					cause:  err,
   674  				}
   675  			}
   676  		}
   677  
   678  	}
   679  
   680  	return nil
   681  }
   682  
   683  // HealthCheck_TcpHealthCheckValidationError is the validation error returned
   684  // by HealthCheck_TcpHealthCheck.Validate if the designated constraints aren't met.
   685  type HealthCheck_TcpHealthCheckValidationError struct {
   686  	field  string
   687  	reason string
   688  	cause  error
   689  	key    bool
   690  }
   691  
   692  // Field function returns field value.
   693  func (e HealthCheck_TcpHealthCheckValidationError) Field() string { return e.field }
   694  
   695  // Reason function returns reason value.
   696  func (e HealthCheck_TcpHealthCheckValidationError) Reason() string { return e.reason }
   697  
   698  // Cause function returns cause value.
   699  func (e HealthCheck_TcpHealthCheckValidationError) Cause() error { return e.cause }
   700  
   701  // Key function returns key value.
   702  func (e HealthCheck_TcpHealthCheckValidationError) Key() bool { return e.key }
   703  
   704  // ErrorName returns error name.
   705  func (e HealthCheck_TcpHealthCheckValidationError) ErrorName() string {
   706  	return "HealthCheck_TcpHealthCheckValidationError"
   707  }
   708  
   709  // Error satisfies the builtin error interface
   710  func (e HealthCheck_TcpHealthCheckValidationError) Error() string {
   711  	cause := ""
   712  	if e.cause != nil {
   713  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   714  	}
   715  
   716  	key := ""
   717  	if e.key {
   718  		key = "key for "
   719  	}
   720  
   721  	return fmt.Sprintf(
   722  		"invalid %sHealthCheck_TcpHealthCheck.%s: %s%s",
   723  		key,
   724  		e.field,
   725  		e.reason,
   726  		cause)
   727  }
   728  
   729  var _ error = HealthCheck_TcpHealthCheckValidationError{}
   730  
   731  var _ interface {
   732  	Field() string
   733  	Reason() string
   734  	Key() bool
   735  	Cause() error
   736  	ErrorName() string
   737  } = HealthCheck_TcpHealthCheckValidationError{}
   738  
   739  // Validate checks the field values on HealthCheck_RedisHealthCheck with the
   740  // rules defined in the proto definition for this message. If any rules are
   741  // violated, an error is returned.
   742  func (m *HealthCheck_RedisHealthCheck) Validate() error {
   743  	if m == nil {
   744  		return nil
   745  	}
   746  
   747  	// no validation rules for Key
   748  
   749  	return nil
   750  }
   751  
   752  // HealthCheck_RedisHealthCheckValidationError is the validation error returned
   753  // by HealthCheck_RedisHealthCheck.Validate if the designated constraints
   754  // aren't met.
   755  type HealthCheck_RedisHealthCheckValidationError struct {
   756  	field  string
   757  	reason string
   758  	cause  error
   759  	key    bool
   760  }
   761  
   762  // Field function returns field value.
   763  func (e HealthCheck_RedisHealthCheckValidationError) Field() string { return e.field }
   764  
   765  // Reason function returns reason value.
   766  func (e HealthCheck_RedisHealthCheckValidationError) Reason() string { return e.reason }
   767  
   768  // Cause function returns cause value.
   769  func (e HealthCheck_RedisHealthCheckValidationError) Cause() error { return e.cause }
   770  
   771  // Key function returns key value.
   772  func (e HealthCheck_RedisHealthCheckValidationError) Key() bool { return e.key }
   773  
   774  // ErrorName returns error name.
   775  func (e HealthCheck_RedisHealthCheckValidationError) ErrorName() string {
   776  	return "HealthCheck_RedisHealthCheckValidationError"
   777  }
   778  
   779  // Error satisfies the builtin error interface
   780  func (e HealthCheck_RedisHealthCheckValidationError) Error() string {
   781  	cause := ""
   782  	if e.cause != nil {
   783  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   784  	}
   785  
   786  	key := ""
   787  	if e.key {
   788  		key = "key for "
   789  	}
   790  
   791  	return fmt.Sprintf(
   792  		"invalid %sHealthCheck_RedisHealthCheck.%s: %s%s",
   793  		key,
   794  		e.field,
   795  		e.reason,
   796  		cause)
   797  }
   798  
   799  var _ error = HealthCheck_RedisHealthCheckValidationError{}
   800  
   801  var _ interface {
   802  	Field() string
   803  	Reason() string
   804  	Key() bool
   805  	Cause() error
   806  	ErrorName() string
   807  } = HealthCheck_RedisHealthCheckValidationError{}
   808  
   809  // Validate checks the field values on HealthCheck_GrpcHealthCheck with the
   810  // rules defined in the proto definition for this message. If any rules are
   811  // violated, an error is returned.
   812  func (m *HealthCheck_GrpcHealthCheck) Validate() error {
   813  	if m == nil {
   814  		return nil
   815  	}
   816  
   817  	// no validation rules for ServiceName
   818  
   819  	// no validation rules for Authority
   820  
   821  	return nil
   822  }
   823  
   824  // HealthCheck_GrpcHealthCheckValidationError is the validation error returned
   825  // by HealthCheck_GrpcHealthCheck.Validate if the designated constraints
   826  // aren't met.
   827  type HealthCheck_GrpcHealthCheckValidationError struct {
   828  	field  string
   829  	reason string
   830  	cause  error
   831  	key    bool
   832  }
   833  
   834  // Field function returns field value.
   835  func (e HealthCheck_GrpcHealthCheckValidationError) Field() string { return e.field }
   836  
   837  // Reason function returns reason value.
   838  func (e HealthCheck_GrpcHealthCheckValidationError) Reason() string { return e.reason }
   839  
   840  // Cause function returns cause value.
   841  func (e HealthCheck_GrpcHealthCheckValidationError) Cause() error { return e.cause }
   842  
   843  // Key function returns key value.
   844  func (e HealthCheck_GrpcHealthCheckValidationError) Key() bool { return e.key }
   845  
   846  // ErrorName returns error name.
   847  func (e HealthCheck_GrpcHealthCheckValidationError) ErrorName() string {
   848  	return "HealthCheck_GrpcHealthCheckValidationError"
   849  }
   850  
   851  // Error satisfies the builtin error interface
   852  func (e HealthCheck_GrpcHealthCheckValidationError) Error() string {
   853  	cause := ""
   854  	if e.cause != nil {
   855  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   856  	}
   857  
   858  	key := ""
   859  	if e.key {
   860  		key = "key for "
   861  	}
   862  
   863  	return fmt.Sprintf(
   864  		"invalid %sHealthCheck_GrpcHealthCheck.%s: %s%s",
   865  		key,
   866  		e.field,
   867  		e.reason,
   868  		cause)
   869  }
   870  
   871  var _ error = HealthCheck_GrpcHealthCheckValidationError{}
   872  
   873  var _ interface {
   874  	Field() string
   875  	Reason() string
   876  	Key() bool
   877  	Cause() error
   878  	ErrorName() string
   879  } = HealthCheck_GrpcHealthCheckValidationError{}
   880  
   881  // Validate checks the field values on HealthCheck_CustomHealthCheck with the
   882  // rules defined in the proto definition for this message. If any rules are
   883  // violated, an error is returned.
   884  func (m *HealthCheck_CustomHealthCheck) Validate() error {
   885  	if m == nil {
   886  		return nil
   887  	}
   888  
   889  	if len(m.GetName()) < 1 {
   890  		return HealthCheck_CustomHealthCheckValidationError{
   891  			field:  "Name",
   892  			reason: "value length must be at least 1 bytes",
   893  		}
   894  	}
   895  
   896  	switch m.ConfigType.(type) {
   897  
   898  	case *HealthCheck_CustomHealthCheck_Config:
   899  
   900  		if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
   901  			if err := v.Validate(); err != nil {
   902  				return HealthCheck_CustomHealthCheckValidationError{
   903  					field:  "Config",
   904  					reason: "embedded message failed validation",
   905  					cause:  err,
   906  				}
   907  			}
   908  		}
   909  
   910  	case *HealthCheck_CustomHealthCheck_TypedConfig:
   911  
   912  		if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
   913  			if err := v.Validate(); err != nil {
   914  				return HealthCheck_CustomHealthCheckValidationError{
   915  					field:  "TypedConfig",
   916  					reason: "embedded message failed validation",
   917  					cause:  err,
   918  				}
   919  			}
   920  		}
   921  
   922  	}
   923  
   924  	return nil
   925  }
   926  
   927  // HealthCheck_CustomHealthCheckValidationError is the validation error
   928  // returned by HealthCheck_CustomHealthCheck.Validate if the designated
   929  // constraints aren't met.
   930  type HealthCheck_CustomHealthCheckValidationError struct {
   931  	field  string
   932  	reason string
   933  	cause  error
   934  	key    bool
   935  }
   936  
   937  // Field function returns field value.
   938  func (e HealthCheck_CustomHealthCheckValidationError) Field() string { return e.field }
   939  
   940  // Reason function returns reason value.
   941  func (e HealthCheck_CustomHealthCheckValidationError) Reason() string { return e.reason }
   942  
   943  // Cause function returns cause value.
   944  func (e HealthCheck_CustomHealthCheckValidationError) Cause() error { return e.cause }
   945  
   946  // Key function returns key value.
   947  func (e HealthCheck_CustomHealthCheckValidationError) Key() bool { return e.key }
   948  
   949  // ErrorName returns error name.
   950  func (e HealthCheck_CustomHealthCheckValidationError) ErrorName() string {
   951  	return "HealthCheck_CustomHealthCheckValidationError"
   952  }
   953  
   954  // Error satisfies the builtin error interface
   955  func (e HealthCheck_CustomHealthCheckValidationError) Error() string {
   956  	cause := ""
   957  	if e.cause != nil {
   958  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   959  	}
   960  
   961  	key := ""
   962  	if e.key {
   963  		key = "key for "
   964  	}
   965  
   966  	return fmt.Sprintf(
   967  		"invalid %sHealthCheck_CustomHealthCheck.%s: %s%s",
   968  		key,
   969  		e.field,
   970  		e.reason,
   971  		cause)
   972  }
   973  
   974  var _ error = HealthCheck_CustomHealthCheckValidationError{}
   975  
   976  var _ interface {
   977  	Field() string
   978  	Reason() string
   979  	Key() bool
   980  	Cause() error
   981  	ErrorName() string
   982  } = HealthCheck_CustomHealthCheckValidationError{}
   983  
   984  // Validate checks the field values on HealthCheck_TlsOptions with the rules
   985  // defined in the proto definition for this message. If any rules are
   986  // violated, an error is returned.
   987  func (m *HealthCheck_TlsOptions) Validate() error {
   988  	if m == nil {
   989  		return nil
   990  	}
   991  
   992  	return nil
   993  }
   994  
   995  // HealthCheck_TlsOptionsValidationError is the validation error returned by
   996  // HealthCheck_TlsOptions.Validate if the designated constraints aren't met.
   997  type HealthCheck_TlsOptionsValidationError struct {
   998  	field  string
   999  	reason string
  1000  	cause  error
  1001  	key    bool
  1002  }
  1003  
  1004  // Field function returns field value.
  1005  func (e HealthCheck_TlsOptionsValidationError) Field() string { return e.field }
  1006  
  1007  // Reason function returns reason value.
  1008  func (e HealthCheck_TlsOptionsValidationError) Reason() string { return e.reason }
  1009  
  1010  // Cause function returns cause value.
  1011  func (e HealthCheck_TlsOptionsValidationError) Cause() error { return e.cause }
  1012  
  1013  // Key function returns key value.
  1014  func (e HealthCheck_TlsOptionsValidationError) Key() bool { return e.key }
  1015  
  1016  // ErrorName returns error name.
  1017  func (e HealthCheck_TlsOptionsValidationError) ErrorName() string {
  1018  	return "HealthCheck_TlsOptionsValidationError"
  1019  }
  1020  
  1021  // Error satisfies the builtin error interface
  1022  func (e HealthCheck_TlsOptionsValidationError) Error() string {
  1023  	cause := ""
  1024  	if e.cause != nil {
  1025  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1026  	}
  1027  
  1028  	key := ""
  1029  	if e.key {
  1030  		key = "key for "
  1031  	}
  1032  
  1033  	return fmt.Sprintf(
  1034  		"invalid %sHealthCheck_TlsOptions.%s: %s%s",
  1035  		key,
  1036  		e.field,
  1037  		e.reason,
  1038  		cause)
  1039  }
  1040  
  1041  var _ error = HealthCheck_TlsOptionsValidationError{}
  1042  
  1043  var _ interface {
  1044  	Field() string
  1045  	Reason() string
  1046  	Key() bool
  1047  	Cause() error
  1048  	ErrorName() string
  1049  } = HealthCheck_TlsOptionsValidationError{}