1
2
3
4 package envoy_admin_v2alpha
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 "github.com/golang/protobuf/ptypes"
19
20 core "github.com/datawire/ambassador/v2/pkg/api/envoy/api/v2/core"
21 )
22
23
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 _ = ptypes.DynamicAny{}
36
37 _ = core.HealthStatus(0)
38 )
39
40
41
42 func (m *Clusters) Validate() error {
43 if m == nil {
44 return nil
45 }
46
47 for idx, item := range m.GetClusterStatuses() {
48 _, _ = idx, item
49
50 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
51 if err := v.Validate(); err != nil {
52 return ClustersValidationError{
53 field: fmt.Sprintf("ClusterStatuses[%v]", idx),
54 reason: "embedded message failed validation",
55 cause: err,
56 }
57 }
58 }
59
60 }
61
62 return nil
63 }
64
65
66
67 type ClustersValidationError struct {
68 field string
69 reason string
70 cause error
71 key bool
72 }
73
74
75 func (e ClustersValidationError) Field() string { return e.field }
76
77
78 func (e ClustersValidationError) Reason() string { return e.reason }
79
80
81 func (e ClustersValidationError) Cause() error { return e.cause }
82
83
84 func (e ClustersValidationError) Key() bool { return e.key }
85
86
87 func (e ClustersValidationError) ErrorName() string { return "ClustersValidationError" }
88
89
90 func (e ClustersValidationError) Error() string {
91 cause := ""
92 if e.cause != nil {
93 cause = fmt.Sprintf(" | caused by: %v", e.cause)
94 }
95
96 key := ""
97 if e.key {
98 key = "key for "
99 }
100
101 return fmt.Sprintf(
102 "invalid %sClusters.%s: %s%s",
103 key,
104 e.field,
105 e.reason,
106 cause)
107 }
108
109 var _ error = ClustersValidationError{}
110
111 var _ interface {
112 Field() string
113 Reason() string
114 Key() bool
115 Cause() error
116 ErrorName() string
117 } = ClustersValidationError{}
118
119
120
121
122 func (m *ClusterStatus) Validate() error {
123 if m == nil {
124 return nil
125 }
126
127
128
129
130
131 if v, ok := interface{}(m.GetSuccessRateEjectionThreshold()).(interface{ Validate() error }); ok {
132 if err := v.Validate(); err != nil {
133 return ClusterStatusValidationError{
134 field: "SuccessRateEjectionThreshold",
135 reason: "embedded message failed validation",
136 cause: err,
137 }
138 }
139 }
140
141 for idx, item := range m.GetHostStatuses() {
142 _, _ = idx, item
143
144 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
145 if err := v.Validate(); err != nil {
146 return ClusterStatusValidationError{
147 field: fmt.Sprintf("HostStatuses[%v]", idx),
148 reason: "embedded message failed validation",
149 cause: err,
150 }
151 }
152 }
153
154 }
155
156 if v, ok := interface{}(m.GetLocalOriginSuccessRateEjectionThreshold()).(interface{ Validate() error }); ok {
157 if err := v.Validate(); err != nil {
158 return ClusterStatusValidationError{
159 field: "LocalOriginSuccessRateEjectionThreshold",
160 reason: "embedded message failed validation",
161 cause: err,
162 }
163 }
164 }
165
166 return nil
167 }
168
169
170
171 type ClusterStatusValidationError struct {
172 field string
173 reason string
174 cause error
175 key bool
176 }
177
178
179 func (e ClusterStatusValidationError) Field() string { return e.field }
180
181
182 func (e ClusterStatusValidationError) Reason() string { return e.reason }
183
184
185 func (e ClusterStatusValidationError) Cause() error { return e.cause }
186
187
188 func (e ClusterStatusValidationError) Key() bool { return e.key }
189
190
191 func (e ClusterStatusValidationError) ErrorName() string { return "ClusterStatusValidationError" }
192
193
194 func (e ClusterStatusValidationError) Error() string {
195 cause := ""
196 if e.cause != nil {
197 cause = fmt.Sprintf(" | caused by: %v", e.cause)
198 }
199
200 key := ""
201 if e.key {
202 key = "key for "
203 }
204
205 return fmt.Sprintf(
206 "invalid %sClusterStatus.%s: %s%s",
207 key,
208 e.field,
209 e.reason,
210 cause)
211 }
212
213 var _ error = ClusterStatusValidationError{}
214
215 var _ interface {
216 Field() string
217 Reason() string
218 Key() bool
219 Cause() error
220 ErrorName() string
221 } = ClusterStatusValidationError{}
222
223
224
225 func (m *HostStatus) Validate() error {
226 if m == nil {
227 return nil
228 }
229
230 if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
231 if err := v.Validate(); err != nil {
232 return HostStatusValidationError{
233 field: "Address",
234 reason: "embedded message failed validation",
235 cause: err,
236 }
237 }
238 }
239
240 for idx, item := range m.GetStats() {
241 _, _ = idx, item
242
243 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
244 if err := v.Validate(); err != nil {
245 return HostStatusValidationError{
246 field: fmt.Sprintf("Stats[%v]", idx),
247 reason: "embedded message failed validation",
248 cause: err,
249 }
250 }
251 }
252
253 }
254
255 if v, ok := interface{}(m.GetHealthStatus()).(interface{ Validate() error }); ok {
256 if err := v.Validate(); err != nil {
257 return HostStatusValidationError{
258 field: "HealthStatus",
259 reason: "embedded message failed validation",
260 cause: err,
261 }
262 }
263 }
264
265 if v, ok := interface{}(m.GetSuccessRate()).(interface{ Validate() error }); ok {
266 if err := v.Validate(); err != nil {
267 return HostStatusValidationError{
268 field: "SuccessRate",
269 reason: "embedded message failed validation",
270 cause: err,
271 }
272 }
273 }
274
275
276
277
278
279
280
281 if v, ok := interface{}(m.GetLocalOriginSuccessRate()).(interface{ Validate() error }); ok {
282 if err := v.Validate(); err != nil {
283 return HostStatusValidationError{
284 field: "LocalOriginSuccessRate",
285 reason: "embedded message failed validation",
286 cause: err,
287 }
288 }
289 }
290
291 if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok {
292 if err := v.Validate(); err != nil {
293 return HostStatusValidationError{
294 field: "Locality",
295 reason: "embedded message failed validation",
296 cause: err,
297 }
298 }
299 }
300
301 return nil
302 }
303
304
305
306 type HostStatusValidationError struct {
307 field string
308 reason string
309 cause error
310 key bool
311 }
312
313
314 func (e HostStatusValidationError) Field() string { return e.field }
315
316
317 func (e HostStatusValidationError) Reason() string { return e.reason }
318
319
320 func (e HostStatusValidationError) Cause() error { return e.cause }
321
322
323 func (e HostStatusValidationError) Key() bool { return e.key }
324
325
326 func (e HostStatusValidationError) ErrorName() string { return "HostStatusValidationError" }
327
328
329 func (e HostStatusValidationError) Error() string {
330 cause := ""
331 if e.cause != nil {
332 cause = fmt.Sprintf(" | caused by: %v", e.cause)
333 }
334
335 key := ""
336 if e.key {
337 key = "key for "
338 }
339
340 return fmt.Sprintf(
341 "invalid %sHostStatus.%s: %s%s",
342 key,
343 e.field,
344 e.reason,
345 cause)
346 }
347
348 var _ error = HostStatusValidationError{}
349
350 var _ interface {
351 Field() string
352 Reason() string
353 Key() bool
354 Cause() error
355 ErrorName() string
356 } = HostStatusValidationError{}
357
358
359
360
361 func (m *HostHealthStatus) Validate() error {
362 if m == nil {
363 return nil
364 }
365
366
367
368
369
370
371
372
373
374
375
376
377
378 return nil
379 }
380
381
382
383 type HostHealthStatusValidationError struct {
384 field string
385 reason string
386 cause error
387 key bool
388 }
389
390
391 func (e HostHealthStatusValidationError) Field() string { return e.field }
392
393
394 func (e HostHealthStatusValidationError) Reason() string { return e.reason }
395
396
397 func (e HostHealthStatusValidationError) Cause() error { return e.cause }
398
399
400 func (e HostHealthStatusValidationError) Key() bool { return e.key }
401
402
403 func (e HostHealthStatusValidationError) ErrorName() string { return "HostHealthStatusValidationError" }
404
405
406 func (e HostHealthStatusValidationError) Error() string {
407 cause := ""
408 if e.cause != nil {
409 cause = fmt.Sprintf(" | caused by: %v", e.cause)
410 }
411
412 key := ""
413 if e.key {
414 key = "key for "
415 }
416
417 return fmt.Sprintf(
418 "invalid %sHostHealthStatus.%s: %s%s",
419 key,
420 e.field,
421 e.reason,
422 cause)
423 }
424
425 var _ error = HostHealthStatusValidationError{}
426
427 var _ interface {
428 Field() string
429 Reason() string
430 Key() bool
431 Cause() error
432 ErrorName() string
433 } = HostHealthStatusValidationError{}
434
View as plain text