command.validator.pb.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 this.TablePrefixWithSchema == "" {
  20. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  21. }
  22. if this.Version == "" {
  23. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  24. }
  25. if !(len(this.Model) > 0) {
  26. return github_com_mwitkow_go_proto_validators.FieldError("Model", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Model))
  27. }
  28. return nil
  29. }
  30. func (this *TransactionOperation) Validate() error {
  31. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  32. if oneOfNester.TransactionBeginRequest != nil {
  33. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  34. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  35. }
  36. }
  37. }
  38. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertRequest); ok {
  39. if oneOfNester.InsertRequest != nil {
  40. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertRequest); err != nil {
  41. return github_com_mwitkow_go_proto_validators.FieldError("InsertRequest", err)
  42. }
  43. }
  44. }
  45. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteRequest); ok {
  46. if oneOfNester.DeleteRequest != nil {
  47. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteRequest); err != nil {
  48. return github_com_mwitkow_go_proto_validators.FieldError("DeleteRequest", err)
  49. }
  50. }
  51. }
  52. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateRequest); ok {
  53. if oneOfNester.UpdateRequest != nil {
  54. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateRequest); err != nil {
  55. return github_com_mwitkow_go_proto_validators.FieldError("UpdateRequest", err)
  56. }
  57. }
  58. }
  59. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  60. if oneOfNester.TransactionEndRequest != nil {
  61. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  62. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  63. }
  64. }
  65. }
  66. return nil
  67. }
  68. func (this *InsertRequest) Validate() error {
  69. if this.DatabaseID == "" {
  70. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  71. }
  72. if this.TablePrefixWithSchema == "" {
  73. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  74. }
  75. if this.Version == "" {
  76. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  77. }
  78. if !(len(this.Keys) > 0) {
  79. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  80. }
  81. if !(len(this.Models) > 0) {
  82. return github_com_mwitkow_go_proto_validators.FieldError("Models", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Models))
  83. }
  84. return nil
  85. }
  86. func (this *DeleteRequest) Validate() error {
  87. if this.DatabaseID == "" {
  88. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  89. }
  90. if this.TablePrefixWithSchema == "" {
  91. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  92. }
  93. if this.Version == "" {
  94. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  95. }
  96. if !(len(this.Keys) > 0) {
  97. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  98. }
  99. return nil
  100. }
  101. func (this *UpdateRequest) Validate() error {
  102. if this.DatabaseID == "" {
  103. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  104. }
  105. if this.TablePrefixWithSchema == "" {
  106. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  107. }
  108. if this.Version == "" {
  109. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  110. }
  111. if !(len(this.Keys) > 0) {
  112. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  113. }
  114. if !(len(this.NewModel) > 0) {
  115. return github_com_mwitkow_go_proto_validators.FieldError("NewModel", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.NewModel))
  116. }
  117. return nil
  118. }
  119. func (this *ReplayRequest) Validate() error {
  120. if this.DatabaseID == "" {
  121. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  122. }
  123. if this.TablePrefixWithSchema == "" {
  124. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  125. }
  126. if this.Version == "" {
  127. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  128. }
  129. if !(len(this.Keys) > 0) {
  130. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  131. }
  132. return nil
  133. }
  134. func (this *TransactionBeginRequest) Validate() error {
  135. if this.DatabaseID == "" {
  136. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  137. }
  138. return nil
  139. }
  140. func (this *TransactionEndRequest) Validate() error {
  141. return nil
  142. }