-
Notifications
You must be signed in to change notification settings - Fork 1
/
pay_gateway.validator.pb.go
54 lines (49 loc) · 2.52 KB
/
pay_gateway.validator.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pay_gateway.proto
package pay
import regexp "regexp"
import fmt "fmt"
import github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
import proto "github.com/golang/protobuf/proto"
import math "math"
import _ "github.com/golang/protobuf/ptypes/timestamp"
import _ "github.com/mwitkow/go-proto-validators"
import _ "google.golang.org/genproto/googleapis/api/annotations"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _regex_PayRequest_OutTradeNo = regexp.MustCompile(`^[A-Za-z0-9_-]+$`)
var _regex_PayRequest_AppId = regexp.MustCompile(`^\w+$`)
var _regex_PayRequest_Sign = regexp.MustCompile(`^[A-Za-z0-9+/=\s\n\r]+$`)
var _regex_PayRequest_OrderTime = regexp.MustCompile(`^[0-9]{4}(-[0-9]{2}){2}\s[0-9]{2}(:[0-9]{2}){2}$`)
func (this *PayRequest) Validate() error {
if !_regex_PayRequest_OutTradeNo.MatchString(this.OutTradeNo) {
return github_com_mwitkow_go_proto_validators.FieldError("OutTradeNo", fmt.Errorf(`value '%v' must be a string conforming to regex "^[A-Za-z0-9_-]+$"`, this.OutTradeNo))
}
if !(this.PayAmount > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("PayAmount", fmt.Errorf(`value '%v' must be greater than '0'`, this.PayAmount))
}
if !(this.PayAmount < 1000000000) {
return github_com_mwitkow_go_proto_validators.FieldError("PayAmount", fmt.Errorf(`value '%v' must be less than '1000000000'`, this.PayAmount))
}
if !_regex_PayRequest_AppId.MatchString(this.AppId) {
return github_com_mwitkow_go_proto_validators.FieldError("AppId", fmt.Errorf(`value '%v' must be a string conforming to regex "^\\w+$"`, this.AppId))
}
if !_regex_PayRequest_Sign.MatchString(this.Sign) {
return github_com_mwitkow_go_proto_validators.FieldError("Sign", fmt.Errorf(`value '%v' must be a string conforming to regex "^[A-Za-z0-9+/=\\s\\n\\r]+$"`, this.Sign))
}
if !_regex_PayRequest_OrderTime.MatchString(this.OrderTime) {
return github_com_mwitkow_go_proto_validators.FieldError("OrderTime", fmt.Errorf(`value '%v' must be a string conforming to regex "^[0-9]{4}(-[0-9]{2}){2}\\s[0-9]{2}(:[0-9]{2}){2}$"`, this.OrderTime))
}
return nil
}
func (this *PayResponse) Validate() error {
if this.Result != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Result); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Result", err)
}
}
// Validation of proto3 map<> fields is unsupported.
return nil
}