command.validator.pb.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: v1/request/command.proto
  3. package request
  4. import (
  5. fmt "fmt"
  6. math "math"
  7. proto "github.com/golang/protobuf/proto"
  8. _ "github.com/mwitkow/go-proto-validators"
  9. github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. func (this *AutoMigrateRequest) Validate() error {
  16. if this.DatabaseID == "" {
  17. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  18. }
  19. if len(this.Items) < 1 {
  20. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  21. }
  22. for _, item := range this.Items {
  23. if item != nil {
  24. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  25. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  26. }
  27. }
  28. }
  29. return nil
  30. }
  31. func (this *AutoMigrateItem) Validate() error {
  32. if this.TablePrefixWithSchema == "" {
  33. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  34. }
  35. if this.Version == "" {
  36. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  37. }
  38. if !(len(this.TableModelDescribe) > 0) {
  39. return github_com_mwitkow_go_proto_validators.FieldError("TableModelDescribe", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.TableModelDescribe))
  40. }
  41. return nil
  42. }
  43. func (this *TransactionBeginRequest) Validate() error {
  44. if this.DatabaseID == "" {
  45. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  46. }
  47. return nil
  48. }
  49. func (this *InsertTxRequest) Validate() error {
  50. if this.TablePrefixWithSchema == "" {
  51. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  52. }
  53. if this.Version == "" {
  54. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  55. }
  56. for _, item := range this.KeyColumns {
  57. if !(len(item) > 0) {
  58. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  59. }
  60. }
  61. if this.TableRow != nil {
  62. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  63. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  64. }
  65. }
  66. return nil
  67. }
  68. func (this *InsertBatchTxRequest) Validate() error {
  69. if len(this.Items) < 1 {
  70. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  71. }
  72. for _, item := range this.Items {
  73. if item != nil {
  74. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  75. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  76. }
  77. }
  78. }
  79. return nil
  80. }
  81. func (this *DeleteTxRequest) Validate() error {
  82. if this.TablePrefixWithSchema == "" {
  83. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  84. }
  85. if this.Version == "" {
  86. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  87. }
  88. for _, item := range this.KeyColumns {
  89. if !(len(item) > 0) {
  90. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  91. }
  92. }
  93. for _, item := range this.KeyValues {
  94. if !(len(item) > 0) {
  95. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  96. }
  97. }
  98. return nil
  99. }
  100. func (this *DeleteWhereTxRequest) Validate() error {
  101. if this.TablePrefixWithSchema == "" {
  102. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  103. }
  104. if this.Version == "" {
  105. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  106. }
  107. for _, item := range this.KeyColumns {
  108. if !(len(item) > 0) {
  109. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  110. }
  111. }
  112. return nil
  113. }
  114. func (this *UpdateTxRequest) Validate() error {
  115. if this.TablePrefixWithSchema == "" {
  116. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  117. }
  118. if this.Version == "" {
  119. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  120. }
  121. for _, item := range this.KeyColumns {
  122. if !(len(item) > 0) {
  123. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  124. }
  125. }
  126. for _, item := range this.KeyValues {
  127. if !(len(item) > 0) {
  128. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  129. }
  130. }
  131. if this.NewTableRow != nil {
  132. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  133. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  134. }
  135. }
  136. return nil
  137. }
  138. func (this *UpdateWhereTxRequest) Validate() error {
  139. if this.TablePrefixWithSchema == "" {
  140. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  141. }
  142. if this.Version == "" {
  143. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  144. }
  145. for _, item := range this.KeyColumns {
  146. if !(len(item) > 0) {
  147. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  148. }
  149. }
  150. if this.NewTableRow != nil {
  151. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  152. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  153. }
  154. }
  155. return nil
  156. }
  157. func (this *TransactionEndRequest) Validate() error {
  158. return nil
  159. }
  160. func (this *TransactionOperation) Validate() error {
  161. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  162. if oneOfNester.TransactionBeginRequest != nil {
  163. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  164. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  165. }
  166. }
  167. }
  168. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertTxRequest); ok {
  169. if oneOfNester.InsertTxRequest != nil {
  170. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertTxRequest); err != nil {
  171. return github_com_mwitkow_go_proto_validators.FieldError("InsertTxRequest", err)
  172. }
  173. }
  174. }
  175. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertBatchTxRequest); ok {
  176. if oneOfNester.InsertBatchTxRequest != nil {
  177. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertBatchTxRequest); err != nil {
  178. return github_com_mwitkow_go_proto_validators.FieldError("InsertBatchTxRequest", err)
  179. }
  180. }
  181. }
  182. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteTxRequest); ok {
  183. if oneOfNester.DeleteTxRequest != nil {
  184. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteTxRequest); err != nil {
  185. return github_com_mwitkow_go_proto_validators.FieldError("DeleteTxRequest", err)
  186. }
  187. }
  188. }
  189. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteWhereTxRequest); ok {
  190. if oneOfNester.DeleteWhereTxRequest != nil {
  191. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteWhereTxRequest); err != nil {
  192. return github_com_mwitkow_go_proto_validators.FieldError("DeleteWhereTxRequest", err)
  193. }
  194. }
  195. }
  196. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateTxRequest); ok {
  197. if oneOfNester.UpdateTxRequest != nil {
  198. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateTxRequest); err != nil {
  199. return github_com_mwitkow_go_proto_validators.FieldError("UpdateTxRequest", err)
  200. }
  201. }
  202. }
  203. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateWhereTxRequest); ok {
  204. if oneOfNester.UpdateWhereTxRequest != nil {
  205. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateWhereTxRequest); err != nil {
  206. return github_com_mwitkow_go_proto_validators.FieldError("UpdateWhereTxRequest", err)
  207. }
  208. }
  209. }
  210. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  211. if oneOfNester.TransactionEndRequest != nil {
  212. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  213. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  214. }
  215. }
  216. }
  217. return nil
  218. }
  219. func (this *InsertRequest) Validate() error {
  220. if this.DatabaseID == "" {
  221. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  222. }
  223. if this.TablePrefixWithSchema == "" {
  224. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  225. }
  226. if this.Version == "" {
  227. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  228. }
  229. for _, item := range this.KeyColumns {
  230. if !(len(item) > 0) {
  231. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  232. }
  233. }
  234. if this.TableRow != nil {
  235. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  236. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  237. }
  238. }
  239. return nil
  240. }
  241. func (this *InsertBatchRequest) Validate() error {
  242. if this.DatabaseID == "" {
  243. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  244. }
  245. if len(this.Items) < 1 {
  246. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  247. }
  248. for _, item := range this.Items {
  249. if item != nil {
  250. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  251. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  252. }
  253. }
  254. }
  255. return nil
  256. }
  257. func (this *InsertTableRowItem) Validate() error {
  258. if this.TablePrefixWithSchema == "" {
  259. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  260. }
  261. if this.Version == "" {
  262. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  263. }
  264. for _, item := range this.KeyColumns {
  265. if !(len(item) > 0) {
  266. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  267. }
  268. }
  269. for _, item := range this.TableRows {
  270. if item != nil {
  271. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  272. return github_com_mwitkow_go_proto_validators.FieldError("TableRows", err)
  273. }
  274. }
  275. }
  276. return nil
  277. }
  278. func (this *DeleteRequest) Validate() error {
  279. if this.DatabaseID == "" {
  280. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  281. }
  282. if this.TablePrefixWithSchema == "" {
  283. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  284. }
  285. if this.Version == "" {
  286. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  287. }
  288. for _, item := range this.KeyColumns {
  289. if !(len(item) > 0) {
  290. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  291. }
  292. }
  293. for _, item := range this.KeyValues {
  294. if !(len(item) > 0) {
  295. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  296. }
  297. }
  298. return nil
  299. }
  300. func (this *DeleteWhereRequest) Validate() error {
  301. if this.DatabaseID == "" {
  302. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  303. }
  304. if this.TablePrefixWithSchema == "" {
  305. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  306. }
  307. if this.Version == "" {
  308. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  309. }
  310. for _, item := range this.KeyColumns {
  311. if !(len(item) > 0) {
  312. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  313. }
  314. }
  315. return nil
  316. }
  317. func (this *UpdateRequest) Validate() error {
  318. if this.DatabaseID == "" {
  319. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  320. }
  321. if this.TablePrefixWithSchema == "" {
  322. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  323. }
  324. if this.Version == "" {
  325. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  326. }
  327. for _, item := range this.KeyColumns {
  328. if !(len(item) > 0) {
  329. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  330. }
  331. }
  332. for _, item := range this.KeyValues {
  333. if !(len(item) > 0) {
  334. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  335. }
  336. }
  337. if this.NewTableRow != nil {
  338. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  339. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  340. }
  341. }
  342. return nil
  343. }
  344. func (this *UpdateWhereRequest) Validate() error {
  345. if this.DatabaseID == "" {
  346. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  347. }
  348. if this.TablePrefixWithSchema == "" {
  349. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  350. }
  351. if this.Version == "" {
  352. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  353. }
  354. for _, item := range this.KeyColumns {
  355. if !(len(item) > 0) {
  356. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  357. }
  358. }
  359. if this.NewTableRow != nil {
  360. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  361. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  362. }
  363. }
  364. return nil
  365. }
  366. func (this *ReplayRequest) Validate() error {
  367. if this.DatabaseID == "" {
  368. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  369. }
  370. if this.TablePrefixWithSchema == "" {
  371. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  372. }
  373. if this.Version == "" {
  374. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  375. }
  376. for _, item := range this.KeyColumns {
  377. if !(len(item) > 0) {
  378. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  379. }
  380. }
  381. for _, item := range this.KeyValues {
  382. if !(len(item) > 0) {
  383. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  384. }
  385. }
  386. return nil
  387. }
  388. func (this *TableRow) Validate() error {
  389. for _, item := range this.Columns {
  390. if item != nil {
  391. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  392. return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
  393. }
  394. }
  395. }
  396. return nil
  397. }
  398. func (this *Column) Validate() error {
  399. if this.Value != nil {
  400. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
  401. return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
  402. }
  403. }
  404. return nil
  405. }
  406. func (this *ColumnValue) Validate() error {
  407. return nil
  408. }