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

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