Debian Codegraph @

go/xds/type/v3/range.pb.validate.go

raw symbols SCIP
1 // Code generated by protoc-gen-validate. DO NOT EDIT.
2 // source: xds/type/v3/range.proto
3
4 package v3
5
6 import (
7 "bytes"
8 "errors"
9 "fmt"
10 "net"
11 "net/mail"
12 "net/url"
13 "regexp"
14 "sort"
15 "strings"
16 "time"
17 "unicode/utf8"
18
19 "google.golang.org/protobuf/types/known/anypb"
20 )
21
22 // ensure the imports are used
23 var (
24 _ = bytes.MinRead
25 _ = errors.New("")
26 _ = fmt.Print
27 _ = utf8.UTFMax
28 _ = (*regexp.Regexp)(nil)
29 _ = (*strings.Reader)(nil)
30 _ = net.IPv4len
31 _ = time.Duration(0)
32 _ = (*url.URL)(nil)
33 _ = (*mail.Address)(nil)
34 _ = anypb.Any{}
35 _ = sort.Sort
36 )
37
38 // Validate checks the field values on Int64Range with the rules defined in the
39 // proto definition for this message. If any rules are violated, the first
40 // error encountered is returned, or nil if there are no violations.
41 func (m *Int64Range) Validate() error {
42 return m.validate(false)
43 }
44
45 // ValidateAll checks the field values on Int64Range with the rules defined in
46 // the proto definition for this message. If any rules are violated, the
47 // result is a list of violation errors wrapped in Int64RangeMultiError, or
48 // nil if none found.
49 func (m *Int64Range) ValidateAll() error {
50 return m.validate(true)
51 }
52
53 func (m *Int64Range) validate(all bool) error {
54 if m == nil {
55 return nil
56 }
57
58 var errors []error
59
60 // no validation rules for Start
61
62 // no validation rules for End
63
64 if len(errors) > 0 {
65 return Int64RangeMultiError(errors)
66 }
67
68 return nil
69 }
70
71 // Int64RangeMultiError is an error wrapping multiple validation errors
72 // returned by Int64Range.ValidateAll() if the designated constraints aren't met.
73 type Int64RangeMultiError []error
74
75 // Error returns a concatenation of all the error messages it wraps.
76 func (m Int64RangeMultiError) Error() string {
77 msgs := make([]string, 0, len(m))
78 for _, err := range m {
79 msgs = append(msgs, err.Error())
80 }
81 return strings.Join(msgs, "; ")
82 }
83
84 // AllErrors returns a list of validation violation errors.
85 func (m Int64RangeMultiError) AllErrors() []error { return m }
86
87 // Int64RangeValidationError is the validation error returned by
88 // Int64Range.Validate if the designated constraints aren't met.
89 type Int64RangeValidationError struct {
90 field string
91 reason string
92 cause error
93 key bool
94 }
95
96 // Field function returns field value.
97 func (e Int64RangeValidationError) Field() string { return e.field }
98
99 // Reason function returns reason value.
100 func (e Int64RangeValidationError) Reason() string { return e.reason }
101
102 // Cause function returns cause value.
103 func (e Int64RangeValidationError) Cause() error { return e.cause }
104
105 // Key function returns key value.
106 func (e Int64RangeValidationError) Key() bool { return e.key }
107
108 // ErrorName returns error name.
109 func (e Int64RangeValidationError) ErrorName() string { return "Int64RangeValidationError" }
110
111 // Error satisfies the builtin error interface
112 func (e Int64RangeValidationError) Error() string {
113 cause := ""
114 if e.cause != nil {
115 cause = fmt.Sprintf(" | caused by: %v", e.cause)
116 }
117
118 key := ""
119 if e.key {
120 key = "key for "
121 }
122
123 return fmt.Sprintf(
124 "invalid %sInt64Range.%s: %s%s",
125 key,
126 e.field,
127 e.reason,
128 cause)
129 }
130
131 var _ error = Int64RangeValidationError{}
132
133 var _ interface {
134 Field() string
135 Reason() string
136 Key() bool
137 Cause() error
138 ErrorName() string
139 } = Int64RangeValidationError{}
140
141 // Validate checks the field values on Int32Range with the rules defined in the
142 // proto definition for this message. If any rules are violated, the first
143 // error encountered is returned, or nil if there are no violations.
144 func (m *Int32Range) Validate() error {
145 return m.validate(false)
146 }
147
148 // ValidateAll checks the field values on Int32Range with the rules defined in
149 // the proto definition for this message. If any rules are violated, the
150 // result is a list of violation errors wrapped in Int32RangeMultiError, or
151 // nil if none found.
152 func (m *Int32Range) ValidateAll() error {
153 return m.validate(true)
154 }
155
156 func (m *Int32Range) validate(all bool) error {
157 if m == nil {
158 return nil
159 }
160
161 var errors []error
162
163 // no validation rules for Start
164
165 // no validation rules for End
166
167 if len(errors) > 0 {
168 return Int32RangeMultiError(errors)
169 }
170
171 return nil
172 }
173
174 // Int32RangeMultiError is an error wrapping multiple validation errors
175 // returned by Int32Range.ValidateAll() if the designated constraints aren't met.
176 type Int32RangeMultiError []error
177
178 // Error returns a concatenation of all the error messages it wraps.
179 func (m Int32RangeMultiError) Error() string {
180 msgs := make([]string, 0, len(m))
181 for _, err := range m {
182 msgs = append(msgs, err.Error())
183 }
184 return strings.Join(msgs, "; ")
185 }
186
187 // AllErrors returns a list of validation violation errors.
188 func (m Int32RangeMultiError) AllErrors() []error { return m }
189
190 // Int32RangeValidationError is the validation error returned by
191 // Int32Range.Validate if the designated constraints aren't met.
192 type Int32RangeValidationError struct {
193 field string
194 reason string
195 cause error
196 key bool
197 }
198
199 // Field function returns field value.
200 func (e Int32RangeValidationError) Field() string { return e.field }
201
202 // Reason function returns reason value.
203 func (e Int32RangeValidationError) Reason() string { return e.reason }
204
205 // Cause function returns cause value.
206 func (e Int32RangeValidationError) Cause() error { return e.cause }
207
208 // Key function returns key value.
209 func (e Int32RangeValidationError) Key() bool { return e.key }
210
211 // ErrorName returns error name.
212 func (e Int32RangeValidationError) ErrorName() string { return "Int32RangeValidationError" }
213
214 // Error satisfies the builtin error interface
215 func (e Int32RangeValidationError) Error() string {
216 cause := ""
217 if e.cause != nil {
218 cause = fmt.Sprintf(" | caused by: %v", e.cause)
219 }
220
221 key := ""
222 if e.key {
223 key = "key for "
224 }
225
226 return fmt.Sprintf(
227 "invalid %sInt32Range.%s: %s%s",
228 key,
229 e.field,
230 e.reason,
231 cause)
232 }
233
234 var _ error = Int32RangeValidationError{}
235
236 var _ interface {
237 Field() string
238 Reason() string
239 Key() bool
240 Cause() error
241 ErrorName() string
242 } = Int32RangeValidationError{}
243
244 // Validate checks the field values on DoubleRange with the rules defined in
245 // the proto definition for this message. If any rules are violated, the first
246 // error encountered is returned, or nil if there are no violations.
247 func (m *DoubleRange) Validate() error {
248 return m.validate(false)
249 }
250
251 // ValidateAll checks the field values on DoubleRange with the rules defined in
252 // the proto definition for this message. If any rules are violated, the
253 // result is a list of violation errors wrapped in DoubleRangeMultiError, or
254 // nil if none found.
255 func (m *DoubleRange) ValidateAll() error {
256 return m.validate(true)
257 }
258
259 func (m *DoubleRange) validate(all bool) error {
260 if m == nil {
261 return nil
262 }
263
264 var errors []error
265
266 // no validation rules for Start
267
268 // no validation rules for End
269
270 if len(errors) > 0 {
271 return DoubleRangeMultiError(errors)
272 }
273
274 return nil
275 }
276
277 // DoubleRangeMultiError is an error wrapping multiple validation errors
278 // returned by DoubleRange.ValidateAll() if the designated constraints aren't met.
279 type DoubleRangeMultiError []error
280
281 // Error returns a concatenation of all the error messages it wraps.
282 func (m DoubleRangeMultiError) Error() string {
283 msgs := make([]string, 0, len(m))
284 for _, err := range m {
285 msgs = append(msgs, err.Error())
286 }
287 return strings.Join(msgs, "; ")
288 }
289
290 // AllErrors returns a list of validation violation errors.
291 func (m DoubleRangeMultiError) AllErrors() []error { return m }
292
293 // DoubleRangeValidationError is the validation error returned by
294 // DoubleRange.Validate if the designated constraints aren't met.
295 type DoubleRangeValidationError struct {
296 field string
297 reason string
298 cause error
299 key bool
300 }
301
302 // Field function returns field value.
303 func (e DoubleRangeValidationError) Field() string { return e.field }
304
305 // Reason function returns reason value.
306 func (e DoubleRangeValidationError) Reason() string { return e.reason }
307
308 // Cause function returns cause value.
309 func (e DoubleRangeValidationError) Cause() error { return e.cause }
310
311 // Key function returns key value.
312 func (e DoubleRangeValidationError) Key() bool { return e.key }
313
314 // ErrorName returns error name.
315 func (e DoubleRangeValidationError) ErrorName() string { return "DoubleRangeValidationError" }
316
317 // Error satisfies the builtin error interface
318 func (e DoubleRangeValidationError) Error() string {
319 cause := ""
320 if e.cause != nil {
321 cause = fmt.Sprintf(" | caused by: %v", e.cause)
322 }
323
324 key := ""
325 if e.key {
326 key = "key for "
327 }
328
329 return fmt.Sprintf(
330 "invalid %sDoubleRange.%s: %s%s",
331 key,
332 e.field,
333 e.reason,
334 cause)
335 }
336
337 var _ error = DoubleRangeValidationError{}
338
339 var _ interface {
340 Field() string
341 Reason() string
342 Key() bool
343 Cause() error
344 ErrorName() string
345 } = DoubleRangeValidationError{}