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

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/service/discovery/v3/ads.proto
     3  
     4  package envoy_service_discovery_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 AdsDummy with the rules defined in the
    37  // proto definition for this message. If any rules are violated, an error is returned.
    38  func (m *AdsDummy) Validate() error {
    39  	if m == nil {
    40  		return nil
    41  	}
    42  
    43  	return nil
    44  }
    45  
    46  // AdsDummyValidationError is the validation error returned by
    47  // AdsDummy.Validate if the designated constraints aren't met.
    48  type AdsDummyValidationError struct {
    49  	field  string
    50  	reason string
    51  	cause  error
    52  	key    bool
    53  }
    54  
    55  // Field function returns field value.
    56  func (e AdsDummyValidationError) Field() string { return e.field }
    57  
    58  // Reason function returns reason value.
    59  func (e AdsDummyValidationError) Reason() string { return e.reason }
    60  
    61  // Cause function returns cause value.
    62  func (e AdsDummyValidationError) Cause() error { return e.cause }
    63  
    64  // Key function returns key value.
    65  func (e AdsDummyValidationError) Key() bool { return e.key }
    66  
    67  // ErrorName returns error name.
    68  func (e AdsDummyValidationError) ErrorName() string { return "AdsDummyValidationError" }
    69  
    70  // Error satisfies the builtin error interface
    71  func (e AdsDummyValidationError) Error() string {
    72  	cause := ""
    73  	if e.cause != nil {
    74  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
    75  	}
    76  
    77  	key := ""
    78  	if e.key {
    79  		key = "key for "
    80  	}
    81  
    82  	return fmt.Sprintf(
    83  		"invalid %sAdsDummy.%s: %s%s",
    84  		key,
    85  		e.field,
    86  		e.reason,
    87  		cause)
    88  }
    89  
    90  var _ error = AdsDummyValidationError{}
    91  
    92  var _ interface {
    93  	Field() string
    94  	Reason() string
    95  	Key() bool
    96  	Cause() error
    97  	ErrorName() string
    98  } = AdsDummyValidationError{}