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

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