query.validator.pb.go 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: v1/request/query.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 *QueryByWhereAndOrderByRequest) 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. return nil
  26. }
  27. func (this *CommonQueryRequest) Validate() error {
  28. if this.DatabaseID == "" {
  29. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  30. }
  31. if this.TablePrefixWithSchema == "" {
  32. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  33. }
  34. if this.Version == "" {
  35. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  36. }
  37. return nil
  38. }
  39. func (this *QueryByKeysRequest) Validate() error {
  40. if this.DatabaseID == "" {
  41. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  42. }
  43. if this.TablePrefixWithSchema == "" {
  44. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  45. }
  46. if this.Version == "" {
  47. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  48. }
  49. for _, item := range this.KeyColumns {
  50. if !(len(item) > 0) {
  51. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  52. }
  53. }
  54. for _, item := range this.KeyValues {
  55. if !(len(item) > 0) {
  56. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  57. }
  58. }
  59. return nil
  60. }
  61. func (this *CountWhereRequest) Validate() error {
  62. if this.DatabaseID == "" {
  63. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  64. }
  65. if this.TablePrefixWithSchema == "" {
  66. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  67. }
  68. if this.Version == "" {
  69. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  70. }
  71. return nil
  72. }
  73. func (this *CommonCountRequest) Validate() error {
  74. if this.DatabaseID == "" {
  75. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  76. }
  77. if this.TablePrefixWithSchema == "" {
  78. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  79. }
  80. if this.Version == "" {
  81. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  82. }
  83. return nil
  84. }