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

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/service/status/v2/csds.proto
     3  
     4  package envoy_service_status_v2
     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  
    21  // ensure the imports are used
    22  var (
    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  	_ = anypb.Any{}
    34  )
    35  
    36  // Validate checks the field values on ClientStatusRequest with the rules
    37  // defined in the proto definition for this message. If any rules are
    38  // violated, an error is returned.
    39  func (m *ClientStatusRequest) Validate() error {
    40  	if m == nil {
    41  		return nil
    42  	}
    43  
    44  	for idx, item := range m.GetNodeMatchers() {
    45  		_, _ = idx, item
    46  
    47  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
    48  			if err := v.Validate(); err != nil {
    49  				return ClientStatusRequestValidationError{
    50  					field:  fmt.Sprintf("NodeMatchers[%v]", idx),
    51  					reason: "embedded message failed validation",
    52  					cause:  err,
    53  				}
    54  			}
    55  		}
    56  
    57  	}
    58  
    59  	return nil
    60  }
    61  
    62  // ClientStatusRequestValidationError is the validation error returned by
    63  // ClientStatusRequest.Validate if the designated constraints aren't met.
    64  type ClientStatusRequestValidationError struct {
    65  	field  string
    66  	reason string
    67  	cause  error
    68  	key    bool
    69  }
    70  
    71  // Field function returns field value.
    72  func (e ClientStatusRequestValidationError) Field() string { return e.field }
    73  
    74  // Reason function returns reason value.
    75  func (e ClientStatusRequestValidationError) Reason() string { return e.reason }
    76  
    77  // Cause function returns cause value.
    78  func (e ClientStatusRequestValidationError) Cause() error { return e.cause }
    79  
    80  // Key function returns key value.
    81  func (e ClientStatusRequestValidationError) Key() bool { return e.key }
    82  
    83  // ErrorName returns error name.
    84  func (e ClientStatusRequestValidationError) ErrorName() string {
    85  	return "ClientStatusRequestValidationError"
    86  }
    87  
    88  // Error satisfies the builtin error interface
    89  func (e ClientStatusRequestValidationError) Error() string {
    90  	cause := ""
    91  	if e.cause != nil {
    92  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
    93  	}
    94  
    95  	key := ""
    96  	if e.key {
    97  		key = "key for "
    98  	}
    99  
   100  	return fmt.Sprintf(
   101  		"invalid %sClientStatusRequest.%s: %s%s",
   102  		key,
   103  		e.field,
   104  		e.reason,
   105  		cause)
   106  }
   107  
   108  var _ error = ClientStatusRequestValidationError{}
   109  
   110  var _ interface {
   111  	Field() string
   112  	Reason() string
   113  	Key() bool
   114  	Cause() error
   115  	ErrorName() string
   116  } = ClientStatusRequestValidationError{}
   117  
   118  // Validate checks the field values on PerXdsConfig with the rules defined in
   119  // the proto definition for this message. If any rules are violated, an error
   120  // is returned.
   121  func (m *PerXdsConfig) Validate() error {
   122  	if m == nil {
   123  		return nil
   124  	}
   125  
   126  	// no validation rules for Status
   127  
   128  	switch m.PerXdsConfig.(type) {
   129  
   130  	case *PerXdsConfig_ListenerConfig:
   131  
   132  		if v, ok := interface{}(m.GetListenerConfig()).(interface{ Validate() error }); ok {
   133  			if err := v.Validate(); err != nil {
   134  				return PerXdsConfigValidationError{
   135  					field:  "ListenerConfig",
   136  					reason: "embedded message failed validation",
   137  					cause:  err,
   138  				}
   139  			}
   140  		}
   141  
   142  	case *PerXdsConfig_ClusterConfig:
   143  
   144  		if v, ok := interface{}(m.GetClusterConfig()).(interface{ Validate() error }); ok {
   145  			if err := v.Validate(); err != nil {
   146  				return PerXdsConfigValidationError{
   147  					field:  "ClusterConfig",
   148  					reason: "embedded message failed validation",
   149  					cause:  err,
   150  				}
   151  			}
   152  		}
   153  
   154  	case *PerXdsConfig_RouteConfig:
   155  
   156  		if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok {
   157  			if err := v.Validate(); err != nil {
   158  				return PerXdsConfigValidationError{
   159  					field:  "RouteConfig",
   160  					reason: "embedded message failed validation",
   161  					cause:  err,
   162  				}
   163  			}
   164  		}
   165  
   166  	case *PerXdsConfig_ScopedRouteConfig:
   167  
   168  		if v, ok := interface{}(m.GetScopedRouteConfig()).(interface{ Validate() error }); ok {
   169  			if err := v.Validate(); err != nil {
   170  				return PerXdsConfigValidationError{
   171  					field:  "ScopedRouteConfig",
   172  					reason: "embedded message failed validation",
   173  					cause:  err,
   174  				}
   175  			}
   176  		}
   177  
   178  	}
   179  
   180  	return nil
   181  }
   182  
   183  // PerXdsConfigValidationError is the validation error returned by
   184  // PerXdsConfig.Validate if the designated constraints aren't met.
   185  type PerXdsConfigValidationError struct {
   186  	field  string
   187  	reason string
   188  	cause  error
   189  	key    bool
   190  }
   191  
   192  // Field function returns field value.
   193  func (e PerXdsConfigValidationError) Field() string { return e.field }
   194  
   195  // Reason function returns reason value.
   196  func (e PerXdsConfigValidationError) Reason() string { return e.reason }
   197  
   198  // Cause function returns cause value.
   199  func (e PerXdsConfigValidationError) Cause() error { return e.cause }
   200  
   201  // Key function returns key value.
   202  func (e PerXdsConfigValidationError) Key() bool { return e.key }
   203  
   204  // ErrorName returns error name.
   205  func (e PerXdsConfigValidationError) ErrorName() string { return "PerXdsConfigValidationError" }
   206  
   207  // Error satisfies the builtin error interface
   208  func (e PerXdsConfigValidationError) Error() string {
   209  	cause := ""
   210  	if e.cause != nil {
   211  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   212  	}
   213  
   214  	key := ""
   215  	if e.key {
   216  		key = "key for "
   217  	}
   218  
   219  	return fmt.Sprintf(
   220  		"invalid %sPerXdsConfig.%s: %s%s",
   221  		key,
   222  		e.field,
   223  		e.reason,
   224  		cause)
   225  }
   226  
   227  var _ error = PerXdsConfigValidationError{}
   228  
   229  var _ interface {
   230  	Field() string
   231  	Reason() string
   232  	Key() bool
   233  	Cause() error
   234  	ErrorName() string
   235  } = PerXdsConfigValidationError{}
   236  
   237  // Validate checks the field values on ClientConfig with the rules defined in
   238  // the proto definition for this message. If any rules are violated, an error
   239  // is returned.
   240  func (m *ClientConfig) Validate() error {
   241  	if m == nil {
   242  		return nil
   243  	}
   244  
   245  	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
   246  		if err := v.Validate(); err != nil {
   247  			return ClientConfigValidationError{
   248  				field:  "Node",
   249  				reason: "embedded message failed validation",
   250  				cause:  err,
   251  			}
   252  		}
   253  	}
   254  
   255  	for idx, item := range m.GetXdsConfig() {
   256  		_, _ = idx, item
   257  
   258  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   259  			if err := v.Validate(); err != nil {
   260  				return ClientConfigValidationError{
   261  					field:  fmt.Sprintf("XdsConfig[%v]", idx),
   262  					reason: "embedded message failed validation",
   263  					cause:  err,
   264  				}
   265  			}
   266  		}
   267  
   268  	}
   269  
   270  	return nil
   271  }
   272  
   273  // ClientConfigValidationError is the validation error returned by
   274  // ClientConfig.Validate if the designated constraints aren't met.
   275  type ClientConfigValidationError struct {
   276  	field  string
   277  	reason string
   278  	cause  error
   279  	key    bool
   280  }
   281  
   282  // Field function returns field value.
   283  func (e ClientConfigValidationError) Field() string { return e.field }
   284  
   285  // Reason function returns reason value.
   286  func (e ClientConfigValidationError) Reason() string { return e.reason }
   287  
   288  // Cause function returns cause value.
   289  func (e ClientConfigValidationError) Cause() error { return e.cause }
   290  
   291  // Key function returns key value.
   292  func (e ClientConfigValidationError) Key() bool { return e.key }
   293  
   294  // ErrorName returns error name.
   295  func (e ClientConfigValidationError) ErrorName() string { return "ClientConfigValidationError" }
   296  
   297  // Error satisfies the builtin error interface
   298  func (e ClientConfigValidationError) Error() string {
   299  	cause := ""
   300  	if e.cause != nil {
   301  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   302  	}
   303  
   304  	key := ""
   305  	if e.key {
   306  		key = "key for "
   307  	}
   308  
   309  	return fmt.Sprintf(
   310  		"invalid %sClientConfig.%s: %s%s",
   311  		key,
   312  		e.field,
   313  		e.reason,
   314  		cause)
   315  }
   316  
   317  var _ error = ClientConfigValidationError{}
   318  
   319  var _ interface {
   320  	Field() string
   321  	Reason() string
   322  	Key() bool
   323  	Cause() error
   324  	ErrorName() string
   325  } = ClientConfigValidationError{}
   326  
   327  // Validate checks the field values on ClientStatusResponse with the rules
   328  // defined in the proto definition for this message. If any rules are
   329  // violated, an error is returned.
   330  func (m *ClientStatusResponse) Validate() error {
   331  	if m == nil {
   332  		return nil
   333  	}
   334  
   335  	for idx, item := range m.GetConfig() {
   336  		_, _ = idx, item
   337  
   338  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   339  			if err := v.Validate(); err != nil {
   340  				return ClientStatusResponseValidationError{
   341  					field:  fmt.Sprintf("Config[%v]", idx),
   342  					reason: "embedded message failed validation",
   343  					cause:  err,
   344  				}
   345  			}
   346  		}
   347  
   348  	}
   349  
   350  	return nil
   351  }
   352  
   353  // ClientStatusResponseValidationError is the validation error returned by
   354  // ClientStatusResponse.Validate if the designated constraints aren't met.
   355  type ClientStatusResponseValidationError struct {
   356  	field  string
   357  	reason string
   358  	cause  error
   359  	key    bool
   360  }
   361  
   362  // Field function returns field value.
   363  func (e ClientStatusResponseValidationError) Field() string { return e.field }
   364  
   365  // Reason function returns reason value.
   366  func (e ClientStatusResponseValidationError) Reason() string { return e.reason }
   367  
   368  // Cause function returns cause value.
   369  func (e ClientStatusResponseValidationError) Cause() error { return e.cause }
   370  
   371  // Key function returns key value.
   372  func (e ClientStatusResponseValidationError) Key() bool { return e.key }
   373  
   374  // ErrorName returns error name.
   375  func (e ClientStatusResponseValidationError) ErrorName() string {
   376  	return "ClientStatusResponseValidationError"
   377  }
   378  
   379  // Error satisfies the builtin error interface
   380  func (e ClientStatusResponseValidationError) Error() string {
   381  	cause := ""
   382  	if e.cause != nil {
   383  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   384  	}
   385  
   386  	key := ""
   387  	if e.key {
   388  		key = "key for "
   389  	}
   390  
   391  	return fmt.Sprintf(
   392  		"invalid %sClientStatusResponse.%s: %s%s",
   393  		key,
   394  		e.field,
   395  		e.reason,
   396  		cause)
   397  }
   398  
   399  var _ error = ClientStatusResponseValidationError{}
   400  
   401  var _ interface {
   402  	Field() string
   403  	Reason() string
   404  	Key() bool
   405  	Cause() error
   406  	ErrorName() string
   407  } = ClientStatusResponseValidationError{}