sql.validator.pb.go 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: v1/request/sql.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 *TransactionBeginRequest) Validate() error {
  16. if this.Token == "" {
  17. return github_com_mwitkow_go_proto_validators.FieldError("Token", fmt.Errorf(`value '%v' must not be an empty string`, this.Token))
  18. }
  19. if this.Namespace == "" {
  20. return github_com_mwitkow_go_proto_validators.FieldError("Namespace", fmt.Errorf(`value '%v' must not be an empty string`, this.Namespace))
  21. }
  22. if this.DataSource == "" {
  23. return github_com_mwitkow_go_proto_validators.FieldError("DataSource", fmt.Errorf(`value '%v' must not be an empty string`, this.DataSource))
  24. }
  25. return nil
  26. }
  27. func (this *TransactionEndRequest) Validate() error {
  28. return nil
  29. }
  30. func (this *ExecuteRawSqlRequest) Validate() error {
  31. if this.SQL == "" {
  32. return github_com_mwitkow_go_proto_validators.FieldError("SQL", fmt.Errorf(`value '%v' must not be an empty string`, this.SQL))
  33. }
  34. return nil
  35. }
  36. func (this *ExecuteSqlRequest) Validate() error {
  37. if this.Name == "" {
  38. return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must not be an empty string`, this.Name))
  39. }
  40. return nil
  41. }
  42. func (this *TransactionOperation) Validate() error {
  43. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  44. if oneOfNester.TransactionBeginRequest != nil {
  45. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  46. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  47. }
  48. }
  49. }
  50. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  51. if oneOfNester.TransactionEndRequest != nil {
  52. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  53. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  54. }
  55. }
  56. }
  57. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_ExecuteRawSqlRequest); ok {
  58. if oneOfNester.ExecuteRawSqlRequest != nil {
  59. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.ExecuteRawSqlRequest); err != nil {
  60. return github_com_mwitkow_go_proto_validators.FieldError("ExecuteRawSqlRequest", err)
  61. }
  62. }
  63. }
  64. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_ExecuteSqlRequest); ok {
  65. if oneOfNester.ExecuteSqlRequest != nil {
  66. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.ExecuteSqlRequest); err != nil {
  67. return github_com_mwitkow_go_proto_validators.FieldError("ExecuteSqlRequest", err)
  68. }
  69. }
  70. }
  71. return nil
  72. }