github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/service/status/v3/csds.pb.validate.go (about)

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/service/status/v3/csds.proto
     3  
     4  package envoy_service_status_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/admin/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.ClientResourceStatus(0)
    38  )
    39  
    40  // Validate checks the field values on ClientStatusRequest with the rules
    41  // defined in the proto definition for this message. If any rules are
    42  // violated, an error is returned.
    43  func (m *ClientStatusRequest) Validate() error {
    44  	if m == nil {
    45  		return nil
    46  	}
    47  
    48  	for idx, item := range m.GetNodeMatchers() {
    49  		_, _ = idx, item
    50  
    51  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
    52  			if err := v.Validate(); err != nil {
    53  				return ClientStatusRequestValidationError{
    54  					field:  fmt.Sprintf("NodeMatchers[%v]", idx),
    55  					reason: "embedded message failed validation",
    56  					cause:  err,
    57  				}
    58  			}
    59  		}
    60  
    61  	}
    62  
    63  	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
    64  		if err := v.Validate(); err != nil {
    65  			return ClientStatusRequestValidationError{
    66  				field:  "Node",
    67  				reason: "embedded message failed validation",
    68  				cause:  err,
    69  			}
    70  		}
    71  	}
    72  
    73  	return nil
    74  }
    75  
    76  // ClientStatusRequestValidationError is the validation error returned by
    77  // ClientStatusRequest.Validate if the designated constraints aren't met.
    78  type ClientStatusRequestValidationError struct {
    79  	field  string
    80  	reason string
    81  	cause  error
    82  	key    bool
    83  }
    84  
    85  // Field function returns field value.
    86  func (e ClientStatusRequestValidationError) Field() string { return e.field }
    87  
    88  // Reason function returns reason value.
    89  func (e ClientStatusRequestValidationError) Reason() string { return e.reason }
    90  
    91  // Cause function returns cause value.
    92  func (e ClientStatusRequestValidationError) Cause() error { return e.cause }
    93  
    94  // Key function returns key value.
    95  func (e ClientStatusRequestValidationError) Key() bool { return e.key }
    96  
    97  // ErrorName returns error name.
    98  func (e ClientStatusRequestValidationError) ErrorName() string {
    99  	return "ClientStatusRequestValidationError"
   100  }
   101  
   102  // Error satisfies the builtin error interface
   103  func (e ClientStatusRequestValidationError) Error() string {
   104  	cause := ""
   105  	if e.cause != nil {
   106  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   107  	}
   108  
   109  	key := ""
   110  	if e.key {
   111  		key = "key for "
   112  	}
   113  
   114  	return fmt.Sprintf(
   115  		"invalid %sClientStatusRequest.%s: %s%s",
   116  		key,
   117  		e.field,
   118  		e.reason,
   119  		cause)
   120  }
   121  
   122  var _ error = ClientStatusRequestValidationError{}
   123  
   124  var _ interface {
   125  	Field() string
   126  	Reason() string
   127  	Key() bool
   128  	Cause() error
   129  	ErrorName() string
   130  } = ClientStatusRequestValidationError{}
   131  
   132  // Validate checks the field values on PerXdsConfig with the rules defined in
   133  // the proto definition for this message. If any rules are violated, an error
   134  // is returned.
   135  func (m *PerXdsConfig) Validate() error {
   136  	if m == nil {
   137  		return nil
   138  	}
   139  
   140  	// no validation rules for Status
   141  
   142  	// no validation rules for ClientStatus
   143  
   144  	switch m.PerXdsConfig.(type) {
   145  
   146  	case *PerXdsConfig_ListenerConfig:
   147  
   148  		if v, ok := interface{}(m.GetListenerConfig()).(interface{ Validate() error }); ok {
   149  			if err := v.Validate(); err != nil {
   150  				return PerXdsConfigValidationError{
   151  					field:  "ListenerConfig",
   152  					reason: "embedded message failed validation",
   153  					cause:  err,
   154  				}
   155  			}
   156  		}
   157  
   158  	case *PerXdsConfig_ClusterConfig:
   159  
   160  		if v, ok := interface{}(m.GetClusterConfig()).(interface{ Validate() error }); ok {
   161  			if err := v.Validate(); err != nil {
   162  				return PerXdsConfigValidationError{
   163  					field:  "ClusterConfig",
   164  					reason: "embedded message failed validation",
   165  					cause:  err,
   166  				}
   167  			}
   168  		}
   169  
   170  	case *PerXdsConfig_RouteConfig:
   171  
   172  		if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok {
   173  			if err := v.Validate(); err != nil {
   174  				return PerXdsConfigValidationError{
   175  					field:  "RouteConfig",
   176  					reason: "embedded message failed validation",
   177  					cause:  err,
   178  				}
   179  			}
   180  		}
   181  
   182  	case *PerXdsConfig_ScopedRouteConfig:
   183  
   184  		if v, ok := interface{}(m.GetScopedRouteConfig()).(interface{ Validate() error }); ok {
   185  			if err := v.Validate(); err != nil {
   186  				return PerXdsConfigValidationError{
   187  					field:  "ScopedRouteConfig",
   188  					reason: "embedded message failed validation",
   189  					cause:  err,
   190  				}
   191  			}
   192  		}
   193  
   194  	case *PerXdsConfig_EndpointConfig:
   195  
   196  		if v, ok := interface{}(m.GetEndpointConfig()).(interface{ Validate() error }); ok {
   197  			if err := v.Validate(); err != nil {
   198  				return PerXdsConfigValidationError{
   199  					field:  "EndpointConfig",
   200  					reason: "embedded message failed validation",
   201  					cause:  err,
   202  				}
   203  			}
   204  		}
   205  
   206  	}
   207  
   208  	return nil
   209  }
   210  
   211  // PerXdsConfigValidationError is the validation error returned by
   212  // PerXdsConfig.Validate if the designated constraints aren't met.
   213  type PerXdsConfigValidationError struct {
   214  	field  string
   215  	reason string
   216  	cause  error
   217  	key    bool
   218  }
   219  
   220  // Field function returns field value.
   221  func (e PerXdsConfigValidationError) Field() string { return e.field }
   222  
   223  // Reason function returns reason value.
   224  func (e PerXdsConfigValidationError) Reason() string { return e.reason }
   225  
   226  // Cause function returns cause value.
   227  func (e PerXdsConfigValidationError) Cause() error { return e.cause }
   228  
   229  // Key function returns key value.
   230  func (e PerXdsConfigValidationError) Key() bool { return e.key }
   231  
   232  // ErrorName returns error name.
   233  func (e PerXdsConfigValidationError) ErrorName() string { return "PerXdsConfigValidationError" }
   234  
   235  // Error satisfies the builtin error interface
   236  func (e PerXdsConfigValidationError) Error() string {
   237  	cause := ""
   238  	if e.cause != nil {
   239  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   240  	}
   241  
   242  	key := ""
   243  	if e.key {
   244  		key = "key for "
   245  	}
   246  
   247  	return fmt.Sprintf(
   248  		"invalid %sPerXdsConfig.%s: %s%s",
   249  		key,
   250  		e.field,
   251  		e.reason,
   252  		cause)
   253  }
   254  
   255  var _ error = PerXdsConfigValidationError{}
   256  
   257  var _ interface {
   258  	Field() string
   259  	Reason() string
   260  	Key() bool
   261  	Cause() error
   262  	ErrorName() string
   263  } = PerXdsConfigValidationError{}
   264  
   265  // Validate checks the field values on ClientConfig with the rules defined in
   266  // the proto definition for this message. If any rules are violated, an error
   267  // is returned.
   268  func (m *ClientConfig) Validate() error {
   269  	if m == nil {
   270  		return nil
   271  	}
   272  
   273  	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
   274  		if err := v.Validate(); err != nil {
   275  			return ClientConfigValidationError{
   276  				field:  "Node",
   277  				reason: "embedded message failed validation",
   278  				cause:  err,
   279  			}
   280  		}
   281  	}
   282  
   283  	for idx, item := range m.GetXdsConfig() {
   284  		_, _ = idx, item
   285  
   286  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   287  			if err := v.Validate(); err != nil {
   288  				return ClientConfigValidationError{
   289  					field:  fmt.Sprintf("XdsConfig[%v]", idx),
   290  					reason: "embedded message failed validation",
   291  					cause:  err,
   292  				}
   293  			}
   294  		}
   295  
   296  	}
   297  
   298  	for idx, item := range m.GetGenericXdsConfigs() {
   299  		_, _ = idx, item
   300  
   301  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   302  			if err := v.Validate(); err != nil {
   303  				return ClientConfigValidationError{
   304  					field:  fmt.Sprintf("GenericXdsConfigs[%v]", idx),
   305  					reason: "embedded message failed validation",
   306  					cause:  err,
   307  				}
   308  			}
   309  		}
   310  
   311  	}
   312  
   313  	return nil
   314  }
   315  
   316  // ClientConfigValidationError is the validation error returned by
   317  // ClientConfig.Validate if the designated constraints aren't met.
   318  type ClientConfigValidationError struct {
   319  	field  string
   320  	reason string
   321  	cause  error
   322  	key    bool
   323  }
   324  
   325  // Field function returns field value.
   326  func (e ClientConfigValidationError) Field() string { return e.field }
   327  
   328  // Reason function returns reason value.
   329  func (e ClientConfigValidationError) Reason() string { return e.reason }
   330  
   331  // Cause function returns cause value.
   332  func (e ClientConfigValidationError) Cause() error { return e.cause }
   333  
   334  // Key function returns key value.
   335  func (e ClientConfigValidationError) Key() bool { return e.key }
   336  
   337  // ErrorName returns error name.
   338  func (e ClientConfigValidationError) ErrorName() string { return "ClientConfigValidationError" }
   339  
   340  // Error satisfies the builtin error interface
   341  func (e ClientConfigValidationError) Error() string {
   342  	cause := ""
   343  	if e.cause != nil {
   344  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   345  	}
   346  
   347  	key := ""
   348  	if e.key {
   349  		key = "key for "
   350  	}
   351  
   352  	return fmt.Sprintf(
   353  		"invalid %sClientConfig.%s: %s%s",
   354  		key,
   355  		e.field,
   356  		e.reason,
   357  		cause)
   358  }
   359  
   360  var _ error = ClientConfigValidationError{}
   361  
   362  var _ interface {
   363  	Field() string
   364  	Reason() string
   365  	Key() bool
   366  	Cause() error
   367  	ErrorName() string
   368  } = ClientConfigValidationError{}
   369  
   370  // Validate checks the field values on ClientStatusResponse with the rules
   371  // defined in the proto definition for this message. If any rules are
   372  // violated, an error is returned.
   373  func (m *ClientStatusResponse) Validate() error {
   374  	if m == nil {
   375  		return nil
   376  	}
   377  
   378  	for idx, item := range m.GetConfig() {
   379  		_, _ = idx, item
   380  
   381  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   382  			if err := v.Validate(); err != nil {
   383  				return ClientStatusResponseValidationError{
   384  					field:  fmt.Sprintf("Config[%v]", idx),
   385  					reason: "embedded message failed validation",
   386  					cause:  err,
   387  				}
   388  			}
   389  		}
   390  
   391  	}
   392  
   393  	return nil
   394  }
   395  
   396  // ClientStatusResponseValidationError is the validation error returned by
   397  // ClientStatusResponse.Validate if the designated constraints aren't met.
   398  type ClientStatusResponseValidationError struct {
   399  	field  string
   400  	reason string
   401  	cause  error
   402  	key    bool
   403  }
   404  
   405  // Field function returns field value.
   406  func (e ClientStatusResponseValidationError) Field() string { return e.field }
   407  
   408  // Reason function returns reason value.
   409  func (e ClientStatusResponseValidationError) Reason() string { return e.reason }
   410  
   411  // Cause function returns cause value.
   412  func (e ClientStatusResponseValidationError) Cause() error { return e.cause }
   413  
   414  // Key function returns key value.
   415  func (e ClientStatusResponseValidationError) Key() bool { return e.key }
   416  
   417  // ErrorName returns error name.
   418  func (e ClientStatusResponseValidationError) ErrorName() string {
   419  	return "ClientStatusResponseValidationError"
   420  }
   421  
   422  // Error satisfies the builtin error interface
   423  func (e ClientStatusResponseValidationError) Error() string {
   424  	cause := ""
   425  	if e.cause != nil {
   426  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   427  	}
   428  
   429  	key := ""
   430  	if e.key {
   431  		key = "key for "
   432  	}
   433  
   434  	return fmt.Sprintf(
   435  		"invalid %sClientStatusResponse.%s: %s%s",
   436  		key,
   437  		e.field,
   438  		e.reason,
   439  		cause)
   440  }
   441  
   442  var _ error = ClientStatusResponseValidationError{}
   443  
   444  var _ interface {
   445  	Field() string
   446  	Reason() string
   447  	Key() bool
   448  	Cause() error
   449  	ErrorName() string
   450  } = ClientStatusResponseValidationError{}
   451  
   452  // Validate checks the field values on ClientConfig_GenericXdsConfig with the
   453  // rules defined in the proto definition for this message. If any rules are
   454  // violated, an error is returned.
   455  func (m *ClientConfig_GenericXdsConfig) Validate() error {
   456  	if m == nil {
   457  		return nil
   458  	}
   459  
   460  	// no validation rules for TypeUrl
   461  
   462  	// no validation rules for Name
   463  
   464  	// no validation rules for VersionInfo
   465  
   466  	if v, ok := interface{}(m.GetXdsConfig()).(interface{ Validate() error }); ok {
   467  		if err := v.Validate(); err != nil {
   468  			return ClientConfig_GenericXdsConfigValidationError{
   469  				field:  "XdsConfig",
   470  				reason: "embedded message failed validation",
   471  				cause:  err,
   472  			}
   473  		}
   474  	}
   475  
   476  	if v, ok := interface{}(m.GetLastUpdated()).(interface{ Validate() error }); ok {
   477  		if err := v.Validate(); err != nil {
   478  			return ClientConfig_GenericXdsConfigValidationError{
   479  				field:  "LastUpdated",
   480  				reason: "embedded message failed validation",
   481  				cause:  err,
   482  			}
   483  		}
   484  	}
   485  
   486  	// no validation rules for ConfigStatus
   487  
   488  	// no validation rules for ClientStatus
   489  
   490  	if v, ok := interface{}(m.GetErrorState()).(interface{ Validate() error }); ok {
   491  		if err := v.Validate(); err != nil {
   492  			return ClientConfig_GenericXdsConfigValidationError{
   493  				field:  "ErrorState",
   494  				reason: "embedded message failed validation",
   495  				cause:  err,
   496  			}
   497  		}
   498  	}
   499  
   500  	// no validation rules for IsStaticResource
   501  
   502  	return nil
   503  }
   504  
   505  // ClientConfig_GenericXdsConfigValidationError is the validation error
   506  // returned by ClientConfig_GenericXdsConfig.Validate if the designated
   507  // constraints aren't met.
   508  type ClientConfig_GenericXdsConfigValidationError struct {
   509  	field  string
   510  	reason string
   511  	cause  error
   512  	key    bool
   513  }
   514  
   515  // Field function returns field value.
   516  func (e ClientConfig_GenericXdsConfigValidationError) Field() string { return e.field }
   517  
   518  // Reason function returns reason value.
   519  func (e ClientConfig_GenericXdsConfigValidationError) Reason() string { return e.reason }
   520  
   521  // Cause function returns cause value.
   522  func (e ClientConfig_GenericXdsConfigValidationError) Cause() error { return e.cause }
   523  
   524  // Key function returns key value.
   525  func (e ClientConfig_GenericXdsConfigValidationError) Key() bool { return e.key }
   526  
   527  // ErrorName returns error name.
   528  func (e ClientConfig_GenericXdsConfigValidationError) ErrorName() string {
   529  	return "ClientConfig_GenericXdsConfigValidationError"
   530  }
   531  
   532  // Error satisfies the builtin error interface
   533  func (e ClientConfig_GenericXdsConfigValidationError) Error() string {
   534  	cause := ""
   535  	if e.cause != nil {
   536  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   537  	}
   538  
   539  	key := ""
   540  	if e.key {
   541  		key = "key for "
   542  	}
   543  
   544  	return fmt.Sprintf(
   545  		"invalid %sClientConfig_GenericXdsConfig.%s: %s%s",
   546  		key,
   547  		e.field,
   548  		e.reason,
   549  		cause)
   550  }
   551  
   552  var _ error = ClientConfig_GenericXdsConfigValidationError{}
   553  
   554  var _ interface {
   555  	Field() string
   556  	Reason() string
   557  	Key() bool
   558  	Cause() error
   559  	ErrorName() string
   560  } = ClientConfig_GenericXdsConfigValidationError{}