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

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/service/event_reporting/v3/event_reporting_service.proto
     3  
     4  package envoy_service_event_reporting_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  
    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 StreamEventsRequest 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 *StreamEventsRequest) Validate() error {
    40  	if m == nil {
    41  		return nil
    42  	}
    43  
    44  	if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok {
    45  		if err := v.Validate(); err != nil {
    46  			return StreamEventsRequestValidationError{
    47  				field:  "Identifier",
    48  				reason: "embedded message failed validation",
    49  				cause:  err,
    50  			}
    51  		}
    52  	}
    53  
    54  	if len(m.GetEvents()) < 1 {
    55  		return StreamEventsRequestValidationError{
    56  			field:  "Events",
    57  			reason: "value must contain at least 1 item(s)",
    58  		}
    59  	}
    60  
    61  	for idx, item := range m.GetEvents() {
    62  		_, _ = idx, item
    63  
    64  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
    65  			if err := v.Validate(); err != nil {
    66  				return StreamEventsRequestValidationError{
    67  					field:  fmt.Sprintf("Events[%v]", idx),
    68  					reason: "embedded message failed validation",
    69  					cause:  err,
    70  				}
    71  			}
    72  		}
    73  
    74  	}
    75  
    76  	return nil
    77  }
    78  
    79  // StreamEventsRequestValidationError is the validation error returned by
    80  // StreamEventsRequest.Validate if the designated constraints aren't met.
    81  type StreamEventsRequestValidationError struct {
    82  	field  string
    83  	reason string
    84  	cause  error
    85  	key    bool
    86  }
    87  
    88  // Field function returns field value.
    89  func (e StreamEventsRequestValidationError) Field() string { return e.field }
    90  
    91  // Reason function returns reason value.
    92  func (e StreamEventsRequestValidationError) Reason() string { return e.reason }
    93  
    94  // Cause function returns cause value.
    95  func (e StreamEventsRequestValidationError) Cause() error { return e.cause }
    96  
    97  // Key function returns key value.
    98  func (e StreamEventsRequestValidationError) Key() bool { return e.key }
    99  
   100  // ErrorName returns error name.
   101  func (e StreamEventsRequestValidationError) ErrorName() string {
   102  	return "StreamEventsRequestValidationError"
   103  }
   104  
   105  // Error satisfies the builtin error interface
   106  func (e StreamEventsRequestValidationError) Error() string {
   107  	cause := ""
   108  	if e.cause != nil {
   109  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   110  	}
   111  
   112  	key := ""
   113  	if e.key {
   114  		key = "key for "
   115  	}
   116  
   117  	return fmt.Sprintf(
   118  		"invalid %sStreamEventsRequest.%s: %s%s",
   119  		key,
   120  		e.field,
   121  		e.reason,
   122  		cause)
   123  }
   124  
   125  var _ error = StreamEventsRequestValidationError{}
   126  
   127  var _ interface {
   128  	Field() string
   129  	Reason() string
   130  	Key() bool
   131  	Cause() error
   132  	ErrorName() string
   133  } = StreamEventsRequestValidationError{}
   134  
   135  // Validate checks the field values on StreamEventsResponse with the rules
   136  // defined in the proto definition for this message. If any rules are
   137  // violated, an error is returned.
   138  func (m *StreamEventsResponse) Validate() error {
   139  	if m == nil {
   140  		return nil
   141  	}
   142  
   143  	return nil
   144  }
   145  
   146  // StreamEventsResponseValidationError is the validation error returned by
   147  // StreamEventsResponse.Validate if the designated constraints aren't met.
   148  type StreamEventsResponseValidationError struct {
   149  	field  string
   150  	reason string
   151  	cause  error
   152  	key    bool
   153  }
   154  
   155  // Field function returns field value.
   156  func (e StreamEventsResponseValidationError) Field() string { return e.field }
   157  
   158  // Reason function returns reason value.
   159  func (e StreamEventsResponseValidationError) Reason() string { return e.reason }
   160  
   161  // Cause function returns cause value.
   162  func (e StreamEventsResponseValidationError) Cause() error { return e.cause }
   163  
   164  // Key function returns key value.
   165  func (e StreamEventsResponseValidationError) Key() bool { return e.key }
   166  
   167  // ErrorName returns error name.
   168  func (e StreamEventsResponseValidationError) ErrorName() string {
   169  	return "StreamEventsResponseValidationError"
   170  }
   171  
   172  // Error satisfies the builtin error interface
   173  func (e StreamEventsResponseValidationError) Error() string {
   174  	cause := ""
   175  	if e.cause != nil {
   176  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   177  	}
   178  
   179  	key := ""
   180  	if e.key {
   181  		key = "key for "
   182  	}
   183  
   184  	return fmt.Sprintf(
   185  		"invalid %sStreamEventsResponse.%s: %s%s",
   186  		key,
   187  		e.field,
   188  		e.reason,
   189  		cause)
   190  }
   191  
   192  var _ error = StreamEventsResponseValidationError{}
   193  
   194  var _ interface {
   195  	Field() string
   196  	Reason() string
   197  	Key() bool
   198  	Cause() error
   199  	ErrorName() string
   200  } = StreamEventsResponseValidationError{}
   201  
   202  // Validate checks the field values on StreamEventsRequest_Identifier with the
   203  // rules defined in the proto definition for this message. If any rules are
   204  // violated, an error is returned.
   205  func (m *StreamEventsRequest_Identifier) Validate() error {
   206  	if m == nil {
   207  		return nil
   208  	}
   209  
   210  	if m.GetNode() == nil {
   211  		return StreamEventsRequest_IdentifierValidationError{
   212  			field:  "Node",
   213  			reason: "value is required",
   214  		}
   215  	}
   216  
   217  	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
   218  		if err := v.Validate(); err != nil {
   219  			return StreamEventsRequest_IdentifierValidationError{
   220  				field:  "Node",
   221  				reason: "embedded message failed validation",
   222  				cause:  err,
   223  			}
   224  		}
   225  	}
   226  
   227  	return nil
   228  }
   229  
   230  // StreamEventsRequest_IdentifierValidationError is the validation error
   231  // returned by StreamEventsRequest_Identifier.Validate if the designated
   232  // constraints aren't met.
   233  type StreamEventsRequest_IdentifierValidationError struct {
   234  	field  string
   235  	reason string
   236  	cause  error
   237  	key    bool
   238  }
   239  
   240  // Field function returns field value.
   241  func (e StreamEventsRequest_IdentifierValidationError) Field() string { return e.field }
   242  
   243  // Reason function returns reason value.
   244  func (e StreamEventsRequest_IdentifierValidationError) Reason() string { return e.reason }
   245  
   246  // Cause function returns cause value.
   247  func (e StreamEventsRequest_IdentifierValidationError) Cause() error { return e.cause }
   248  
   249  // Key function returns key value.
   250  func (e StreamEventsRequest_IdentifierValidationError) Key() bool { return e.key }
   251  
   252  // ErrorName returns error name.
   253  func (e StreamEventsRequest_IdentifierValidationError) ErrorName() string {
   254  	return "StreamEventsRequest_IdentifierValidationError"
   255  }
   256  
   257  // Error satisfies the builtin error interface
   258  func (e StreamEventsRequest_IdentifierValidationError) Error() string {
   259  	cause := ""
   260  	if e.cause != nil {
   261  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   262  	}
   263  
   264  	key := ""
   265  	if e.key {
   266  		key = "key for "
   267  	}
   268  
   269  	return fmt.Sprintf(
   270  		"invalid %sStreamEventsRequest_Identifier.%s: %s%s",
   271  		key,
   272  		e.field,
   273  		e.reason,
   274  		cause)
   275  }
   276  
   277  var _ error = StreamEventsRequest_IdentifierValidationError{}
   278  
   279  var _ interface {
   280  	Field() string
   281  	Reason() string
   282  	Key() bool
   283  	Cause() error
   284  	ErrorName() string
   285  } = StreamEventsRequest_IdentifierValidationError{}