security.pb.validate.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: udpa/annotations/security.proto
  3. package annotations
  4. import (
  5. "bytes"
  6. "errors"
  7. "fmt"
  8. "net"
  9. "net/mail"
  10. "net/url"
  11. "regexp"
  12. "strings"
  13. "time"
  14. "unicode/utf8"
  15. "google.golang.org/protobuf/types/known/anypb"
  16. )
  17. // ensure the imports are used
  18. var (
  19. _ = bytes.MinRead
  20. _ = errors.New("")
  21. _ = fmt.Print
  22. _ = utf8.UTFMax
  23. _ = (*regexp.Regexp)(nil)
  24. _ = (*strings.Reader)(nil)
  25. _ = net.IPv4len
  26. _ = time.Duration(0)
  27. _ = (*url.URL)(nil)
  28. _ = (*mail.Address)(nil)
  29. _ = anypb.Any{}
  30. )
  31. // Validate checks the field values on FieldSecurityAnnotation with the rules
  32. // defined in the proto definition for this message. If any rules are
  33. // violated, an error is returned.
  34. func (m *FieldSecurityAnnotation) Validate() error {
  35. if m == nil {
  36. return nil
  37. }
  38. // no validation rules for ConfigureForUntrustedDownstream
  39. // no validation rules for ConfigureForUntrustedUpstream
  40. return nil
  41. }
  42. // FieldSecurityAnnotationValidationError is the validation error returned by
  43. // FieldSecurityAnnotation.Validate if the designated constraints aren't met.
  44. type FieldSecurityAnnotationValidationError struct {
  45. field string
  46. reason string
  47. cause error
  48. key bool
  49. }
  50. // Field function returns field value.
  51. func (e FieldSecurityAnnotationValidationError) Field() string { return e.field }
  52. // Reason function returns reason value.
  53. func (e FieldSecurityAnnotationValidationError) Reason() string { return e.reason }
  54. // Cause function returns cause value.
  55. func (e FieldSecurityAnnotationValidationError) Cause() error { return e.cause }
  56. // Key function returns key value.
  57. func (e FieldSecurityAnnotationValidationError) Key() bool { return e.key }
  58. // ErrorName returns error name.
  59. func (e FieldSecurityAnnotationValidationError) ErrorName() string {
  60. return "FieldSecurityAnnotationValidationError"
  61. }
  62. // Error satisfies the builtin error interface
  63. func (e FieldSecurityAnnotationValidationError) Error() string {
  64. cause := ""
  65. if e.cause != nil {
  66. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  67. }
  68. key := ""
  69. if e.key {
  70. key = "key for "
  71. }
  72. return fmt.Sprintf(
  73. "invalid %sFieldSecurityAnnotation.%s: %s%s",
  74. key,
  75. e.field,
  76. e.reason,
  77. cause)
  78. }
  79. var _ error = FieldSecurityAnnotationValidationError{}
  80. var _ interface {
  81. Field() string
  82. Reason() string
  83. Key() bool
  84. Cause() error
  85. ErrorName() string
  86. } = FieldSecurityAnnotationValidationError{}