/pkg/api/envoy/service/tap/v4alpha/tap.pb.validate.go

https://github.com/datawire/ambassador · Go · 280 lines · 190 code · 50 blank · 40 comment · 26 complexity · e5792b62e7f49cb12b05ba60109560a3 MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/service/tap/v4alpha/tap.proto
  3. package envoy_service_tap_v4alpha
  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 _tap_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 StreamTapsRequest with the rules defined
  34. // in the proto definition for this message. If any rules are violated, an
  35. // error is returned.
  36. func (m *StreamTapsRequest) Validate() error {
  37. if m == nil {
  38. return nil
  39. }
  40. if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok {
  41. if err := v.Validate(); err != nil {
  42. return StreamTapsRequestValidationError{
  43. field: "Identifier",
  44. reason: "embedded message failed validation",
  45. cause: err,
  46. }
  47. }
  48. }
  49. // no validation rules for TraceId
  50. if v, ok := interface{}(m.GetTrace()).(interface{ Validate() error }); ok {
  51. if err := v.Validate(); err != nil {
  52. return StreamTapsRequestValidationError{
  53. field: "Trace",
  54. reason: "embedded message failed validation",
  55. cause: err,
  56. }
  57. }
  58. }
  59. return nil
  60. }
  61. // StreamTapsRequestValidationError is the validation error returned by
  62. // StreamTapsRequest.Validate if the designated constraints aren't met.
  63. type StreamTapsRequestValidationError struct {
  64. field string
  65. reason string
  66. cause error
  67. key bool
  68. }
  69. // Field function returns field value.
  70. func (e StreamTapsRequestValidationError) Field() string { return e.field }
  71. // Reason function returns reason value.
  72. func (e StreamTapsRequestValidationError) Reason() string { return e.reason }
  73. // Cause function returns cause value.
  74. func (e StreamTapsRequestValidationError) Cause() error { return e.cause }
  75. // Key function returns key value.
  76. func (e StreamTapsRequestValidationError) Key() bool { return e.key }
  77. // ErrorName returns error name.
  78. func (e StreamTapsRequestValidationError) ErrorName() string {
  79. return "StreamTapsRequestValidationError"
  80. }
  81. // Error satisfies the builtin error interface
  82. func (e StreamTapsRequestValidationError) Error() string {
  83. cause := ""
  84. if e.cause != nil {
  85. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  86. }
  87. key := ""
  88. if e.key {
  89. key = "key for "
  90. }
  91. return fmt.Sprintf(
  92. "invalid %sStreamTapsRequest.%s: %s%s",
  93. key,
  94. e.field,
  95. e.reason,
  96. cause)
  97. }
  98. var _ error = StreamTapsRequestValidationError{}
  99. var _ interface {
  100. Field() string
  101. Reason() string
  102. Key() bool
  103. Cause() error
  104. ErrorName() string
  105. } = StreamTapsRequestValidationError{}
  106. // Validate checks the field values on StreamTapsResponse with the rules
  107. // defined in the proto definition for this message. If any rules are
  108. // violated, an error is returned.
  109. func (m *StreamTapsResponse) Validate() error {
  110. if m == nil {
  111. return nil
  112. }
  113. return nil
  114. }
  115. // StreamTapsResponseValidationError is the validation error returned by
  116. // StreamTapsResponse.Validate if the designated constraints aren't met.
  117. type StreamTapsResponseValidationError struct {
  118. field string
  119. reason string
  120. cause error
  121. key bool
  122. }
  123. // Field function returns field value.
  124. func (e StreamTapsResponseValidationError) Field() string { return e.field }
  125. // Reason function returns reason value.
  126. func (e StreamTapsResponseValidationError) Reason() string { return e.reason }
  127. // Cause function returns cause value.
  128. func (e StreamTapsResponseValidationError) Cause() error { return e.cause }
  129. // Key function returns key value.
  130. func (e StreamTapsResponseValidationError) Key() bool { return e.key }
  131. // ErrorName returns error name.
  132. func (e StreamTapsResponseValidationError) ErrorName() string {
  133. return "StreamTapsResponseValidationError"
  134. }
  135. // Error satisfies the builtin error interface
  136. func (e StreamTapsResponseValidationError) Error() string {
  137. cause := ""
  138. if e.cause != nil {
  139. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  140. }
  141. key := ""
  142. if e.key {
  143. key = "key for "
  144. }
  145. return fmt.Sprintf(
  146. "invalid %sStreamTapsResponse.%s: %s%s",
  147. key,
  148. e.field,
  149. e.reason,
  150. cause)
  151. }
  152. var _ error = StreamTapsResponseValidationError{}
  153. var _ interface {
  154. Field() string
  155. Reason() string
  156. Key() bool
  157. Cause() error
  158. ErrorName() string
  159. } = StreamTapsResponseValidationError{}
  160. // Validate checks the field values on StreamTapsRequest_Identifier with the
  161. // rules defined in the proto definition for this message. If any rules are
  162. // violated, an error is returned.
  163. func (m *StreamTapsRequest_Identifier) Validate() error {
  164. if m == nil {
  165. return nil
  166. }
  167. if m.GetNode() == nil {
  168. return StreamTapsRequest_IdentifierValidationError{
  169. field: "Node",
  170. reason: "value is required",
  171. }
  172. }
  173. if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
  174. if err := v.Validate(); err != nil {
  175. return StreamTapsRequest_IdentifierValidationError{
  176. field: "Node",
  177. reason: "embedded message failed validation",
  178. cause: err,
  179. }
  180. }
  181. }
  182. // no validation rules for TapId
  183. return nil
  184. }
  185. // StreamTapsRequest_IdentifierValidationError is the validation error returned
  186. // by StreamTapsRequest_Identifier.Validate if the designated constraints
  187. // aren't met.
  188. type StreamTapsRequest_IdentifierValidationError struct {
  189. field string
  190. reason string
  191. cause error
  192. key bool
  193. }
  194. // Field function returns field value.
  195. func (e StreamTapsRequest_IdentifierValidationError) Field() string { return e.field }
  196. // Reason function returns reason value.
  197. func (e StreamTapsRequest_IdentifierValidationError) Reason() string { return e.reason }
  198. // Cause function returns cause value.
  199. func (e StreamTapsRequest_IdentifierValidationError) Cause() error { return e.cause }
  200. // Key function returns key value.
  201. func (e StreamTapsRequest_IdentifierValidationError) Key() bool { return e.key }
  202. // ErrorName returns error name.
  203. func (e StreamTapsRequest_IdentifierValidationError) ErrorName() string {
  204. return "StreamTapsRequest_IdentifierValidationError"
  205. }
  206. // Error satisfies the builtin error interface
  207. func (e StreamTapsRequest_IdentifierValidationError) Error() string {
  208. cause := ""
  209. if e.cause != nil {
  210. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  211. }
  212. key := ""
  213. if e.key {
  214. key = "key for "
  215. }
  216. return fmt.Sprintf(
  217. "invalid %sStreamTapsRequest_Identifier.%s: %s%s",
  218. key,
  219. e.field,
  220. e.reason,
  221. cause)
  222. }
  223. var _ error = StreamTapsRequest_IdentifierValidationError{}
  224. var _ interface {
  225. Field() string
  226. Reason() string
  227. Key() bool
  228. Cause() error
  229. ErrorName() string
  230. } = StreamTapsRequest_IdentifierValidationError{}