/pkg/api/envoy/extensions/filters/http/grpc_http1_reverse_bridge/v3/config.pb.validate.go

https://github.com/datawire/ambassador · Go · 180 lines · 118 code · 34 blank · 28 comment · 11 complexity · 013f02b69bafe53e5a83ac17c7a0cf6e MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/extensions/filters/http/grpc_http1_reverse_bridge/v3/config.proto
  3. package envoy_extensions_filters_http_grpc_http1_reverse_bridge_v3
  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. "github.com/golang/protobuf/ptypes"
  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. _ = ptypes.DynamicAny{}
  30. )
  31. // define the regex for a UUID once up-front
  32. var _config_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
  33. // Validate checks the field values on FilterConfig with the rules defined in
  34. // the proto definition for this message. If any rules are violated, an error
  35. // is returned.
  36. func (m *FilterConfig) Validate() error {
  37. if m == nil {
  38. return nil
  39. }
  40. if len(m.GetContentType()) < 1 {
  41. return FilterConfigValidationError{
  42. field: "ContentType",
  43. reason: "value length must be at least 1 bytes",
  44. }
  45. }
  46. // no validation rules for WithholdGrpcFrames
  47. return nil
  48. }
  49. // FilterConfigValidationError is the validation error returned by
  50. // FilterConfig.Validate if the designated constraints aren't met.
  51. type FilterConfigValidationError struct {
  52. field string
  53. reason string
  54. cause error
  55. key bool
  56. }
  57. // Field function returns field value.
  58. func (e FilterConfigValidationError) Field() string { return e.field }
  59. // Reason function returns reason value.
  60. func (e FilterConfigValidationError) Reason() string { return e.reason }
  61. // Cause function returns cause value.
  62. func (e FilterConfigValidationError) Cause() error { return e.cause }
  63. // Key function returns key value.
  64. func (e FilterConfigValidationError) Key() bool { return e.key }
  65. // ErrorName returns error name.
  66. func (e FilterConfigValidationError) ErrorName() string { return "FilterConfigValidationError" }
  67. // Error satisfies the builtin error interface
  68. func (e FilterConfigValidationError) Error() string {
  69. cause := ""
  70. if e.cause != nil {
  71. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  72. }
  73. key := ""
  74. if e.key {
  75. key = "key for "
  76. }
  77. return fmt.Sprintf(
  78. "invalid %sFilterConfig.%s: %s%s",
  79. key,
  80. e.field,
  81. e.reason,
  82. cause)
  83. }
  84. var _ error = FilterConfigValidationError{}
  85. var _ interface {
  86. Field() string
  87. Reason() string
  88. Key() bool
  89. Cause() error
  90. ErrorName() string
  91. } = FilterConfigValidationError{}
  92. // Validate checks the field values on FilterConfigPerRoute with the rules
  93. // defined in the proto definition for this message. If any rules are
  94. // violated, an error is returned.
  95. func (m *FilterConfigPerRoute) Validate() error {
  96. if m == nil {
  97. return nil
  98. }
  99. // no validation rules for Disabled
  100. return nil
  101. }
  102. // FilterConfigPerRouteValidationError is the validation error returned by
  103. // FilterConfigPerRoute.Validate if the designated constraints aren't met.
  104. type FilterConfigPerRouteValidationError struct {
  105. field string
  106. reason string
  107. cause error
  108. key bool
  109. }
  110. // Field function returns field value.
  111. func (e FilterConfigPerRouteValidationError) Field() string { return e.field }
  112. // Reason function returns reason value.
  113. func (e FilterConfigPerRouteValidationError) Reason() string { return e.reason }
  114. // Cause function returns cause value.
  115. func (e FilterConfigPerRouteValidationError) Cause() error { return e.cause }
  116. // Key function returns key value.
  117. func (e FilterConfigPerRouteValidationError) Key() bool { return e.key }
  118. // ErrorName returns error name.
  119. func (e FilterConfigPerRouteValidationError) ErrorName() string {
  120. return "FilterConfigPerRouteValidationError"
  121. }
  122. // Error satisfies the builtin error interface
  123. func (e FilterConfigPerRouteValidationError) Error() string {
  124. cause := ""
  125. if e.cause != nil {
  126. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  127. }
  128. key := ""
  129. if e.key {
  130. key = "key for "
  131. }
  132. return fmt.Sprintf(
  133. "invalid %sFilterConfigPerRoute.%s: %s%s",
  134. key,
  135. e.field,
  136. e.reason,
  137. cause)
  138. }
  139. var _ error = FilterConfigPerRouteValidationError{}
  140. var _ interface {
  141. Field() string
  142. Reason() string
  143. Key() bool
  144. Cause() error
  145. ErrorName() string
  146. } = FilterConfigPerRouteValidationError{}