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