Debian Codegraph @

envoy/service/auth/v3/attribute_context.pb.validate.go

raw
1 //go:build !disable_pgv
2 // Code generated by protoc-gen-validate. DO NOT EDIT.
3 // source: envoy/service/auth/v3/attribute_context.proto
4
5 package authv3
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 AttributeContext with the rules defined
40 // in the proto definition for this message. If any rules are violated, the
41 // first error encountered is returned, or nil if there are no violations.
42 func (m *AttributeContext) Validate() error {
43 return m.validate(false)
44 }
45
46 // ValidateAll checks the field values on AttributeContext with the rules
47 // defined in the proto definition for this message. If any rules are
48 // violated, the result is a list of violation errors wrapped in
49 // AttributeContextMultiError, or nil if none found.
50 func (m *AttributeContext) ValidateAll() error {
51 return m.validate(true)
52 }
53
54 func (m *AttributeContext) validate(all bool) error {
55 if m == nil {
56 return nil
57 }
58
59 var errors []error
60
61 if all {
62 switch v := interface{}(m.GetSource()).(type) {
63 case interface{ ValidateAll() error }:
64 if err := v.ValidateAll(); err != nil {
65 errors = append(errors, AttributeContextValidationError{
66 field: "Source",
67 reason: "embedded message failed validation",
68 cause: err,
69 })
70 }
71 case interface{ Validate() error }:
72 if err := v.Validate(); err != nil {
73 errors = append(errors, AttributeContextValidationError{
74 field: "Source",
75 reason: "embedded message failed validation",
76 cause: err,
77 })
78 }
79 }
80 } else if v, ok := interface{}(m.GetSource()).(interface{ Validate() error }); ok {
81 if err := v.Validate(); err != nil {
82 return AttributeContextValidationError{
83 field: "Source",
84 reason: "embedded message failed validation",
85 cause: err,
86 }
87 }
88 }
89
90 if all {
91 switch v := interface{}(m.GetDestination()).(type) {
92 case interface{ ValidateAll() error }:
93 if err := v.ValidateAll(); err != nil {
94 errors = append(errors, AttributeContextValidationError{
95 field: "Destination",
96 reason: "embedded message failed validation",
97 cause: err,
98 })
99 }
100 case interface{ Validate() error }:
101 if err := v.Validate(); err != nil {
102 errors = append(errors, AttributeContextValidationError{
103 field: "Destination",
104 reason: "embedded message failed validation",
105 cause: err,
106 })
107 }
108 }
109 } else if v, ok := interface{}(m.GetDestination()).(interface{ Validate() error }); ok {
110 if err := v.Validate(); err != nil {
111 return AttributeContextValidationError{
112 field: "Destination",
113 reason: "embedded message failed validation",
114 cause: err,
115 }
116 }
117 }
118
119 if all {
120 switch v := interface{}(m.GetRequest()).(type) {
121 case interface{ ValidateAll() error }:
122 if err := v.ValidateAll(); err != nil {
123 errors = append(errors, AttributeContextValidationError{
124 field: "Request",
125 reason: "embedded message failed validation",
126 cause: err,
127 })
128 }
129 case interface{ Validate() error }:
130 if err := v.Validate(); err != nil {
131 errors = append(errors, AttributeContextValidationError{
132 field: "Request",
133 reason: "embedded message failed validation",
134 cause: err,
135 })
136 }
137 }
138 } else if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok {
139 if err := v.Validate(); err != nil {
140 return AttributeContextValidationError{
141 field: "Request",
142 reason: "embedded message failed validation",
143 cause: err,
144 }
145 }
146 }
147
148 // no validation rules for ContextExtensions
149
150 if all {
151 switch v := interface{}(m.GetMetadataContext()).(type) {
152 case interface{ ValidateAll() error }:
153 if err := v.ValidateAll(); err != nil {
154 errors = append(errors, AttributeContextValidationError{
155 field: "MetadataContext",
156 reason: "embedded message failed validation",
157 cause: err,
158 })
159 }
160 case interface{ Validate() error }:
161 if err := v.Validate(); err != nil {
162 errors = append(errors, AttributeContextValidationError{
163 field: "MetadataContext",
164 reason: "embedded message failed validation",
165 cause: err,
166 })
167 }
168 }
169 } else if v, ok := interface{}(m.GetMetadataContext()).(interface{ Validate() error }); ok {
170 if err := v.Validate(); err != nil {
171 return AttributeContextValidationError{
172 field: "MetadataContext",
173 reason: "embedded message failed validation",
174 cause: err,
175 }
176 }
177 }
178
179 if all {
180 switch v := interface{}(m.GetRouteMetadataContext()).(type) {
181 case interface{ ValidateAll() error }:
182 if err := v.ValidateAll(); err != nil {
183 errors = append(errors, AttributeContextValidationError{
184 field: "RouteMetadataContext",
185 reason: "embedded message failed validation",
186 cause: err,
187 })
188 }
189 case interface{ Validate() error }:
190 if err := v.Validate(); err != nil {
191 errors = append(errors, AttributeContextValidationError{
192 field: "RouteMetadataContext",
193 reason: "embedded message failed validation",
194 cause: err,
195 })
196 }
197 }
198 } else if v, ok := interface{}(m.GetRouteMetadataContext()).(interface{ Validate() error }); ok {
199 if err := v.Validate(); err != nil {
200 return AttributeContextValidationError{
201 field: "RouteMetadataContext",
202 reason: "embedded message failed validation",
203 cause: err,
204 }
205 }
206 }
207
208 if all {
209 switch v := interface{}(m.GetTlsSession()).(type) {
210 case interface{ ValidateAll() error }:
211 if err := v.ValidateAll(); err != nil {
212 errors = append(errors, AttributeContextValidationError{
213 field: "TlsSession",
214 reason: "embedded message failed validation",
215 cause: err,
216 })
217 }
218 case interface{ Validate() error }:
219 if err := v.Validate(); err != nil {
220 errors = append(errors, AttributeContextValidationError{
221 field: "TlsSession",
222 reason: "embedded message failed validation",
223 cause: err,
224 })
225 }
226 }
227 } else if v, ok := interface{}(m.GetTlsSession()).(interface{ Validate() error }); ok {
228 if err := v.Validate(); err != nil {
229 return AttributeContextValidationError{
230 field: "TlsSession",
231 reason: "embedded message failed validation",
232 cause: err,
233 }
234 }
235 }
236
237 if len(errors) > 0 {
238 return AttributeContextMultiError(errors)
239 }
240
241 return nil
242 }
243
244 // AttributeContextMultiError is an error wrapping multiple validation errors
245 // returned by AttributeContext.ValidateAll() if the designated constraints
246 // aren't met.
247 type AttributeContextMultiError []error
248
249 // Error returns a concatenation of all the error messages it wraps.
250 func (m AttributeContextMultiError) Error() string {
251 var msgs []string
252 for _, err := range m {
253 msgs = append(msgs, err.Error())
254 }
255 return strings.Join(msgs, "; ")
256 }
257
258 // AllErrors returns a list of validation violation errors.
259 func (m AttributeContextMultiError) AllErrors() []error { return m }
260
261 // AttributeContextValidationError is the validation error returned by
262 // AttributeContext.Validate if the designated constraints aren't met.
263 type AttributeContextValidationError struct {
264 field string
265 reason string
266 cause error
267 key bool
268 }
269
270 // Field function returns field value.
271 func (e AttributeContextValidationError) Field() string { return e.field }
272
273 // Reason function returns reason value.
274 func (e AttributeContextValidationError) Reason() string { return e.reason }
275
276 // Cause function returns cause value.
277 func (e AttributeContextValidationError) Cause() error { return e.cause }
278
279 // Key function returns key value.
280 func (e AttributeContextValidationError) Key() bool { return e.key }
281
282 // ErrorName returns error name.
283 func (e AttributeContextValidationError) ErrorName() string { return "AttributeContextValidationError" }
284
285 // Error satisfies the builtin error interface
286 func (e AttributeContextValidationError) 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.%s: %s%s",
299 key,
300 e.field,
301 e.reason,
302 cause)
303 }
304
305 var _ error = AttributeContextValidationError{}
306
307 var _ interface {
308 Field() string
309 Reason() string
310 Key() bool
311 Cause() error
312 ErrorName() string
313 } = AttributeContextValidationError{}
314
315 // Validate checks the field values on AttributeContext_Peer with the rules
316 // defined in the proto definition for this message. If any rules are
317 // violated, the first error encountered is returned, or nil if there are no violations.
318 func (m *AttributeContext_Peer) Validate() error {
319 return m.validate(false)
320 }
321
322 // ValidateAll checks the field values on AttributeContext_Peer with the rules
323 // defined in the proto definition for this message. If any rules are
324 // violated, the result is a list of violation errors wrapped in
325 // AttributeContext_PeerMultiError, or nil if none found.
326 func (m *AttributeContext_Peer) ValidateAll() error {
327 return m.validate(true)
328 }
329
330 func (m *AttributeContext_Peer) validate(all bool) error {
331 if m == nil {
332 return nil
333 }
334
335 var errors []error
336
337 if all {
338 switch v := interface{}(m.GetAddress()).(type) {
339 case interface{ ValidateAll() error }:
340 if err := v.ValidateAll(); err != nil {
341 errors = append(errors, AttributeContext_PeerValidationError{
342 field: "Address",
343 reason: "embedded message failed validation",
344 cause: err,
345 })
346 }
347 case interface{ Validate() error }:
348 if err := v.Validate(); err != nil {
349 errors = append(errors, AttributeContext_PeerValidationError{
350 field: "Address",
351 reason: "embedded message failed validation",
352 cause: err,
353 })
354 }
355 }
356 } else if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
357 if err := v.Validate(); err != nil {
358 return AttributeContext_PeerValidationError{
359 field: "Address",
360 reason: "embedded message failed validation",
361 cause: err,
362 }
363 }
364 }
365
366 // no validation rules for Service
367
368 // no validation rules for Labels
369
370 // no validation rules for Principal
371
372 // no validation rules for Certificate
373
374 if len(errors) > 0 {
375 return AttributeContext_PeerMultiError(errors)
376 }
377
378 return nil
379 }
380
381 // AttributeContext_PeerMultiError is an error wrapping multiple validation
382 // errors returned by AttributeContext_Peer.ValidateAll() if the designated
383 // constraints aren't met.
384 type AttributeContext_PeerMultiError []error
385
386 // Error returns a concatenation of all the error messages it wraps.
387 func (m AttributeContext_PeerMultiError) Error() string {
388 var msgs []string
389 for _, err := range m {
390 msgs = append(msgs, err.Error())
391 }
392 return strings.Join(msgs, "; ")
393 }
394
395 // AllErrors returns a list of validation violation errors.
396 func (m AttributeContext_PeerMultiError) AllErrors() []error { return m }
397
398 // AttributeContext_PeerValidationError is the validation error returned by
399 // AttributeContext_Peer.Validate if the designated constraints aren't met.
400 type AttributeContext_PeerValidationError struct {
401 field string
402 reason string
403 cause error
404 key bool
405 }
406
407 // Field function returns field value.
408 func (e AttributeContext_PeerValidationError) Field() string { return e.field }
409
410 // Reason function returns reason value.
411 func (e AttributeContext_PeerValidationError) Reason() string { return e.reason }
412
413 // Cause function returns cause value.
414 func (e AttributeContext_PeerValidationError) Cause() error { return e.cause }
415
416 // Key function returns key value.
417 func (e AttributeContext_PeerValidationError) Key() bool { return e.key }
418
419 // ErrorName returns error name.
420 func (e AttributeContext_PeerValidationError) ErrorName() string {
421 return "AttributeContext_PeerValidationError"
422 }
423
424 // Error satisfies the builtin error interface
425 func (e AttributeContext_PeerValidationError) Error() string {
426 cause := ""
427 if e.cause != nil {
428 cause = fmt.Sprintf(" | caused by: %v", e.cause)
429 }
430
431 key := ""
432 if e.key {
433 key = "key for "
434 }
435
436 return fmt.Sprintf(
437 "invalid %sAttributeContext_Peer.%s: %s%s",
438 key,
439 e.field,
440 e.reason,
441 cause)
442 }
443
444 var _ error = AttributeContext_PeerValidationError{}
445
446 var _ interface {
447 Field() string
448 Reason() string
449 Key() bool
450 Cause() error
451 ErrorName() string
452 } = AttributeContext_PeerValidationError{}
453
454 // Validate checks the field values on AttributeContext_Request with the rules
455 // defined in the proto definition for this message. If any rules are
456 // violated, the first error encountered is returned, or nil if there are no violations.
457 func (m *AttributeContext_Request) Validate() error {
458 return m.validate(false)
459 }
460
461 // ValidateAll checks the field values on AttributeContext_Request with the
462 // rules defined in the proto definition for this message. If any rules are
463 // violated, the result is a list of violation errors wrapped in
464 // AttributeContext_RequestMultiError, or nil if none found.
465 func (m *AttributeContext_Request) ValidateAll() error {
466 return m.validate(true)
467 }
468
469 func (m *AttributeContext_Request) validate(all bool) error {
470 if m == nil {
471 return nil
472 }
473
474 var errors []error
475
476 if all {
477 switch v := interface{}(m.GetTime()).(type) {
478 case interface{ ValidateAll() error }:
479 if err := v.ValidateAll(); err != nil {
480 errors = append(errors, AttributeContext_RequestValidationError{
481 field: "Time",
482 reason: "embedded message failed validation",
483 cause: err,
484 })
485 }
486 case interface{ Validate() error }:
487 if err := v.Validate(); err != nil {
488 errors = append(errors, AttributeContext_RequestValidationError{
489 field: "Time",
490 reason: "embedded message failed validation",
491 cause: err,
492 })
493 }
494 }
495 } else if v, ok := interface{}(m.GetTime()).(interface{ Validate() error }); ok {
496 if err := v.Validate(); err != nil {
497 return AttributeContext_RequestValidationError{
498 field: "Time",
499 reason: "embedded message failed validation",
500 cause: err,
501 }
502 }
503 }
504
505 if all {
506 switch v := interface{}(m.GetHttp()).(type) {
507 case interface{ ValidateAll() error }:
508 if err := v.ValidateAll(); err != nil {
509 errors = append(errors, AttributeContext_RequestValidationError{
510 field: "Http",
511 reason: "embedded message failed validation",
512 cause: err,
513 })
514 }
515 case interface{ Validate() error }:
516 if err := v.Validate(); err != nil {
517 errors = append(errors, AttributeContext_RequestValidationError{
518 field: "Http",
519 reason: "embedded message failed validation",
520 cause: err,
521 })
522 }
523 }
524 } else if v, ok := interface{}(m.GetHttp()).(interface{ Validate() error }); ok {
525 if err := v.Validate(); err != nil {
526 return AttributeContext_RequestValidationError{
527 field: "Http",
528 reason: "embedded message failed validation",
529 cause: err,
530 }
531 }
532 }
533
534 if len(errors) > 0 {
535 return AttributeContext_RequestMultiError(errors)
536 }
537
538 return nil
539 }
540
541 // AttributeContext_RequestMultiError is an error wrapping multiple validation
542 // errors returned by AttributeContext_Request.ValidateAll() if the designated
543 // constraints aren't met.
544 type AttributeContext_RequestMultiError []error
545
546 // Error returns a concatenation of all the error messages it wraps.
547 func (m AttributeContext_RequestMultiError) Error() string {
548 var msgs []string
549 for _, err := range m {
550 msgs = append(msgs, err.Error())
551 }
552 return strings.Join(msgs, "; ")
553 }
554
555 // AllErrors returns a list of validation violation errors.
556 func (m AttributeContext_RequestMultiError) AllErrors() []error { return m }
557
558 // AttributeContext_RequestValidationError is the validation error returned by
559 // AttributeContext_Request.Validate if the designated constraints aren't met.
560 type AttributeContext_RequestValidationError struct {
561 field string
562 reason string
563 cause error
564 key bool
565 }
566
567 // Field function returns field value.
568 func (e AttributeContext_RequestValidationError) Field() string { return e.field }
569
570 // Reason function returns reason value.
571 func (e AttributeContext_RequestValidationError) Reason() string { return e.reason }
572
573 // Cause function returns cause value.
574 func (e AttributeContext_RequestValidationError) Cause() error { return e.cause }
575
576 // Key function returns key value.
577 func (e AttributeContext_RequestValidationError) Key() bool { return e.key }
578
579 // ErrorName returns error name.
580 func (e AttributeContext_RequestValidationError) ErrorName() string {
581 return "AttributeContext_RequestValidationError"
582 }
583
584 // Error satisfies the builtin error interface
585 func (e AttributeContext_RequestValidationError) Error() string {
586 cause := ""
587 if e.cause != nil {
588 cause = fmt.Sprintf(" | caused by: %v", e.cause)
589 }
590
591 key := ""
592 if e.key {
593 key = "key for "
594 }
595
596 return fmt.Sprintf(
597 "invalid %sAttributeContext_Request.%s: %s%s",
598 key,
599 e.field,
600 e.reason,
601 cause)
602 }
603
604 var _ error = AttributeContext_RequestValidationError{}
605
606 var _ interface {
607 Field() string
608 Reason() string
609 Key() bool
610 Cause() error
611 ErrorName() string
612 } = AttributeContext_RequestValidationError{}
613
614 // Validate checks the field values on AttributeContext_HttpRequest with the
615 // rules defined in the proto definition for this message. If any rules are
616 // violated, the first error encountered is returned, or nil if there are no violations.
617 func (m *AttributeContext_HttpRequest) Validate() error {
618 return m.validate(false)
619 }
620
621 // ValidateAll checks the field values on AttributeContext_HttpRequest with the
622 // rules defined in the proto definition for this message. If any rules are
623 // violated, the result is a list of violation errors wrapped in
624 // AttributeContext_HttpRequestMultiError, or nil if none found.
625 func (m *AttributeContext_HttpRequest) ValidateAll() error {
626 return m.validate(true)
627 }
628
629 func (m *AttributeContext_HttpRequest) validate(all bool) error {
630 if m == nil {
631 return nil
632 }
633
634 var errors []error
635
636 // no validation rules for Id
637
638 // no validation rules for Method
639
640 // no validation rules for Headers
641
642 if all {
643 switch v := interface{}(m.GetHeaderMap()).(type) {
644 case interface{ ValidateAll() error }:
645 if err := v.ValidateAll(); err != nil {
646 errors = append(errors, AttributeContext_HttpRequestValidationError{
647 field: "HeaderMap",
648 reason: "embedded message failed validation",
649 cause: err,
650 })
651 }
652 case interface{ Validate() error }:
653 if err := v.Validate(); err != nil {
654 errors = append(errors, AttributeContext_HttpRequestValidationError{
655 field: "HeaderMap",
656 reason: "embedded message failed validation",
657 cause: err,
658 })
659 }
660 }
661 } else if v, ok := interface{}(m.GetHeaderMap()).(interface{ Validate() error }); ok {
662 if err := v.Validate(); err != nil {
663 return AttributeContext_HttpRequestValidationError{
664 field: "HeaderMap",
665 reason: "embedded message failed validation",
666 cause: err,
667 }
668 }
669 }
670
671 // no validation rules for Path
672
673 // no validation rules for Host
674
675 // no validation rules for Scheme
676
677 // no validation rules for Query
678
679 // no validation rules for Fragment
680
681 // no validation rules for Size
682
683 // no validation rules for Protocol
684
685 // no validation rules for Body
686
687 // no validation rules for RawBody
688
689 if len(errors) > 0 {
690 return AttributeContext_HttpRequestMultiError(errors)
691 }
692
693 return nil
694 }
695
696 // AttributeContext_HttpRequestMultiError is an error wrapping multiple
697 // validation errors returned by AttributeContext_HttpRequest.ValidateAll() if
698 // the designated constraints aren't met.
699 type AttributeContext_HttpRequestMultiError []error
700
701 // Error returns a concatenation of all the error messages it wraps.
702 func (m AttributeContext_HttpRequestMultiError) Error() string {
703 var msgs []string
704 for _, err := range m {
705 msgs = append(msgs, err.Error())
706 }
707 return strings.Join(msgs, "; ")
708 }
709
710 // AllErrors returns a list of validation violation errors.
711 func (m AttributeContext_HttpRequestMultiError) AllErrors() []error { return m }
712
713 // AttributeContext_HttpRequestValidationError is the validation error returned
714 // by AttributeContext_HttpRequest.Validate if the designated constraints
715 // aren't met.
716 type AttributeContext_HttpRequestValidationError struct {
717 field string
718 reason string
719 cause error
720 key bool
721 }
722
723 // Field function returns field value.
724 func (e AttributeContext_HttpRequestValidationError) Field() string { return e.field }
725
726 // Reason function returns reason value.
727 func (e AttributeContext_HttpRequestValidationError) Reason() string { return e.reason }
728
729 // Cause function returns cause value.
730 func (e AttributeContext_HttpRequestValidationError) Cause() error { return e.cause }
731
732 // Key function returns key value.
733 func (e AttributeContext_HttpRequestValidationError) Key() bool { return e.key }
734
735 // ErrorName returns error name.
736 func (e AttributeContext_HttpRequestValidationError) ErrorName() string {
737 return "AttributeContext_HttpRequestValidationError"
738 }
739
740 // Error satisfies the builtin error interface
741 func (e AttributeContext_HttpRequestValidationError) Error() string {
742 cause := ""
743 if e.cause != nil {
744 cause = fmt.Sprintf(" | caused by: %v", e.cause)
745 }
746
747 key := ""
748 if e.key {
749 key = "key for "
750 }
751
752 return fmt.Sprintf(
753 "invalid %sAttributeContext_HttpRequest.%s: %s%s",
754 key,
755 e.field,
756 e.reason,
757 cause)
758 }
759
760 var _ error = AttributeContext_HttpRequestValidationError{}
761
762 var _ interface {
763 Field() string
764 Reason() string
765 Key() bool
766 Cause() error
767 ErrorName() string
768 } = AttributeContext_HttpRequestValidationError{}
769
770 // Validate checks the field values on AttributeContext_TLSSession with the
771 // rules defined in the proto definition for this message. If any rules are
772 // violated, the first error encountered is returned, or nil if there are no violations.
773 func (m *AttributeContext_TLSSession) Validate() error {
774 return m.validate(false)
775 }
776
777 // ValidateAll checks the field values on AttributeContext_TLSSession with the
778 // rules defined in the proto definition for this message. If any rules are
779 // violated, the result is a list of violation errors wrapped in
780 // AttributeContext_TLSSessionMultiError, or nil if none found.
781 func (m *AttributeContext_TLSSession) ValidateAll() error {
782 return m.validate(true)
783 }
784
785 func (m *AttributeContext_TLSSession) validate(all bool) error {
786 if m == nil {
787 return nil
788 }
789
790 var errors []error
791
792 // no validation rules for Sni
793
794 if len(errors) > 0 {
795 return AttributeContext_TLSSessionMultiError(errors)
796 }
797
798 return nil
799 }
800
801 // AttributeContext_TLSSessionMultiError is an error wrapping multiple
802 // validation errors returned by AttributeContext_TLSSession.ValidateAll() if
803 // the designated constraints aren't met.
804 type AttributeContext_TLSSessionMultiError []error
805
806 // Error returns a concatenation of all the error messages it wraps.
807 func (m AttributeContext_TLSSessionMultiError) Error() string {
808 var msgs []string
809 for _, err := range m {
810 msgs = append(msgs, err.Error())
811 }
812 return strings.Join(msgs, "; ")
813 }
814
815 // AllErrors returns a list of validation violation errors.
816 func (m AttributeContext_TLSSessionMultiError) AllErrors() []error { return m }
817
818 // AttributeContext_TLSSessionValidationError is the validation error returned
819 // by AttributeContext_TLSSession.Validate if the designated constraints
820 // aren't met.
821 type AttributeContext_TLSSessionValidationError struct {
822 field string
823 reason string
824 cause error
825 key bool
826 }
827
828 // Field function returns field value.
829 func (e AttributeContext_TLSSessionValidationError) Field() string { return e.field }
830
831 // Reason function returns reason value.
832 func (e AttributeContext_TLSSessionValidationError) Reason() string { return e.reason }
833
834 // Cause function returns cause value.
835 func (e AttributeContext_TLSSessionValidationError) Cause() error { return e.cause }
836
837 // Key function returns key value.
838 func (e AttributeContext_TLSSessionValidationError) Key() bool { return e.key }
839
840 // ErrorName returns error name.
841 func (e AttributeContext_TLSSessionValidationError) ErrorName() string {
842 return "AttributeContext_TLSSessionValidationError"
843 }
844
845 // Error satisfies the builtin error interface
846 func (e AttributeContext_TLSSessionValidationError) Error() string {
847 cause := ""
848 if e.cause != nil {
849 cause = fmt.Sprintf(" | caused by: %v", e.cause)
850 }
851
852 key := ""
853 if e.key {
854 key = "key for "
855 }
856
857 return fmt.Sprintf(
858 "invalid %sAttributeContext_TLSSession.%s: %s%s",
859 key,
860 e.field,
861 e.reason,
862 cause)
863 }
864
865 var _ error = AttributeContext_TLSSessionValidationError{}
866
867 var _ interface {
868 Field() string
869 Reason() string
870 Key() bool
871 Cause() error
872 ErrorName() string
873 } = AttributeContext_TLSSessionValidationError{}