sql.validator.pb.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 *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_TransactionEndRequest); ok {
  39. if oneOfNester.TransactionEndRequest != nil {
  40. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  41. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  42. }
  43. }
  44. }
  45. return nil
  46. }