/pkg/api/envoy/config/bootstrap/v2/bootstrap.pb.validate.go

https://github.com/datawire/ambassador · Go · 1368 lines · 959 code · 250 blank · 159 comment · 190 complexity · f61df83bc183997dc95f38f8b2cc7346 MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/config/bootstrap/v2/bootstrap.proto
  3. package envoy_config_bootstrap_v2
  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 _bootstrap_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 Bootstrap with the rules defined in the
  34. // proto definition for this message. If any rules are violated, an error is returned.
  35. func (m *Bootstrap) Validate() error {
  36. if m == nil {
  37. return nil
  38. }
  39. if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
  40. if err := v.Validate(); err != nil {
  41. return BootstrapValidationError{
  42. field: "Node",
  43. reason: "embedded message failed validation",
  44. cause: err,
  45. }
  46. }
  47. }
  48. if v, ok := interface{}(m.GetStaticResources()).(interface{ Validate() error }); ok {
  49. if err := v.Validate(); err != nil {
  50. return BootstrapValidationError{
  51. field: "StaticResources",
  52. reason: "embedded message failed validation",
  53. cause: err,
  54. }
  55. }
  56. }
  57. if v, ok := interface{}(m.GetDynamicResources()).(interface{ Validate() error }); ok {
  58. if err := v.Validate(); err != nil {
  59. return BootstrapValidationError{
  60. field: "DynamicResources",
  61. reason: "embedded message failed validation",
  62. cause: err,
  63. }
  64. }
  65. }
  66. if v, ok := interface{}(m.GetClusterManager()).(interface{ Validate() error }); ok {
  67. if err := v.Validate(); err != nil {
  68. return BootstrapValidationError{
  69. field: "ClusterManager",
  70. reason: "embedded message failed validation",
  71. cause: err,
  72. }
  73. }
  74. }
  75. if v, ok := interface{}(m.GetHdsConfig()).(interface{ Validate() error }); ok {
  76. if err := v.Validate(); err != nil {
  77. return BootstrapValidationError{
  78. field: "HdsConfig",
  79. reason: "embedded message failed validation",
  80. cause: err,
  81. }
  82. }
  83. }
  84. // no validation rules for FlagsPath
  85. for idx, item := range m.GetStatsSinks() {
  86. _, _ = idx, item
  87. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  88. if err := v.Validate(); err != nil {
  89. return BootstrapValidationError{
  90. field: fmt.Sprintf("StatsSinks[%v]", idx),
  91. reason: "embedded message failed validation",
  92. cause: err,
  93. }
  94. }
  95. }
  96. }
  97. if v, ok := interface{}(m.GetStatsConfig()).(interface{ Validate() error }); ok {
  98. if err := v.Validate(); err != nil {
  99. return BootstrapValidationError{
  100. field: "StatsConfig",
  101. reason: "embedded message failed validation",
  102. cause: err,
  103. }
  104. }
  105. }
  106. if d := m.GetStatsFlushInterval(); d != nil {
  107. dur, err := ptypes.Duration(d)
  108. if err != nil {
  109. return BootstrapValidationError{
  110. field: "StatsFlushInterval",
  111. reason: "value is not a valid duration",
  112. cause: err,
  113. }
  114. }
  115. lt := time.Duration(300*time.Second + 0*time.Nanosecond)
  116. gte := time.Duration(0*time.Second + 1000000*time.Nanosecond)
  117. if dur < gte || dur >= lt {
  118. return BootstrapValidationError{
  119. field: "StatsFlushInterval",
  120. reason: "value must be inside range [1ms, 5m0s)",
  121. }
  122. }
  123. }
  124. if v, ok := interface{}(m.GetWatchdog()).(interface{ Validate() error }); ok {
  125. if err := v.Validate(); err != nil {
  126. return BootstrapValidationError{
  127. field: "Watchdog",
  128. reason: "embedded message failed validation",
  129. cause: err,
  130. }
  131. }
  132. }
  133. if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
  134. if err := v.Validate(); err != nil {
  135. return BootstrapValidationError{
  136. field: "Tracing",
  137. reason: "embedded message failed validation",
  138. cause: err,
  139. }
  140. }
  141. }
  142. if v, ok := interface{}(m.GetRuntime()).(interface{ Validate() error }); ok {
  143. if err := v.Validate(); err != nil {
  144. return BootstrapValidationError{
  145. field: "Runtime",
  146. reason: "embedded message failed validation",
  147. cause: err,
  148. }
  149. }
  150. }
  151. if v, ok := interface{}(m.GetLayeredRuntime()).(interface{ Validate() error }); ok {
  152. if err := v.Validate(); err != nil {
  153. return BootstrapValidationError{
  154. field: "LayeredRuntime",
  155. reason: "embedded message failed validation",
  156. cause: err,
  157. }
  158. }
  159. }
  160. if v, ok := interface{}(m.GetAdmin()).(interface{ Validate() error }); ok {
  161. if err := v.Validate(); err != nil {
  162. return BootstrapValidationError{
  163. field: "Admin",
  164. reason: "embedded message failed validation",
  165. cause: err,
  166. }
  167. }
  168. }
  169. if v, ok := interface{}(m.GetOverloadManager()).(interface{ Validate() error }); ok {
  170. if err := v.Validate(); err != nil {
  171. return BootstrapValidationError{
  172. field: "OverloadManager",
  173. reason: "embedded message failed validation",
  174. cause: err,
  175. }
  176. }
  177. }
  178. // no validation rules for EnableDispatcherStats
  179. // no validation rules for HeaderPrefix
  180. if v, ok := interface{}(m.GetStatsServerVersionOverride()).(interface{ Validate() error }); ok {
  181. if err := v.Validate(); err != nil {
  182. return BootstrapValidationError{
  183. field: "StatsServerVersionOverride",
  184. reason: "embedded message failed validation",
  185. cause: err,
  186. }
  187. }
  188. }
  189. // no validation rules for UseTcpForDnsLookups
  190. return nil
  191. }
  192. // BootstrapValidationError is the validation error returned by
  193. // Bootstrap.Validate if the designated constraints aren't met.
  194. type BootstrapValidationError struct {
  195. field string
  196. reason string
  197. cause error
  198. key bool
  199. }
  200. // Field function returns field value.
  201. func (e BootstrapValidationError) Field() string { return e.field }
  202. // Reason function returns reason value.
  203. func (e BootstrapValidationError) Reason() string { return e.reason }
  204. // Cause function returns cause value.
  205. func (e BootstrapValidationError) Cause() error { return e.cause }
  206. // Key function returns key value.
  207. func (e BootstrapValidationError) Key() bool { return e.key }
  208. // ErrorName returns error name.
  209. func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" }
  210. // Error satisfies the builtin error interface
  211. func (e BootstrapValidationError) Error() string {
  212. cause := ""
  213. if e.cause != nil {
  214. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  215. }
  216. key := ""
  217. if e.key {
  218. key = "key for "
  219. }
  220. return fmt.Sprintf(
  221. "invalid %sBootstrap.%s: %s%s",
  222. key,
  223. e.field,
  224. e.reason,
  225. cause)
  226. }
  227. var _ error = BootstrapValidationError{}
  228. var _ interface {
  229. Field() string
  230. Reason() string
  231. Key() bool
  232. Cause() error
  233. ErrorName() string
  234. } = BootstrapValidationError{}
  235. // Validate checks the field values on Admin with the rules defined in the
  236. // proto definition for this message. If any rules are violated, an error is returned.
  237. func (m *Admin) Validate() error {
  238. if m == nil {
  239. return nil
  240. }
  241. // no validation rules for AccessLogPath
  242. // no validation rules for ProfilePath
  243. if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
  244. if err := v.Validate(); err != nil {
  245. return AdminValidationError{
  246. field: "Address",
  247. reason: "embedded message failed validation",
  248. cause: err,
  249. }
  250. }
  251. }
  252. for idx, item := range m.GetSocketOptions() {
  253. _, _ = idx, item
  254. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  255. if err := v.Validate(); err != nil {
  256. return AdminValidationError{
  257. field: fmt.Sprintf("SocketOptions[%v]", idx),
  258. reason: "embedded message failed validation",
  259. cause: err,
  260. }
  261. }
  262. }
  263. }
  264. return nil
  265. }
  266. // AdminValidationError is the validation error returned by Admin.Validate if
  267. // the designated constraints aren't met.
  268. type AdminValidationError struct {
  269. field string
  270. reason string
  271. cause error
  272. key bool
  273. }
  274. // Field function returns field value.
  275. func (e AdminValidationError) Field() string { return e.field }
  276. // Reason function returns reason value.
  277. func (e AdminValidationError) Reason() string { return e.reason }
  278. // Cause function returns cause value.
  279. func (e AdminValidationError) Cause() error { return e.cause }
  280. // Key function returns key value.
  281. func (e AdminValidationError) Key() bool { return e.key }
  282. // ErrorName returns error name.
  283. func (e AdminValidationError) ErrorName() string { return "AdminValidationError" }
  284. // Error satisfies the builtin error interface
  285. func (e AdminValidationError) 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 %sAdmin.%s: %s%s",
  296. key,
  297. e.field,
  298. e.reason,
  299. cause)
  300. }
  301. var _ error = AdminValidationError{}
  302. var _ interface {
  303. Field() string
  304. Reason() string
  305. Key() bool
  306. Cause() error
  307. ErrorName() string
  308. } = AdminValidationError{}
  309. // Validate checks the field values on ClusterManager with the rules defined in
  310. // the proto definition for this message. If any rules are violated, an error
  311. // is returned.
  312. func (m *ClusterManager) Validate() error {
  313. if m == nil {
  314. return nil
  315. }
  316. // no validation rules for LocalClusterName
  317. if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok {
  318. if err := v.Validate(); err != nil {
  319. return ClusterManagerValidationError{
  320. field: "OutlierDetection",
  321. reason: "embedded message failed validation",
  322. cause: err,
  323. }
  324. }
  325. }
  326. if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok {
  327. if err := v.Validate(); err != nil {
  328. return ClusterManagerValidationError{
  329. field: "UpstreamBindConfig",
  330. reason: "embedded message failed validation",
  331. cause: err,
  332. }
  333. }
  334. }
  335. if v, ok := interface{}(m.GetLoadStatsConfig()).(interface{ Validate() error }); ok {
  336. if err := v.Validate(); err != nil {
  337. return ClusterManagerValidationError{
  338. field: "LoadStatsConfig",
  339. reason: "embedded message failed validation",
  340. cause: err,
  341. }
  342. }
  343. }
  344. return nil
  345. }
  346. // ClusterManagerValidationError is the validation error returned by
  347. // ClusterManager.Validate if the designated constraints aren't met.
  348. type ClusterManagerValidationError struct {
  349. field string
  350. reason string
  351. cause error
  352. key bool
  353. }
  354. // Field function returns field value.
  355. func (e ClusterManagerValidationError) Field() string { return e.field }
  356. // Reason function returns reason value.
  357. func (e ClusterManagerValidationError) Reason() string { return e.reason }
  358. // Cause function returns cause value.
  359. func (e ClusterManagerValidationError) Cause() error { return e.cause }
  360. // Key function returns key value.
  361. func (e ClusterManagerValidationError) Key() bool { return e.key }
  362. // ErrorName returns error name.
  363. func (e ClusterManagerValidationError) ErrorName() string { return "ClusterManagerValidationError" }
  364. // Error satisfies the builtin error interface
  365. func (e ClusterManagerValidationError) Error() string {
  366. cause := ""
  367. if e.cause != nil {
  368. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  369. }
  370. key := ""
  371. if e.key {
  372. key = "key for "
  373. }
  374. return fmt.Sprintf(
  375. "invalid %sClusterManager.%s: %s%s",
  376. key,
  377. e.field,
  378. e.reason,
  379. cause)
  380. }
  381. var _ error = ClusterManagerValidationError{}
  382. var _ interface {
  383. Field() string
  384. Reason() string
  385. Key() bool
  386. Cause() error
  387. ErrorName() string
  388. } = ClusterManagerValidationError{}
  389. // Validate checks the field values on Watchdog with the rules defined in the
  390. // proto definition for this message. If any rules are violated, an error is returned.
  391. func (m *Watchdog) Validate() error {
  392. if m == nil {
  393. return nil
  394. }
  395. if v, ok := interface{}(m.GetMissTimeout()).(interface{ Validate() error }); ok {
  396. if err := v.Validate(); err != nil {
  397. return WatchdogValidationError{
  398. field: "MissTimeout",
  399. reason: "embedded message failed validation",
  400. cause: err,
  401. }
  402. }
  403. }
  404. if v, ok := interface{}(m.GetMegamissTimeout()).(interface{ Validate() error }); ok {
  405. if err := v.Validate(); err != nil {
  406. return WatchdogValidationError{
  407. field: "MegamissTimeout",
  408. reason: "embedded message failed validation",
  409. cause: err,
  410. }
  411. }
  412. }
  413. if v, ok := interface{}(m.GetKillTimeout()).(interface{ Validate() error }); ok {
  414. if err := v.Validate(); err != nil {
  415. return WatchdogValidationError{
  416. field: "KillTimeout",
  417. reason: "embedded message failed validation",
  418. cause: err,
  419. }
  420. }
  421. }
  422. if v, ok := interface{}(m.GetMultikillTimeout()).(interface{ Validate() error }); ok {
  423. if err := v.Validate(); err != nil {
  424. return WatchdogValidationError{
  425. field: "MultikillTimeout",
  426. reason: "embedded message failed validation",
  427. cause: err,
  428. }
  429. }
  430. }
  431. return nil
  432. }
  433. // WatchdogValidationError is the validation error returned by
  434. // Watchdog.Validate if the designated constraints aren't met.
  435. type WatchdogValidationError struct {
  436. field string
  437. reason string
  438. cause error
  439. key bool
  440. }
  441. // Field function returns field value.
  442. func (e WatchdogValidationError) Field() string { return e.field }
  443. // Reason function returns reason value.
  444. func (e WatchdogValidationError) Reason() string { return e.reason }
  445. // Cause function returns cause value.
  446. func (e WatchdogValidationError) Cause() error { return e.cause }
  447. // Key function returns key value.
  448. func (e WatchdogValidationError) Key() bool { return e.key }
  449. // ErrorName returns error name.
  450. func (e WatchdogValidationError) ErrorName() string { return "WatchdogValidationError" }
  451. // Error satisfies the builtin error interface
  452. func (e WatchdogValidationError) Error() string {
  453. cause := ""
  454. if e.cause != nil {
  455. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  456. }
  457. key := ""
  458. if e.key {
  459. key = "key for "
  460. }
  461. return fmt.Sprintf(
  462. "invalid %sWatchdog.%s: %s%s",
  463. key,
  464. e.field,
  465. e.reason,
  466. cause)
  467. }
  468. var _ error = WatchdogValidationError{}
  469. var _ interface {
  470. Field() string
  471. Reason() string
  472. Key() bool
  473. Cause() error
  474. ErrorName() string
  475. } = WatchdogValidationError{}
  476. // Validate checks the field values on Runtime with the rules defined in the
  477. // proto definition for this message. If any rules are violated, an error is returned.
  478. func (m *Runtime) Validate() error {
  479. if m == nil {
  480. return nil
  481. }
  482. // no validation rules for SymlinkRoot
  483. // no validation rules for Subdirectory
  484. // no validation rules for OverrideSubdirectory
  485. if v, ok := interface{}(m.GetBase()).(interface{ Validate() error }); ok {
  486. if err := v.Validate(); err != nil {
  487. return RuntimeValidationError{
  488. field: "Base",
  489. reason: "embedded message failed validation",
  490. cause: err,
  491. }
  492. }
  493. }
  494. return nil
  495. }
  496. // RuntimeValidationError is the validation error returned by Runtime.Validate
  497. // if the designated constraints aren't met.
  498. type RuntimeValidationError struct {
  499. field string
  500. reason string
  501. cause error
  502. key bool
  503. }
  504. // Field function returns field value.
  505. func (e RuntimeValidationError) Field() string { return e.field }
  506. // Reason function returns reason value.
  507. func (e RuntimeValidationError) Reason() string { return e.reason }
  508. // Cause function returns cause value.
  509. func (e RuntimeValidationError) Cause() error { return e.cause }
  510. // Key function returns key value.
  511. func (e RuntimeValidationError) Key() bool { return e.key }
  512. // ErrorName returns error name.
  513. func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" }
  514. // Error satisfies the builtin error interface
  515. func (e RuntimeValidationError) Error() string {
  516. cause := ""
  517. if e.cause != nil {
  518. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  519. }
  520. key := ""
  521. if e.key {
  522. key = "key for "
  523. }
  524. return fmt.Sprintf(
  525. "invalid %sRuntime.%s: %s%s",
  526. key,
  527. e.field,
  528. e.reason,
  529. cause)
  530. }
  531. var _ error = RuntimeValidationError{}
  532. var _ interface {
  533. Field() string
  534. Reason() string
  535. Key() bool
  536. Cause() error
  537. ErrorName() string
  538. } = RuntimeValidationError{}
  539. // Validate checks the field values on RuntimeLayer with the rules defined in
  540. // the proto definition for this message. If any rules are violated, an error
  541. // is returned.
  542. func (m *RuntimeLayer) Validate() error {
  543. if m == nil {
  544. return nil
  545. }
  546. if len(m.GetName()) < 1 {
  547. return RuntimeLayerValidationError{
  548. field: "Name",
  549. reason: "value length must be at least 1 bytes",
  550. }
  551. }
  552. switch m.LayerSpecifier.(type) {
  553. case *RuntimeLayer_StaticLayer:
  554. if v, ok := interface{}(m.GetStaticLayer()).(interface{ Validate() error }); ok {
  555. if err := v.Validate(); err != nil {
  556. return RuntimeLayerValidationError{
  557. field: "StaticLayer",
  558. reason: "embedded message failed validation",
  559. cause: err,
  560. }
  561. }
  562. }
  563. case *RuntimeLayer_DiskLayer_:
  564. if v, ok := interface{}(m.GetDiskLayer()).(interface{ Validate() error }); ok {
  565. if err := v.Validate(); err != nil {
  566. return RuntimeLayerValidationError{
  567. field: "DiskLayer",
  568. reason: "embedded message failed validation",
  569. cause: err,
  570. }
  571. }
  572. }
  573. case *RuntimeLayer_AdminLayer_:
  574. if v, ok := interface{}(m.GetAdminLayer()).(interface{ Validate() error }); ok {
  575. if err := v.Validate(); err != nil {
  576. return RuntimeLayerValidationError{
  577. field: "AdminLayer",
  578. reason: "embedded message failed validation",
  579. cause: err,
  580. }
  581. }
  582. }
  583. case *RuntimeLayer_RtdsLayer_:
  584. if v, ok := interface{}(m.GetRtdsLayer()).(interface{ Validate() error }); ok {
  585. if err := v.Validate(); err != nil {
  586. return RuntimeLayerValidationError{
  587. field: "RtdsLayer",
  588. reason: "embedded message failed validation",
  589. cause: err,
  590. }
  591. }
  592. }
  593. default:
  594. return RuntimeLayerValidationError{
  595. field: "LayerSpecifier",
  596. reason: "value is required",
  597. }
  598. }
  599. return nil
  600. }
  601. // RuntimeLayerValidationError is the validation error returned by
  602. // RuntimeLayer.Validate if the designated constraints aren't met.
  603. type RuntimeLayerValidationError struct {
  604. field string
  605. reason string
  606. cause error
  607. key bool
  608. }
  609. // Field function returns field value.
  610. func (e RuntimeLayerValidationError) Field() string { return e.field }
  611. // Reason function returns reason value.
  612. func (e RuntimeLayerValidationError) Reason() string { return e.reason }
  613. // Cause function returns cause value.
  614. func (e RuntimeLayerValidationError) Cause() error { return e.cause }
  615. // Key function returns key value.
  616. func (e RuntimeLayerValidationError) Key() bool { return e.key }
  617. // ErrorName returns error name.
  618. func (e RuntimeLayerValidationError) ErrorName() string { return "RuntimeLayerValidationError" }
  619. // Error satisfies the builtin error interface
  620. func (e RuntimeLayerValidationError) Error() string {
  621. cause := ""
  622. if e.cause != nil {
  623. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  624. }
  625. key := ""
  626. if e.key {
  627. key = "key for "
  628. }
  629. return fmt.Sprintf(
  630. "invalid %sRuntimeLayer.%s: %s%s",
  631. key,
  632. e.field,
  633. e.reason,
  634. cause)
  635. }
  636. var _ error = RuntimeLayerValidationError{}
  637. var _ interface {
  638. Field() string
  639. Reason() string
  640. Key() bool
  641. Cause() error
  642. ErrorName() string
  643. } = RuntimeLayerValidationError{}
  644. // Validate checks the field values on LayeredRuntime with the rules defined in
  645. // the proto definition for this message. If any rules are violated, an error
  646. // is returned.
  647. func (m *LayeredRuntime) Validate() error {
  648. if m == nil {
  649. return nil
  650. }
  651. for idx, item := range m.GetLayers() {
  652. _, _ = idx, item
  653. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  654. if err := v.Validate(); err != nil {
  655. return LayeredRuntimeValidationError{
  656. field: fmt.Sprintf("Layers[%v]", idx),
  657. reason: "embedded message failed validation",
  658. cause: err,
  659. }
  660. }
  661. }
  662. }
  663. return nil
  664. }
  665. // LayeredRuntimeValidationError is the validation error returned by
  666. // LayeredRuntime.Validate if the designated constraints aren't met.
  667. type LayeredRuntimeValidationError struct {
  668. field string
  669. reason string
  670. cause error
  671. key bool
  672. }
  673. // Field function returns field value.
  674. func (e LayeredRuntimeValidationError) Field() string { return e.field }
  675. // Reason function returns reason value.
  676. func (e LayeredRuntimeValidationError) Reason() string { return e.reason }
  677. // Cause function returns cause value.
  678. func (e LayeredRuntimeValidationError) Cause() error { return e.cause }
  679. // Key function returns key value.
  680. func (e LayeredRuntimeValidationError) Key() bool { return e.key }
  681. // ErrorName returns error name.
  682. func (e LayeredRuntimeValidationError) ErrorName() string { return "LayeredRuntimeValidationError" }
  683. // Error satisfies the builtin error interface
  684. func (e LayeredRuntimeValidationError) Error() string {
  685. cause := ""
  686. if e.cause != nil {
  687. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  688. }
  689. key := ""
  690. if e.key {
  691. key = "key for "
  692. }
  693. return fmt.Sprintf(
  694. "invalid %sLayeredRuntime.%s: %s%s",
  695. key,
  696. e.field,
  697. e.reason,
  698. cause)
  699. }
  700. var _ error = LayeredRuntimeValidationError{}
  701. var _ interface {
  702. Field() string
  703. Reason() string
  704. Key() bool
  705. Cause() error
  706. ErrorName() string
  707. } = LayeredRuntimeValidationError{}
  708. // Validate checks the field values on Bootstrap_StaticResources with the rules
  709. // defined in the proto definition for this message. If any rules are
  710. // violated, an error is returned.
  711. func (m *Bootstrap_StaticResources) Validate() error {
  712. if m == nil {
  713. return nil
  714. }
  715. for idx, item := range m.GetListeners() {
  716. _, _ = idx, item
  717. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  718. if err := v.Validate(); err != nil {
  719. return Bootstrap_StaticResourcesValidationError{
  720. field: fmt.Sprintf("Listeners[%v]", idx),
  721. reason: "embedded message failed validation",
  722. cause: err,
  723. }
  724. }
  725. }
  726. }
  727. for idx, item := range m.GetClusters() {
  728. _, _ = idx, item
  729. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  730. if err := v.Validate(); err != nil {
  731. return Bootstrap_StaticResourcesValidationError{
  732. field: fmt.Sprintf("Clusters[%v]", idx),
  733. reason: "embedded message failed validation",
  734. cause: err,
  735. }
  736. }
  737. }
  738. }
  739. for idx, item := range m.GetSecrets() {
  740. _, _ = idx, item
  741. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  742. if err := v.Validate(); err != nil {
  743. return Bootstrap_StaticResourcesValidationError{
  744. field: fmt.Sprintf("Secrets[%v]", idx),
  745. reason: "embedded message failed validation",
  746. cause: err,
  747. }
  748. }
  749. }
  750. }
  751. return nil
  752. }
  753. // Bootstrap_StaticResourcesValidationError is the validation error returned by
  754. // Bootstrap_StaticResources.Validate if the designated constraints aren't met.
  755. type Bootstrap_StaticResourcesValidationError struct {
  756. field string
  757. reason string
  758. cause error
  759. key bool
  760. }
  761. // Field function returns field value.
  762. func (e Bootstrap_StaticResourcesValidationError) Field() string { return e.field }
  763. // Reason function returns reason value.
  764. func (e Bootstrap_StaticResourcesValidationError) Reason() string { return e.reason }
  765. // Cause function returns cause value.
  766. func (e Bootstrap_StaticResourcesValidationError) Cause() error { return e.cause }
  767. // Key function returns key value.
  768. func (e Bootstrap_StaticResourcesValidationError) Key() bool { return e.key }
  769. // ErrorName returns error name.
  770. func (e Bootstrap_StaticResourcesValidationError) ErrorName() string {
  771. return "Bootstrap_StaticResourcesValidationError"
  772. }
  773. // Error satisfies the builtin error interface
  774. func (e Bootstrap_StaticResourcesValidationError) Error() string {
  775. cause := ""
  776. if e.cause != nil {
  777. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  778. }
  779. key := ""
  780. if e.key {
  781. key = "key for "
  782. }
  783. return fmt.Sprintf(
  784. "invalid %sBootstrap_StaticResources.%s: %s%s",
  785. key,
  786. e.field,
  787. e.reason,
  788. cause)
  789. }
  790. var _ error = Bootstrap_StaticResourcesValidationError{}
  791. var _ interface {
  792. Field() string
  793. Reason() string
  794. Key() bool
  795. Cause() error
  796. ErrorName() string
  797. } = Bootstrap_StaticResourcesValidationError{}
  798. // Validate checks the field values on Bootstrap_DynamicResources with the
  799. // rules defined in the proto definition for this message. If any rules are
  800. // violated, an error is returned.
  801. func (m *Bootstrap_DynamicResources) Validate() error {
  802. if m == nil {
  803. return nil
  804. }
  805. if v, ok := interface{}(m.GetLdsConfig()).(interface{ Validate() error }); ok {
  806. if err := v.Validate(); err != nil {
  807. return Bootstrap_DynamicResourcesValidationError{
  808. field: "LdsConfig",
  809. reason: "embedded message failed validation",
  810. cause: err,
  811. }
  812. }
  813. }
  814. if v, ok := interface{}(m.GetCdsConfig()).(interface{ Validate() error }); ok {
  815. if err := v.Validate(); err != nil {
  816. return Bootstrap_DynamicResourcesValidationError{
  817. field: "CdsConfig",
  818. reason: "embedded message failed validation",
  819. cause: err,
  820. }
  821. }
  822. }
  823. if v, ok := interface{}(m.GetAdsConfig()).(interface{ Validate() error }); ok {
  824. if err := v.Validate(); err != nil {
  825. return Bootstrap_DynamicResourcesValidationError{
  826. field: "AdsConfig",
  827. reason: "embedded message failed validation",
  828. cause: err,
  829. }
  830. }
  831. }
  832. return nil
  833. }
  834. // Bootstrap_DynamicResourcesValidationError is the validation error returned
  835. // by Bootstrap_DynamicResources.Validate if the designated constraints aren't met.
  836. type Bootstrap_DynamicResourcesValidationError struct {
  837. field string
  838. reason string
  839. cause error
  840. key bool
  841. }
  842. // Field function returns field value.
  843. func (e Bootstrap_DynamicResourcesValidationError) Field() string { return e.field }
  844. // Reason function returns reason value.
  845. func (e Bootstrap_DynamicResourcesValidationError) Reason() string { return e.reason }
  846. // Cause function returns cause value.
  847. func (e Bootstrap_DynamicResourcesValidationError) Cause() error { return e.cause }
  848. // Key function returns key value.
  849. func (e Bootstrap_DynamicResourcesValidationError) Key() bool { return e.key }
  850. // ErrorName returns error name.
  851. func (e Bootstrap_DynamicResourcesValidationError) ErrorName() string {
  852. return "Bootstrap_DynamicResourcesValidationError"
  853. }
  854. // Error satisfies the builtin error interface
  855. func (e Bootstrap_DynamicResourcesValidationError) Error() string {
  856. cause := ""
  857. if e.cause != nil {
  858. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  859. }
  860. key := ""
  861. if e.key {
  862. key = "key for "
  863. }
  864. return fmt.Sprintf(
  865. "invalid %sBootstrap_DynamicResources.%s: %s%s",
  866. key,
  867. e.field,
  868. e.reason,
  869. cause)
  870. }
  871. var _ error = Bootstrap_DynamicResourcesValidationError{}
  872. var _ interface {
  873. Field() string
  874. Reason() string
  875. Key() bool
  876. Cause() error
  877. ErrorName() string
  878. } = Bootstrap_DynamicResourcesValidationError{}
  879. // Validate checks the field values on ClusterManager_OutlierDetection with the
  880. // rules defined in the proto definition for this message. If any rules are
  881. // violated, an error is returned.
  882. func (m *ClusterManager_OutlierDetection) Validate() error {
  883. if m == nil {
  884. return nil
  885. }
  886. // no validation rules for EventLogPath
  887. if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok {
  888. if err := v.Validate(); err != nil {
  889. return ClusterManager_OutlierDetectionValidationError{
  890. field: "EventService",
  891. reason: "embedded message failed validation",
  892. cause: err,
  893. }
  894. }
  895. }
  896. return nil
  897. }
  898. // ClusterManager_OutlierDetectionValidationError is the validation error
  899. // returned by ClusterManager_OutlierDetection.Validate if the designated
  900. // constraints aren't met.
  901. type ClusterManager_OutlierDetectionValidationError struct {
  902. field string
  903. reason string
  904. cause error
  905. key bool
  906. }
  907. // Field function returns field value.
  908. func (e ClusterManager_OutlierDetectionValidationError) Field() string { return e.field }
  909. // Reason function returns reason value.
  910. func (e ClusterManager_OutlierDetectionValidationError) Reason() string { return e.reason }
  911. // Cause function returns cause value.
  912. func (e ClusterManager_OutlierDetectionValidationError) Cause() error { return e.cause }
  913. // Key function returns key value.
  914. func (e ClusterManager_OutlierDetectionValidationError) Key() bool { return e.key }
  915. // ErrorName returns error name.
  916. func (e ClusterManager_OutlierDetectionValidationError) ErrorName() string {
  917. return "ClusterManager_OutlierDetectionValidationError"
  918. }
  919. // Error satisfies the builtin error interface
  920. func (e ClusterManager_OutlierDetectionValidationError) Error() string {
  921. cause := ""
  922. if e.cause != nil {
  923. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  924. }
  925. key := ""
  926. if e.key {
  927. key = "key for "
  928. }
  929. return fmt.Sprintf(
  930. "invalid %sClusterManager_OutlierDetection.%s: %s%s",
  931. key,
  932. e.field,
  933. e.reason,
  934. cause)
  935. }
  936. var _ error = ClusterManager_OutlierDetectionValidationError{}
  937. var _ interface {
  938. Field() string
  939. Reason() string
  940. Key() bool
  941. Cause() error
  942. ErrorName() string
  943. } = ClusterManager_OutlierDetectionValidationError{}
  944. // Validate checks the field values on RuntimeLayer_DiskLayer with the rules
  945. // defined in the proto definition for this message. If any rules are
  946. // violated, an error is returned.
  947. func (m *RuntimeLayer_DiskLayer) Validate() error {
  948. if m == nil {
  949. return nil
  950. }
  951. // no validation rules for SymlinkRoot
  952. // no validation rules for Subdirectory
  953. // no validation rules for AppendServiceCluster
  954. return nil
  955. }
  956. // RuntimeLayer_DiskLayerValidationError is the validation error returned by
  957. // RuntimeLayer_DiskLayer.Validate if the designated constraints aren't met.
  958. type RuntimeLayer_DiskLayerValidationError struct {
  959. field string
  960. reason string
  961. cause error
  962. key bool
  963. }
  964. // Field function returns field value.
  965. func (e RuntimeLayer_DiskLayerValidationError) Field() string { return e.field }
  966. // Reason function returns reason value.
  967. func (e RuntimeLayer_DiskLayerValidationError) Reason() string { return e.reason }
  968. // Cause function returns cause value.
  969. func (e RuntimeLayer_DiskLayerValidationError) Cause() error { return e.cause }
  970. // Key function returns key value.
  971. func (e RuntimeLayer_DiskLayerValidationError) Key() bool { return e.key }
  972. // ErrorName returns error name.
  973. func (e RuntimeLayer_DiskLayerValidationError) ErrorName() string {
  974. return "RuntimeLayer_DiskLayerValidationError"
  975. }
  976. // Error satisfies the builtin error interface
  977. func (e RuntimeLayer_DiskLayerValidationError) Error() string {
  978. cause := ""
  979. if e.cause != nil {
  980. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  981. }
  982. key := ""
  983. if e.key {
  984. key = "key for "
  985. }
  986. return fmt.Sprintf(
  987. "invalid %sRuntimeLayer_DiskLayer.%s: %s%s",
  988. key,
  989. e.field,
  990. e.reason,
  991. cause)
  992. }
  993. var _ error = RuntimeLayer_DiskLayerValidationError{}
  994. var _ interface {
  995. Field() string
  996. Reason() string
  997. Key() bool
  998. Cause() error
  999. ErrorName() string
  1000. } = RuntimeLayer_DiskLayerValidationError{}
  1001. // Validate checks the field values on RuntimeLayer_AdminLayer with the rules
  1002. // defined in the proto definition for this message. If any rules are
  1003. // violated, an error is returned.
  1004. func (m *RuntimeLayer_AdminLayer) Validate() error {
  1005. if m == nil {
  1006. return nil
  1007. }
  1008. return nil
  1009. }
  1010. // RuntimeLayer_AdminLayerValidationError is the validation error returned by
  1011. // RuntimeLayer_AdminLayer.Validate if the designated constraints aren't met.
  1012. type RuntimeLayer_AdminLayerValidationError struct {
  1013. field string
  1014. reason string
  1015. cause error
  1016. key bool
  1017. }
  1018. // Field function returns field value.
  1019. func (e RuntimeLayer_AdminLayerValidationError) Field() string { return e.field }
  1020. // Reason function returns reason value.
  1021. func (e RuntimeLayer_AdminLayerValidationError) Reason() string { return e.reason }
  1022. // Cause function returns cause value.
  1023. func (e RuntimeLayer_AdminLayerValidationError) Cause() error { return e.cause }
  1024. // Key function returns key value.
  1025. func (e RuntimeLayer_AdminLayerValidationError) Key() bool { return e.key }
  1026. // ErrorName returns error name.
  1027. func (e RuntimeLayer_AdminLayerValidationError) ErrorName() string {
  1028. return "RuntimeLayer_AdminLayerValidationError"
  1029. }
  1030. // Error satisfies the builtin error interface
  1031. func (e RuntimeLayer_AdminLayerValidationError) Error() string {
  1032. cause := ""
  1033. if e.cause != nil {
  1034. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1035. }
  1036. key := ""
  1037. if e.key {
  1038. key = "key for "
  1039. }
  1040. return fmt.Sprintf(
  1041. "invalid %sRuntimeLayer_AdminLayer.%s: %s%s",
  1042. key,
  1043. e.field,
  1044. e.reason,
  1045. cause)
  1046. }
  1047. var _ error = RuntimeLayer_AdminLayerValidationError{}
  1048. var _ interface {
  1049. Field() string
  1050. Reason() string
  1051. Key() bool
  1052. Cause() error
  1053. ErrorName() string
  1054. } = RuntimeLayer_AdminLayerValidationError{}
  1055. // Validate checks the field values on RuntimeLayer_RtdsLayer with the rules
  1056. // defined in the proto definition for this message. If any rules are
  1057. // violated, an error is returned.
  1058. func (m *RuntimeLayer_RtdsLayer) Validate() error {
  1059. if m == nil {
  1060. return nil
  1061. }
  1062. // no validation rules for Name
  1063. if v, ok := interface{}(m.GetRtdsConfig()).(interface{ Validate() error }); ok {
  1064. if err := v.Validate(); err != nil {
  1065. return RuntimeLayer_RtdsLayerValidationError{
  1066. field: "RtdsConfig",
  1067. reason: "embedded message failed validation",
  1068. cause: err,
  1069. }
  1070. }
  1071. }
  1072. return nil
  1073. }
  1074. // RuntimeLayer_RtdsLayerValidationError is the validation error returned by
  1075. // RuntimeLayer_RtdsLayer.Validate if the designated constraints aren't met.
  1076. type RuntimeLayer_RtdsLayerValidationError struct {
  1077. field string
  1078. reason string
  1079. cause error
  1080. key bool
  1081. }
  1082. // Field function returns field value.
  1083. func (e RuntimeLayer_RtdsLayerValidationError) Field() string { return e.field }
  1084. // Reason function returns reason value.
  1085. func (e RuntimeLayer_RtdsLayerValidationError) Reason() string { return e.reason }
  1086. // Cause function returns cause value.
  1087. func (e RuntimeLayer_RtdsLayerValidationError) Cause() error { return e.cause }
  1088. // Key function returns key value.
  1089. func (e RuntimeLayer_RtdsLayerValidationError) Key() bool { return e.key }
  1090. // ErrorName returns error name.
  1091. func (e RuntimeLayer_RtdsLayerValidationError) ErrorName() string {
  1092. return "RuntimeLayer_RtdsLayerValidationError"
  1093. }
  1094. // Error satisfies the builtin error interface
  1095. func (e RuntimeLayer_RtdsLayerValidationError) Error() string {
  1096. cause := ""
  1097. if e.cause != nil {
  1098. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1099. }
  1100. key := ""
  1101. if e.key {
  1102. key = "key for "
  1103. }
  1104. return fmt.Sprintf(
  1105. "invalid %sRuntimeLayer_RtdsLayer.%s: %s%s",
  1106. key,
  1107. e.field,
  1108. e.reason,
  1109. cause)
  1110. }
  1111. var _ error = RuntimeLayer_RtdsLayerValidationError{}
  1112. var _ interface {
  1113. Field() string
  1114. Reason() string
  1115. Key() bool
  1116. Cause() error
  1117. ErrorName() string
  1118. } = RuntimeLayer_RtdsLayerValidationError{}