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

https://github.com/datawire/ambassador · Go · 1435 lines · 1014 code · 262 blank · 159 comment · 208 complexity · cbe0c1a71f3ff087af77faaca717b48d MD5 · raw file

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