/backend/api/resolver/k8s/v1/k8s.pb.validate.go

https://github.com/lyft/clutch · Go · 313 lines · 192 code · 67 blank · 54 comment · 20 complexity · e1272fd48104bdbe5b6551f3f627c81c MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: resolver/k8s/v1/k8s.proto
  3. package k8sv1
  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 _k_8_s_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 PodID with the rules defined in the
  34. // proto definition for this message. If any rules are violated, an error is returned.
  35. func (m *PodID) Validate() error {
  36. if m == nil {
  37. return nil
  38. }
  39. // no validation rules for Name
  40. // no validation rules for Clientset
  41. // no validation rules for Namespace
  42. return nil
  43. }
  44. // PodIDValidationError is the validation error returned by PodID.Validate if
  45. // the designated constraints aren't met.
  46. type PodIDValidationError struct {
  47. field string
  48. reason string
  49. cause error
  50. key bool
  51. }
  52. // Field function returns field value.
  53. func (e PodIDValidationError) Field() string { return e.field }
  54. // Reason function returns reason value.
  55. func (e PodIDValidationError) Reason() string { return e.reason }
  56. // Cause function returns cause value.
  57. func (e PodIDValidationError) Cause() error { return e.cause }
  58. // Key function returns key value.
  59. func (e PodIDValidationError) Key() bool { return e.key }
  60. // ErrorName returns error name.
  61. func (e PodIDValidationError) ErrorName() string { return "PodIDValidationError" }
  62. // Error satisfies the builtin error interface
  63. func (e PodIDValidationError) 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 %sPodID.%s: %s%s",
  74. key,
  75. e.field,
  76. e.reason,
  77. cause)
  78. }
  79. var _ error = PodIDValidationError{}
  80. var _ interface {
  81. Field() string
  82. Reason() string
  83. Key() bool
  84. Cause() error
  85. ErrorName() string
  86. } = PodIDValidationError{}
  87. // Validate checks the field values on IPAddress with the rules defined in the
  88. // proto definition for this message. If any rules are violated, an error is returned.
  89. func (m *IPAddress) Validate() error {
  90. if m == nil {
  91. return nil
  92. }
  93. // no validation rules for IpAddress
  94. return nil
  95. }
  96. // IPAddressValidationError is the validation error returned by
  97. // IPAddress.Validate if the designated constraints aren't met.
  98. type IPAddressValidationError struct {
  99. field string
  100. reason string
  101. cause error
  102. key bool
  103. }
  104. // Field function returns field value.
  105. func (e IPAddressValidationError) Field() string { return e.field }
  106. // Reason function returns reason value.
  107. func (e IPAddressValidationError) Reason() string { return e.reason }
  108. // Cause function returns cause value.
  109. func (e IPAddressValidationError) Cause() error { return e.cause }
  110. // Key function returns key value.
  111. func (e IPAddressValidationError) Key() bool { return e.key }
  112. // ErrorName returns error name.
  113. func (e IPAddressValidationError) ErrorName() string { return "IPAddressValidationError" }
  114. // Error satisfies the builtin error interface
  115. func (e IPAddressValidationError) Error() string {
  116. cause := ""
  117. if e.cause != nil {
  118. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  119. }
  120. key := ""
  121. if e.key {
  122. key = "key for "
  123. }
  124. return fmt.Sprintf(
  125. "invalid %sIPAddress.%s: %s%s",
  126. key,
  127. e.field,
  128. e.reason,
  129. cause)
  130. }
  131. var _ error = IPAddressValidationError{}
  132. var _ interface {
  133. Field() string
  134. Reason() string
  135. Key() bool
  136. Cause() error
  137. ErrorName() string
  138. } = IPAddressValidationError{}
  139. // Validate checks the field values on HPAName with the rules defined in the
  140. // proto definition for this message. If any rules are violated, an error is returned.
  141. func (m *HPAName) Validate() error {
  142. if m == nil {
  143. return nil
  144. }
  145. // no validation rules for Name
  146. // no validation rules for Clientset
  147. // no validation rules for Namespace
  148. return nil
  149. }
  150. // HPANameValidationError is the validation error returned by HPAName.Validate
  151. // if the designated constraints aren't met.
  152. type HPANameValidationError struct {
  153. field string
  154. reason string
  155. cause error
  156. key bool
  157. }
  158. // Field function returns field value.
  159. func (e HPANameValidationError) Field() string { return e.field }
  160. // Reason function returns reason value.
  161. func (e HPANameValidationError) Reason() string { return e.reason }
  162. // Cause function returns cause value.
  163. func (e HPANameValidationError) Cause() error { return e.cause }
  164. // Key function returns key value.
  165. func (e HPANameValidationError) Key() bool { return e.key }
  166. // ErrorName returns error name.
  167. func (e HPANameValidationError) ErrorName() string { return "HPANameValidationError" }
  168. // Error satisfies the builtin error interface
  169. func (e HPANameValidationError) Error() string {
  170. cause := ""
  171. if e.cause != nil {
  172. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  173. }
  174. key := ""
  175. if e.key {
  176. key = "key for "
  177. }
  178. return fmt.Sprintf(
  179. "invalid %sHPAName.%s: %s%s",
  180. key,
  181. e.field,
  182. e.reason,
  183. cause)
  184. }
  185. var _ error = HPANameValidationError{}
  186. var _ interface {
  187. Field() string
  188. Reason() string
  189. Key() bool
  190. Cause() error
  191. ErrorName() string
  192. } = HPANameValidationError{}
  193. // Validate checks the field values on Deployment with the rules defined in the
  194. // proto definition for this message. If any rules are violated, an error is returned.
  195. func (m *Deployment) Validate() error {
  196. if m == nil {
  197. return nil
  198. }
  199. // no validation rules for Name
  200. // no validation rules for Clientset
  201. // no validation rules for Namespace
  202. return nil
  203. }
  204. // DeploymentValidationError is the validation error returned by
  205. // Deployment.Validate if the designated constraints aren't met.
  206. type DeploymentValidationError struct {
  207. field string
  208. reason string
  209. cause error
  210. key bool
  211. }
  212. // Field function returns field value.
  213. func (e DeploymentValidationError) Field() string { return e.field }
  214. // Reason function returns reason value.
  215. func (e DeploymentValidationError) Reason() string { return e.reason }
  216. // Cause function returns cause value.
  217. func (e DeploymentValidationError) Cause() error { return e.cause }
  218. // Key function returns key value.
  219. func (e DeploymentValidationError) Key() bool { return e.key }
  220. // ErrorName returns error name.
  221. func (e DeploymentValidationError) ErrorName() string { return "DeploymentValidationError" }
  222. // Error satisfies the builtin error interface
  223. func (e DeploymentValidationError) Error() string {
  224. cause := ""
  225. if e.cause != nil {
  226. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  227. }
  228. key := ""
  229. if e.key {
  230. key = "key for "
  231. }
  232. return fmt.Sprintf(
  233. "invalid %sDeployment.%s: %s%s",
  234. key,
  235. e.field,
  236. e.reason,
  237. cause)
  238. }
  239. var _ error = DeploymentValidationError{}
  240. var _ interface {
  241. Field() string
  242. Reason() string
  243. Key() bool
  244. Cause() error
  245. ErrorName() string
  246. } = DeploymentValidationError{}