...

Source file src/github.com/datawire/ambassador/v2/pkg/api/envoy/service/status/v4alpha/csds.pb.validate.go

Documentation: github.com/datawire/ambassador/v2/pkg/api/envoy/service/status/v4alpha

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

View as plain text