query.validator.pb.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. return nil
  20. }
  21. func (this *CommonQueryRequest) Validate() error {
  22. if this.DatabaseID == "" {
  23. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  24. }
  25. return nil
  26. }
  27. func (this *QueryByKeysRequest) 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. for _, item := range this.KeyColumns {
  38. if !(len(item) > 0) {
  39. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  40. }
  41. }
  42. for _, item := range this.KeyValues {
  43. if !(len(item) > 0) {
  44. return github_com_mwitkow_go_proto_validators.FieldError("KeyValues", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  45. }
  46. }
  47. return nil
  48. }
  49. func (this *CountWhereRequest) Validate() error {
  50. if this.DatabaseID == "" {
  51. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  52. }
  53. return nil
  54. }
  55. func (this *CommonCountRequest) Validate() error {
  56. if this.DatabaseID == "" {
  57. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  58. }
  59. return nil
  60. }