...

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

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

     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  	"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  	// no validation rules for Status
   137  
   138  	// no validation rules for ClientStatus
   139  
   140  	switch m.PerXdsConfig.(type) {
   141  
   142  	case *PerXdsConfig_ListenerConfig:
   143  
   144  		if v, ok := interface{}(m.GetListenerConfig()).(interface{ Validate() error }); ok {
   145  			if err := v.Validate(); err != nil {
   146  				return PerXdsConfigValidationError{
   147  					field:  "ListenerConfig",
   148  					reason: "embedded message failed validation",
   149  					cause:  err,
   150  				}
   151  			}
   152  		}
   153  
   154  	case *PerXdsConfig_ClusterConfig:
   155  
   156  		if v, ok := interface{}(m.GetClusterConfig()).(interface{ Validate() error }); ok {
   157  			if err := v.Validate(); err != nil {
   158  				return PerXdsConfigValidationError{
   159  					field:  "ClusterConfig",
   160  					reason: "embedded message failed validation",
   161  					cause:  err,
   162  				}
   163  			}
   164  		}
   165  
   166  	case *PerXdsConfig_RouteConfig:
   167  
   168  		if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok {
   169  			if err := v.Validate(); err != nil {
   170  				return PerXdsConfigValidationError{
   171  					field:  "RouteConfig",
   172  					reason: "embedded message failed validation",
   173  					cause:  err,
   174  				}
   175  			}
   176  		}
   177  
   178  	case *PerXdsConfig_ScopedRouteConfig:
   179  
   180  		if v, ok := interface{}(m.GetScopedRouteConfig()).(interface{ Validate() error }); ok {
   181  			if err := v.Validate(); err != nil {
   182  				return PerXdsConfigValidationError{
   183  					field:  "ScopedRouteConfig",
   184  					reason: "embedded message failed validation",
   185  					cause:  err,
   186  				}
   187  			}
   188  		}
   189  
   190  	case *PerXdsConfig_EndpointConfig:
   191  
   192  		if v, ok := interface{}(m.GetEndpointConfig()).(interface{ Validate() error }); ok {
   193  			if err := v.Validate(); err != nil {
   194  				return PerXdsConfigValidationError{
   195  					field:  "EndpointConfig",
   196  					reason: "embedded message failed validation",
   197  					cause:  err,
   198  				}
   199  			}
   200  		}
   201  
   202  	}
   203  
   204  	return nil
   205  }
   206  
   207  // PerXdsConfigValidationError is the validation error returned by
   208  // PerXdsConfig.Validate if the designated constraints aren't met.
   209  type PerXdsConfigValidationError struct {
   210  	field  string
   211  	reason string
   212  	cause  error
   213  	key    bool
   214  }
   215  
   216  // Field function returns field value.
   217  func (e PerXdsConfigValidationError) Field() string { return e.field }
   218  
   219  // Reason function returns reason value.
   220  func (e PerXdsConfigValidationError) Reason() string { return e.reason }
   221  
   222  // Cause function returns cause value.
   223  func (e PerXdsConfigValidationError) Cause() error { return e.cause }
   224  
   225  // Key function returns key value.
   226  func (e PerXdsConfigValidationError) Key() bool { return e.key }
   227  
   228  // ErrorName returns error name.
   229  func (e PerXdsConfigValidationError) ErrorName() string { return "PerXdsConfigValidationError" }
   230  
   231  // Error satisfies the builtin error interface
   232  func (e PerXdsConfigValidationError) Error() string {
   233  	cause := ""
   234  	if e.cause != nil {
   235  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   236  	}
   237  
   238  	key := ""
   239  	if e.key {
   240  		key = "key for "
   241  	}
   242  
   243  	return fmt.Sprintf(
   244  		"invalid %sPerXdsConfig.%s: %s%s",
   245  		key,
   246  		e.field,
   247  		e.reason,
   248  		cause)
   249  }
   250  
   251  var _ error = PerXdsConfigValidationError{}
   252  
   253  var _ interface {
   254  	Field() string
   255  	Reason() string
   256  	Key() bool
   257  	Cause() error
   258  	ErrorName() string
   259  } = PerXdsConfigValidationError{}
   260  
   261  // Validate checks the field values on ClientConfig with the rules defined in
   262  // the proto definition for this message. If any rules are violated, an error
   263  // is returned.
   264  func (m *ClientConfig) Validate() error {
   265  	if m == nil {
   266  		return nil
   267  	}
   268  
   269  	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
   270  		if err := v.Validate(); err != nil {
   271  			return ClientConfigValidationError{
   272  				field:  "Node",
   273  				reason: "embedded message failed validation",
   274  				cause:  err,
   275  			}
   276  		}
   277  	}
   278  
   279  	for idx, item := range m.GetXdsConfig() {
   280  		_, _ = idx, item
   281  
   282  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   283  			if err := v.Validate(); err != nil {
   284  				return ClientConfigValidationError{
   285  					field:  fmt.Sprintf("XdsConfig[%v]", idx),
   286  					reason: "embedded message failed validation",
   287  					cause:  err,
   288  				}
   289  			}
   290  		}
   291  
   292  	}
   293  
   294  	return nil
   295  }
   296  
   297  // ClientConfigValidationError is the validation error returned by
   298  // ClientConfig.Validate if the designated constraints aren't met.
   299  type ClientConfigValidationError struct {
   300  	field  string
   301  	reason string
   302  	cause  error
   303  	key    bool
   304  }
   305  
   306  // Field function returns field value.
   307  func (e ClientConfigValidationError) Field() string { return e.field }
   308  
   309  // Reason function returns reason value.
   310  func (e ClientConfigValidationError) Reason() string { return e.reason }
   311  
   312  // Cause function returns cause value.
   313  func (e ClientConfigValidationError) Cause() error { return e.cause }
   314  
   315  // Key function returns key value.
   316  func (e ClientConfigValidationError) Key() bool { return e.key }
   317  
   318  // ErrorName returns error name.
   319  func (e ClientConfigValidationError) ErrorName() string { return "ClientConfigValidationError" }
   320  
   321  // Error satisfies the builtin error interface
   322  func (e ClientConfigValidationError) Error() string {
   323  	cause := ""
   324  	if e.cause != nil {
   325  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   326  	}
   327  
   328  	key := ""
   329  	if e.key {
   330  		key = "key for "
   331  	}
   332  
   333  	return fmt.Sprintf(
   334  		"invalid %sClientConfig.%s: %s%s",
   335  		key,
   336  		e.field,
   337  		e.reason,
   338  		cause)
   339  }
   340  
   341  var _ error = ClientConfigValidationError{}
   342  
   343  var _ interface {
   344  	Field() string
   345  	Reason() string
   346  	Key() bool
   347  	Cause() error
   348  	ErrorName() string
   349  } = ClientConfigValidationError{}
   350  
   351  // Validate checks the field values on ClientStatusResponse with the rules
   352  // defined in the proto definition for this message. If any rules are
   353  // violated, an error is returned.
   354  func (m *ClientStatusResponse) Validate() error {
   355  	if m == nil {
   356  		return nil
   357  	}
   358  
   359  	for idx, item := range m.GetConfig() {
   360  		_, _ = idx, item
   361  
   362  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   363  			if err := v.Validate(); err != nil {
   364  				return ClientStatusResponseValidationError{
   365  					field:  fmt.Sprintf("Config[%v]", idx),
   366  					reason: "embedded message failed validation",
   367  					cause:  err,
   368  				}
   369  			}
   370  		}
   371  
   372  	}
   373  
   374  	return nil
   375  }
   376  
   377  // ClientStatusResponseValidationError is the validation error returned by
   378  // ClientStatusResponse.Validate if the designated constraints aren't met.
   379  type ClientStatusResponseValidationError struct {
   380  	field  string
   381  	reason string
   382  	cause  error
   383  	key    bool
   384  }
   385  
   386  // Field function returns field value.
   387  func (e ClientStatusResponseValidationError) Field() string { return e.field }
   388  
   389  // Reason function returns reason value.
   390  func (e ClientStatusResponseValidationError) Reason() string { return e.reason }
   391  
   392  // Cause function returns cause value.
   393  func (e ClientStatusResponseValidationError) Cause() error { return e.cause }
   394  
   395  // Key function returns key value.
   396  func (e ClientStatusResponseValidationError) Key() bool { return e.key }
   397  
   398  // ErrorName returns error name.
   399  func (e ClientStatusResponseValidationError) ErrorName() string {
   400  	return "ClientStatusResponseValidationError"
   401  }
   402  
   403  // Error satisfies the builtin error interface
   404  func (e ClientStatusResponseValidationError) Error() string {
   405  	cause := ""
   406  	if e.cause != nil {
   407  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   408  	}
   409  
   410  	key := ""
   411  	if e.key {
   412  		key = "key for "
   413  	}
   414  
   415  	return fmt.Sprintf(
   416  		"invalid %sClientStatusResponse.%s: %s%s",
   417  		key,
   418  		e.field,
   419  		e.reason,
   420  		cause)
   421  }
   422  
   423  var _ error = ClientStatusResponseValidationError{}
   424  
   425  var _ interface {
   426  	Field() string
   427  	Reason() string
   428  	Key() bool
   429  	Cause() error
   430  	ErrorName() string
   431  } = ClientStatusResponseValidationError{}
   432  

View as plain text