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

https://github.com/datawire/ambassador · Go · 1438 lines · 1019 code · 260 blank · 159 comment · 210 complexity · 039392c9ce97d25eba4453fc9b0acf4e MD5 · raw file

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