/pkg/api/envoy/config/core/v3/protocol.pb.validate.go

https://github.com/datawire/ambassador · Go · 907 lines · 615 code · 174 blank · 118 comment · 114 complexity · 4122bb8f77f7f3a0f740f1a2cd9153bc MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/config/core/v3/protocol.proto
  3. package envoy_config_core_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 _protocol_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 TcpProtocolOptions with the rules
  34. // defined in the proto definition for this message. If any rules are
  35. // violated, an error is returned.
  36. func (m *TcpProtocolOptions) Validate() error {
  37. if m == nil {
  38. return nil
  39. }
  40. return nil
  41. }
  42. // TcpProtocolOptionsValidationError is the validation error returned by
  43. // TcpProtocolOptions.Validate if the designated constraints aren't met.
  44. type TcpProtocolOptionsValidationError struct {
  45. field string
  46. reason string
  47. cause error
  48. key bool
  49. }
  50. // Field function returns field value.
  51. func (e TcpProtocolOptionsValidationError) Field() string { return e.field }
  52. // Reason function returns reason value.
  53. func (e TcpProtocolOptionsValidationError) Reason() string { return e.reason }
  54. // Cause function returns cause value.
  55. func (e TcpProtocolOptionsValidationError) Cause() error { return e.cause }
  56. // Key function returns key value.
  57. func (e TcpProtocolOptionsValidationError) Key() bool { return e.key }
  58. // ErrorName returns error name.
  59. func (e TcpProtocolOptionsValidationError) ErrorName() string {
  60. return "TcpProtocolOptionsValidationError"
  61. }
  62. // Error satisfies the builtin error interface
  63. func (e TcpProtocolOptionsValidationError) 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 %sTcpProtocolOptions.%s: %s%s",
  74. key,
  75. e.field,
  76. e.reason,
  77. cause)
  78. }
  79. var _ error = TcpProtocolOptionsValidationError{}
  80. var _ interface {
  81. Field() string
  82. Reason() string
  83. Key() bool
  84. Cause() error
  85. ErrorName() string
  86. } = TcpProtocolOptionsValidationError{}
  87. // Validate checks the field values on UpstreamHttpProtocolOptions with the
  88. // rules defined in the proto definition for this message. If any rules are
  89. // violated, an error is returned.
  90. func (m *UpstreamHttpProtocolOptions) Validate() error {
  91. if m == nil {
  92. return nil
  93. }
  94. // no validation rules for AutoSni
  95. // no validation rules for AutoSanValidation
  96. return nil
  97. }
  98. // UpstreamHttpProtocolOptionsValidationError is the validation error returned
  99. // by UpstreamHttpProtocolOptions.Validate if the designated constraints
  100. // aren't met.
  101. type UpstreamHttpProtocolOptionsValidationError struct {
  102. field string
  103. reason string
  104. cause error
  105. key bool
  106. }
  107. // Field function returns field value.
  108. func (e UpstreamHttpProtocolOptionsValidationError) Field() string { return e.field }
  109. // Reason function returns reason value.
  110. func (e UpstreamHttpProtocolOptionsValidationError) Reason() string { return e.reason }
  111. // Cause function returns cause value.
  112. func (e UpstreamHttpProtocolOptionsValidationError) Cause() error { return e.cause }
  113. // Key function returns key value.
  114. func (e UpstreamHttpProtocolOptionsValidationError) Key() bool { return e.key }
  115. // ErrorName returns error name.
  116. func (e UpstreamHttpProtocolOptionsValidationError) ErrorName() string {
  117. return "UpstreamHttpProtocolOptionsValidationError"
  118. }
  119. // Error satisfies the builtin error interface
  120. func (e UpstreamHttpProtocolOptionsValidationError) Error() string {
  121. cause := ""
  122. if e.cause != nil {
  123. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  124. }
  125. key := ""
  126. if e.key {
  127. key = "key for "
  128. }
  129. return fmt.Sprintf(
  130. "invalid %sUpstreamHttpProtocolOptions.%s: %s%s",
  131. key,
  132. e.field,
  133. e.reason,
  134. cause)
  135. }
  136. var _ error = UpstreamHttpProtocolOptionsValidationError{}
  137. var _ interface {
  138. Field() string
  139. Reason() string
  140. Key() bool
  141. Cause() error
  142. ErrorName() string
  143. } = UpstreamHttpProtocolOptionsValidationError{}
  144. // Validate checks the field values on HttpProtocolOptions with the rules
  145. // defined in the proto definition for this message. If any rules are
  146. // violated, an error is returned.
  147. func (m *HttpProtocolOptions) Validate() error {
  148. if m == nil {
  149. return nil
  150. }
  151. if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok {
  152. if err := v.Validate(); err != nil {
  153. return HttpProtocolOptionsValidationError{
  154. field: "IdleTimeout",
  155. reason: "embedded message failed validation",
  156. cause: err,
  157. }
  158. }
  159. }
  160. if v, ok := interface{}(m.GetMaxConnectionDuration()).(interface{ Validate() error }); ok {
  161. if err := v.Validate(); err != nil {
  162. return HttpProtocolOptionsValidationError{
  163. field: "MaxConnectionDuration",
  164. reason: "embedded message failed validation",
  165. cause: err,
  166. }
  167. }
  168. }
  169. if wrapper := m.GetMaxHeadersCount(); wrapper != nil {
  170. if wrapper.GetValue() < 1 {
  171. return HttpProtocolOptionsValidationError{
  172. field: "MaxHeadersCount",
  173. reason: "value must be greater than or equal to 1",
  174. }
  175. }
  176. }
  177. if v, ok := interface{}(m.GetMaxStreamDuration()).(interface{ Validate() error }); ok {
  178. if err := v.Validate(); err != nil {
  179. return HttpProtocolOptionsValidationError{
  180. field: "MaxStreamDuration",
  181. reason: "embedded message failed validation",
  182. cause: err,
  183. }
  184. }
  185. }
  186. // no validation rules for HeadersWithUnderscoresAction
  187. return nil
  188. }
  189. // HttpProtocolOptionsValidationError is the validation error returned by
  190. // HttpProtocolOptions.Validate if the designated constraints aren't met.
  191. type HttpProtocolOptionsValidationError struct {
  192. field string
  193. reason string
  194. cause error
  195. key bool
  196. }
  197. // Field function returns field value.
  198. func (e HttpProtocolOptionsValidationError) Field() string { return e.field }
  199. // Reason function returns reason value.
  200. func (e HttpProtocolOptionsValidationError) Reason() string { return e.reason }
  201. // Cause function returns cause value.
  202. func (e HttpProtocolOptionsValidationError) Cause() error { return e.cause }
  203. // Key function returns key value.
  204. func (e HttpProtocolOptionsValidationError) Key() bool { return e.key }
  205. // ErrorName returns error name.
  206. func (e HttpProtocolOptionsValidationError) ErrorName() string {
  207. return "HttpProtocolOptionsValidationError"
  208. }
  209. // Error satisfies the builtin error interface
  210. func (e HttpProtocolOptionsValidationError) Error() string {
  211. cause := ""
  212. if e.cause != nil {
  213. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  214. }
  215. key := ""
  216. if e.key {
  217. key = "key for "
  218. }
  219. return fmt.Sprintf(
  220. "invalid %sHttpProtocolOptions.%s: %s%s",
  221. key,
  222. e.field,
  223. e.reason,
  224. cause)
  225. }
  226. var _ error = HttpProtocolOptionsValidationError{}
  227. var _ interface {
  228. Field() string
  229. Reason() string
  230. Key() bool
  231. Cause() error
  232. ErrorName() string
  233. } = HttpProtocolOptionsValidationError{}
  234. // Validate checks the field values on Http1ProtocolOptions with the rules
  235. // defined in the proto definition for this message. If any rules are
  236. // violated, an error is returned.
  237. func (m *Http1ProtocolOptions) Validate() error {
  238. if m == nil {
  239. return nil
  240. }
  241. if v, ok := interface{}(m.GetAllowAbsoluteUrl()).(interface{ Validate() error }); ok {
  242. if err := v.Validate(); err != nil {
  243. return Http1ProtocolOptionsValidationError{
  244. field: "AllowAbsoluteUrl",
  245. reason: "embedded message failed validation",
  246. cause: err,
  247. }
  248. }
  249. }
  250. // no validation rules for AcceptHttp_10
  251. // no validation rules for DefaultHostForHttp_10
  252. if v, ok := interface{}(m.GetHeaderKeyFormat()).(interface{ Validate() error }); ok {
  253. if err := v.Validate(); err != nil {
  254. return Http1ProtocolOptionsValidationError{
  255. field: "HeaderKeyFormat",
  256. reason: "embedded message failed validation",
  257. cause: err,
  258. }
  259. }
  260. }
  261. // no validation rules for EnableTrailers
  262. return nil
  263. }
  264. // Http1ProtocolOptionsValidationError is the validation error returned by
  265. // Http1ProtocolOptions.Validate if the designated constraints aren't met.
  266. type Http1ProtocolOptionsValidationError struct {
  267. field string
  268. reason string
  269. cause error
  270. key bool
  271. }
  272. // Field function returns field value.
  273. func (e Http1ProtocolOptionsValidationError) Field() string { return e.field }
  274. // Reason function returns reason value.
  275. func (e Http1ProtocolOptionsValidationError) Reason() string { return e.reason }
  276. // Cause function returns cause value.
  277. func (e Http1ProtocolOptionsValidationError) Cause() error { return e.cause }
  278. // Key function returns key value.
  279. func (e Http1ProtocolOptionsValidationError) Key() bool { return e.key }
  280. // ErrorName returns error name.
  281. func (e Http1ProtocolOptionsValidationError) ErrorName() string {
  282. return "Http1ProtocolOptionsValidationError"
  283. }
  284. // Error satisfies the builtin error interface
  285. func (e Http1ProtocolOptionsValidationError) Error() string {
  286. cause := ""
  287. if e.cause != nil {
  288. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  289. }
  290. key := ""
  291. if e.key {
  292. key = "key for "
  293. }
  294. return fmt.Sprintf(
  295. "invalid %sHttp1ProtocolOptions.%s: %s%s",
  296. key,
  297. e.field,
  298. e.reason,
  299. cause)
  300. }
  301. var _ error = Http1ProtocolOptionsValidationError{}
  302. var _ interface {
  303. Field() string
  304. Reason() string
  305. Key() bool
  306. Cause() error
  307. ErrorName() string
  308. } = Http1ProtocolOptionsValidationError{}
  309. // Validate checks the field values on Http2ProtocolOptions with the rules
  310. // defined in the proto definition for this message. If any rules are
  311. // violated, an error is returned.
  312. func (m *Http2ProtocolOptions) Validate() error {
  313. if m == nil {
  314. return nil
  315. }
  316. if v, ok := interface{}(m.GetHpackTableSize()).(interface{ Validate() error }); ok {
  317. if err := v.Validate(); err != nil {
  318. return Http2ProtocolOptionsValidationError{
  319. field: "HpackTableSize",
  320. reason: "embedded message failed validation",
  321. cause: err,
  322. }
  323. }
  324. }
  325. if wrapper := m.GetMaxConcurrentStreams(); wrapper != nil {
  326. if val := wrapper.GetValue(); val < 1 || val > 2147483647 {
  327. return Http2ProtocolOptionsValidationError{
  328. field: "MaxConcurrentStreams",
  329. reason: "value must be inside range [1, 2147483647]",
  330. }
  331. }
  332. }
  333. if wrapper := m.GetInitialStreamWindowSize(); wrapper != nil {
  334. if val := wrapper.GetValue(); val < 65535 || val > 2147483647 {
  335. return Http2ProtocolOptionsValidationError{
  336. field: "InitialStreamWindowSize",
  337. reason: "value must be inside range [65535, 2147483647]",
  338. }
  339. }
  340. }
  341. if wrapper := m.GetInitialConnectionWindowSize(); wrapper != nil {
  342. if val := wrapper.GetValue(); val < 65535 || val > 2147483647 {
  343. return Http2ProtocolOptionsValidationError{
  344. field: "InitialConnectionWindowSize",
  345. reason: "value must be inside range [65535, 2147483647]",
  346. }
  347. }
  348. }
  349. // no validation rules for AllowConnect
  350. // no validation rules for AllowMetadata
  351. if wrapper := m.GetMaxOutboundFrames(); wrapper != nil {
  352. if wrapper.GetValue() < 1 {
  353. return Http2ProtocolOptionsValidationError{
  354. field: "MaxOutboundFrames",
  355. reason: "value must be greater than or equal to 1",
  356. }
  357. }
  358. }
  359. if wrapper := m.GetMaxOutboundControlFrames(); wrapper != nil {
  360. if wrapper.GetValue() < 1 {
  361. return Http2ProtocolOptionsValidationError{
  362. field: "MaxOutboundControlFrames",
  363. reason: "value must be greater than or equal to 1",
  364. }
  365. }
  366. }
  367. if v, ok := interface{}(m.GetMaxConsecutiveInboundFramesWithEmptyPayload()).(interface{ Validate() error }); ok {
  368. if err := v.Validate(); err != nil {
  369. return Http2ProtocolOptionsValidationError{
  370. field: "MaxConsecutiveInboundFramesWithEmptyPayload",
  371. reason: "embedded message failed validation",
  372. cause: err,
  373. }
  374. }
  375. }
  376. if v, ok := interface{}(m.GetMaxInboundPriorityFramesPerStream()).(interface{ Validate() error }); ok {
  377. if err := v.Validate(); err != nil {
  378. return Http2ProtocolOptionsValidationError{
  379. field: "MaxInboundPriorityFramesPerStream",
  380. reason: "embedded message failed validation",
  381. cause: err,
  382. }
  383. }
  384. }
  385. if wrapper := m.GetMaxInboundWindowUpdateFramesPerDataFrameSent(); wrapper != nil {
  386. if wrapper.GetValue() < 1 {
  387. return Http2ProtocolOptionsValidationError{
  388. field: "MaxInboundWindowUpdateFramesPerDataFrameSent",
  389. reason: "value must be greater than or equal to 1",
  390. }
  391. }
  392. }
  393. // no validation rules for StreamErrorOnInvalidHttpMessaging
  394. for idx, item := range m.GetCustomSettingsParameters() {
  395. _, _ = idx, item
  396. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  397. if err := v.Validate(); err != nil {
  398. return Http2ProtocolOptionsValidationError{
  399. field: fmt.Sprintf("CustomSettingsParameters[%v]", idx),
  400. reason: "embedded message failed validation",
  401. cause: err,
  402. }
  403. }
  404. }
  405. }
  406. return nil
  407. }
  408. // Http2ProtocolOptionsValidationError is the validation error returned by
  409. // Http2ProtocolOptions.Validate if the designated constraints aren't met.
  410. type Http2ProtocolOptionsValidationError struct {
  411. field string
  412. reason string
  413. cause error
  414. key bool
  415. }
  416. // Field function returns field value.
  417. func (e Http2ProtocolOptionsValidationError) Field() string { return e.field }
  418. // Reason function returns reason value.
  419. func (e Http2ProtocolOptionsValidationError) Reason() string { return e.reason }
  420. // Cause function returns cause value.
  421. func (e Http2ProtocolOptionsValidationError) Cause() error { return e.cause }
  422. // Key function returns key value.
  423. func (e Http2ProtocolOptionsValidationError) Key() bool { return e.key }
  424. // ErrorName returns error name.
  425. func (e Http2ProtocolOptionsValidationError) ErrorName() string {
  426. return "Http2ProtocolOptionsValidationError"
  427. }
  428. // Error satisfies the builtin error interface
  429. func (e Http2ProtocolOptionsValidationError) Error() string {
  430. cause := ""
  431. if e.cause != nil {
  432. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  433. }
  434. key := ""
  435. if e.key {
  436. key = "key for "
  437. }
  438. return fmt.Sprintf(
  439. "invalid %sHttp2ProtocolOptions.%s: %s%s",
  440. key,
  441. e.field,
  442. e.reason,
  443. cause)
  444. }
  445. var _ error = Http2ProtocolOptionsValidationError{}
  446. var _ interface {
  447. Field() string
  448. Reason() string
  449. Key() bool
  450. Cause() error
  451. ErrorName() string
  452. } = Http2ProtocolOptionsValidationError{}
  453. // Validate checks the field values on GrpcProtocolOptions with the rules
  454. // defined in the proto definition for this message. If any rules are
  455. // violated, an error is returned.
  456. func (m *GrpcProtocolOptions) Validate() error {
  457. if m == nil {
  458. return nil
  459. }
  460. if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
  461. if err := v.Validate(); err != nil {
  462. return GrpcProtocolOptionsValidationError{
  463. field: "Http2ProtocolOptions",
  464. reason: "embedded message failed validation",
  465. cause: err,
  466. }
  467. }
  468. }
  469. return nil
  470. }
  471. // GrpcProtocolOptionsValidationError is the validation error returned by
  472. // GrpcProtocolOptions.Validate if the designated constraints aren't met.
  473. type GrpcProtocolOptionsValidationError struct {
  474. field string
  475. reason string
  476. cause error
  477. key bool
  478. }
  479. // Field function returns field value.
  480. func (e GrpcProtocolOptionsValidationError) Field() string { return e.field }
  481. // Reason function returns reason value.
  482. func (e GrpcProtocolOptionsValidationError) Reason() string { return e.reason }
  483. // Cause function returns cause value.
  484. func (e GrpcProtocolOptionsValidationError) Cause() error { return e.cause }
  485. // Key function returns key value.
  486. func (e GrpcProtocolOptionsValidationError) Key() bool { return e.key }
  487. // ErrorName returns error name.
  488. func (e GrpcProtocolOptionsValidationError) ErrorName() string {
  489. return "GrpcProtocolOptionsValidationError"
  490. }
  491. // Error satisfies the builtin error interface
  492. func (e GrpcProtocolOptionsValidationError) Error() string {
  493. cause := ""
  494. if e.cause != nil {
  495. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  496. }
  497. key := ""
  498. if e.key {
  499. key = "key for "
  500. }
  501. return fmt.Sprintf(
  502. "invalid %sGrpcProtocolOptions.%s: %s%s",
  503. key,
  504. e.field,
  505. e.reason,
  506. cause)
  507. }
  508. var _ error = GrpcProtocolOptionsValidationError{}
  509. var _ interface {
  510. Field() string
  511. Reason() string
  512. Key() bool
  513. Cause() error
  514. ErrorName() string
  515. } = GrpcProtocolOptionsValidationError{}
  516. // Validate checks the field values on Http1ProtocolOptions_HeaderKeyFormat
  517. // with the rules defined in the proto definition for this message. If any
  518. // rules are violated, an error is returned.
  519. func (m *Http1ProtocolOptions_HeaderKeyFormat) Validate() error {
  520. if m == nil {
  521. return nil
  522. }
  523. switch m.HeaderFormat.(type) {
  524. case *Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_:
  525. if v, ok := interface{}(m.GetProperCaseWords()).(interface{ Validate() error }); ok {
  526. if err := v.Validate(); err != nil {
  527. return Http1ProtocolOptions_HeaderKeyFormatValidationError{
  528. field: "ProperCaseWords",
  529. reason: "embedded message failed validation",
  530. cause: err,
  531. }
  532. }
  533. }
  534. default:
  535. return Http1ProtocolOptions_HeaderKeyFormatValidationError{
  536. field: "HeaderFormat",
  537. reason: "value is required",
  538. }
  539. }
  540. return nil
  541. }
  542. // Http1ProtocolOptions_HeaderKeyFormatValidationError is the validation error
  543. // returned by Http1ProtocolOptions_HeaderKeyFormat.Validate if the designated
  544. // constraints aren't met.
  545. type Http1ProtocolOptions_HeaderKeyFormatValidationError struct {
  546. field string
  547. reason string
  548. cause error
  549. key bool
  550. }
  551. // Field function returns field value.
  552. func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Field() string { return e.field }
  553. // Reason function returns reason value.
  554. func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Reason() string { return e.reason }
  555. // Cause function returns cause value.
  556. func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Cause() error { return e.cause }
  557. // Key function returns key value.
  558. func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Key() bool { return e.key }
  559. // ErrorName returns error name.
  560. func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) ErrorName() string {
  561. return "Http1ProtocolOptions_HeaderKeyFormatValidationError"
  562. }
  563. // Error satisfies the builtin error interface
  564. func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Error() string {
  565. cause := ""
  566. if e.cause != nil {
  567. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  568. }
  569. key := ""
  570. if e.key {
  571. key = "key for "
  572. }
  573. return fmt.Sprintf(
  574. "invalid %sHttp1ProtocolOptions_HeaderKeyFormat.%s: %s%s",
  575. key,
  576. e.field,
  577. e.reason,
  578. cause)
  579. }
  580. var _ error = Http1ProtocolOptions_HeaderKeyFormatValidationError{}
  581. var _ interface {
  582. Field() string
  583. Reason() string
  584. Key() bool
  585. Cause() error
  586. ErrorName() string
  587. } = Http1ProtocolOptions_HeaderKeyFormatValidationError{}
  588. // Validate checks the field values on
  589. // Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords with the rules defined
  590. // in the proto definition for this message. If any rules are violated, an
  591. // error is returned.
  592. func (m *Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords) Validate() error {
  593. if m == nil {
  594. return nil
  595. }
  596. return nil
  597. }
  598. // Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError is the
  599. // validation error returned by
  600. // Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords.Validate if the
  601. // designated constraints aren't met.
  602. type Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError struct {
  603. field string
  604. reason string
  605. cause error
  606. key bool
  607. }
  608. // Field function returns field value.
  609. func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Field() string {
  610. return e.field
  611. }
  612. // Reason function returns reason value.
  613. func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Reason() string {
  614. return e.reason
  615. }
  616. // Cause function returns cause value.
  617. func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Cause() error {
  618. return e.cause
  619. }
  620. // Key function returns key value.
  621. func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Key() bool { return e.key }
  622. // ErrorName returns error name.
  623. func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) ErrorName() string {
  624. return "Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError"
  625. }
  626. // Error satisfies the builtin error interface
  627. func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Error() string {
  628. cause := ""
  629. if e.cause != nil {
  630. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  631. }
  632. key := ""
  633. if e.key {
  634. key = "key for "
  635. }
  636. return fmt.Sprintf(
  637. "invalid %sHttp1ProtocolOptions_HeaderKeyFormat_ProperCaseWords.%s: %s%s",
  638. key,
  639. e.field,
  640. e.reason,
  641. cause)
  642. }
  643. var _ error = Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError{}
  644. var _ interface {
  645. Field() string
  646. Reason() string
  647. Key() bool
  648. Cause() error
  649. ErrorName() string
  650. } = Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError{}
  651. // Validate checks the field values on Http2ProtocolOptions_SettingsParameter
  652. // with the rules defined in the proto definition for this message. If any
  653. // rules are violated, an error is returned.
  654. func (m *Http2ProtocolOptions_SettingsParameter) Validate() error {
  655. if m == nil {
  656. return nil
  657. }
  658. if wrapper := m.GetIdentifier(); wrapper != nil {
  659. if val := wrapper.GetValue(); val < 0 || val > 65535 {
  660. return Http2ProtocolOptions_SettingsParameterValidationError{
  661. field: "Identifier",
  662. reason: "value must be inside range [0, 65535]",
  663. }
  664. }
  665. } else {
  666. return Http2ProtocolOptions_SettingsParameterValidationError{
  667. field: "Identifier",
  668. reason: "value is required and must not be nil.",
  669. }
  670. }
  671. if m.GetValue() == nil {
  672. return Http2ProtocolOptions_SettingsParameterValidationError{
  673. field: "Value",
  674. reason: "value is required",
  675. }
  676. }
  677. if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
  678. if err := v.Validate(); err != nil {
  679. return Http2ProtocolOptions_SettingsParameterValidationError{
  680. field: "Value",
  681. reason: "embedded message failed validation",
  682. cause: err,
  683. }
  684. }
  685. }
  686. return nil
  687. }
  688. // Http2ProtocolOptions_SettingsParameterValidationError is the validation
  689. // error returned by Http2ProtocolOptions_SettingsParameter.Validate if the
  690. // designated constraints aren't met.
  691. type Http2ProtocolOptions_SettingsParameterValidationError struct {
  692. field string
  693. reason string
  694. cause error
  695. key bool
  696. }
  697. // Field function returns field value.
  698. func (e Http2ProtocolOptions_SettingsParameterValidationError) Field() string { return e.field }
  699. // Reason function returns reason value.
  700. func (e Http2ProtocolOptions_SettingsParameterValidationError) Reason() string { return e.reason }
  701. // Cause function returns cause value.
  702. func (e Http2ProtocolOptions_SettingsParameterValidationError) Cause() error { return e.cause }
  703. // Key function returns key value.
  704. func (e Http2ProtocolOptions_SettingsParameterValidationError) Key() bool { return e.key }
  705. // ErrorName returns error name.
  706. func (e Http2ProtocolOptions_SettingsParameterValidationError) ErrorName() string {
  707. return "Http2ProtocolOptions_SettingsParameterValidationError"
  708. }
  709. // Error satisfies the builtin error interface
  710. func (e Http2ProtocolOptions_SettingsParameterValidationError) Error() string {
  711. cause := ""
  712. if e.cause != nil {
  713. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  714. }
  715. key := ""
  716. if e.key {
  717. key = "key for "
  718. }
  719. return fmt.Sprintf(
  720. "invalid %sHttp2ProtocolOptions_SettingsParameter.%s: %s%s",
  721. key,
  722. e.field,
  723. e.reason,
  724. cause)
  725. }
  726. var _ error = Http2ProtocolOptions_SettingsParameterValidationError{}
  727. var _ interface {
  728. Field() string
  729. Reason() string
  730. Key() bool
  731. Cause() error
  732. ErrorName() string
  733. } = Http2ProtocolOptions_SettingsParameterValidationError{}