| 1 |
//go:build !disable_pgv |
| 2 |
// Code generated by protoc-gen-validate. DO NOT EDIT. |
| 3 |
// source: envoy/service/endpoint/v3/eds.proto |
| 4 |
|
| 5 |
package endpointv3 |
| 6 |
|
| 7 |
import ( |
| 8 |
"bytes" |
| 9 |
"errors" |
| 10 |
"fmt" |
| 11 |
"net" |
| 12 |
"net/mail" |
| 13 |
"net/url" |
| 14 |
"regexp" |
| 15 |
"sort" |
| 16 |
"strings" |
| 17 |
"time" |
| 18 |
"unicode/utf8" |
| 19 |
|
| 20 |
"google.golang.org/protobuf/types/known/anypb" |
| 21 |
) |
| 22 |
|
| 23 |
// ensure the imports are used |
| 24 |
var ( |
| 25 |
_ = bytes.MinRead |
| 26 |
_ = errors.New("") |
| 27 |
_ = fmt.Print |
| 28 |
_ = utf8.UTFMax |
| 29 |
_ = (*regexp.Regexp)(nil) |
| 30 |
_ = (*strings.Reader)(nil) |
| 31 |
_ = net.IPv4len |
| 32 |
_ = time.Duration(0) |
| 33 |
_ = (*url.URL)(nil) |
| 34 |
_ = (*mail.Address)(nil) |
| 35 |
_ = anypb.Any{} |
| 36 |
_ = sort.Sort |
| 37 |
) |
| 38 |
|
| 39 |
// Validate checks the field values on EdsDummy with the rules defined in the |
| 40 |
// proto definition for this message. If any rules are violated, the first |
| 41 |
// error encountered is returned, or nil if there are no violations. |
| 42 |
func (m *EdsDummy) Validate() error { |
| 43 |
return m.validate(false) |
| 44 |
} |
| 45 |
|
| 46 |
// ValidateAll checks the field values on EdsDummy with the rules defined in |
| 47 |
// the proto definition for this message. If any rules are violated, the |
| 48 |
// result is a list of violation errors wrapped in EdsDummyMultiError, or nil |
| 49 |
// if none found. |
| 50 |
func (m *EdsDummy) ValidateAll() error { |
| 51 |
return m.validate(true) |
| 52 |
} |
| 53 |
|
| 54 |
func (m *EdsDummy) validate(all bool) error { |
| 55 |
if m == nil { |
| 56 |
return nil |
| 57 |
} |
| 58 |
|
| 59 |
var errors []error |
| 60 |
|
| 61 |
if len(errors) > 0 { |
| 62 |
return EdsDummyMultiError(errors) |
| 63 |
} |
| 64 |
|
| 65 |
return nil |
| 66 |
} |
| 67 |
|
| 68 |
// EdsDummyMultiError is an error wrapping multiple validation errors returned |
| 69 |
// by EdsDummy.ValidateAll() if the designated constraints aren't met. |
| 70 |
type EdsDummyMultiError []error |
| 71 |
|
| 72 |
// Error returns a concatenation of all the error messages it wraps. |
| 73 |
func (m EdsDummyMultiError) Error() string { |
| 74 |
var msgs []string |
| 75 |
for _, err := range m { |
| 76 |
msgs = append(msgs, err.Error()) |
| 77 |
} |
| 78 |
return strings.Join(msgs, "; ") |
| 79 |
} |
| 80 |
|
| 81 |
// AllErrors returns a list of validation violation errors. |
| 82 |
func (m EdsDummyMultiError) AllErrors() []error { return m } |
| 83 |
|
| 84 |
// EdsDummyValidationError is the validation error returned by |
| 85 |
// EdsDummy.Validate if the designated constraints aren't met. |
| 86 |
type EdsDummyValidationError struct { |
| 87 |
field string |
| 88 |
reason string |
| 89 |
cause error |
| 90 |
key bool |
| 91 |
} |
| 92 |
|
| 93 |
// Field function returns field value. |
| 94 |
func (e EdsDummyValidationError) Field() string { return e.field } |
| 95 |
|
| 96 |
// Reason function returns reason value. |
| 97 |
func (e EdsDummyValidationError) Reason() string { return e.reason } |
| 98 |
|
| 99 |
// Cause function returns cause value. |
| 100 |
func (e EdsDummyValidationError) Cause() error { return e.cause } |
| 101 |
|
| 102 |
// Key function returns key value. |
| 103 |
func (e EdsDummyValidationError) Key() bool { return e.key } |
| 104 |
|
| 105 |
// ErrorName returns error name. |
| 106 |
func (e EdsDummyValidationError) ErrorName() string { return "EdsDummyValidationError" } |
| 107 |
|
| 108 |
// Error satisfies the builtin error interface |
| 109 |
func (e EdsDummyValidationError) Error() string { |
| 110 |
cause := "" |
| 111 |
if e.cause != nil { |
| 112 |
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
| 113 |
} |
| 114 |
|
| 115 |
key := "" |
| 116 |
if e.key { |
| 117 |
key = "key for " |
| 118 |
} |
| 119 |
|
| 120 |
return fmt.Sprintf( |
| 121 |
"invalid %sEdsDummy.%s: %s%s", |
| 122 |
key, |
| 123 |
e.field, |
| 124 |
e.reason, |
| 125 |
cause) |
| 126 |
} |
| 127 |
|
| 128 |
var _ error = EdsDummyValidationError{} |
| 129 |
|
| 130 |
var _ interface { |
| 131 |
Field() string |
| 132 |
Reason() string |
| 133 |
Key() bool |
| 134 |
Cause() error |
| 135 |
ErrorName() string |
| 136 |
} = EdsDummyValidationError{} |