github.com/s7techlab/cckit@v0.10.5/examples/token/service/balance/balance.validator.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: token/service/balance/balance.proto 3 4 package balance 5 6 import ( 7 fmt "fmt" 8 proto "github.com/golang/protobuf/proto" 9 _ "github.com/mwitkow/go-proto-validators" 10 github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" 11 _ "google.golang.org/genproto/googleapis/api/annotations" 12 _ "google.golang.org/protobuf/types/known/emptypb" 13 math "math" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 func (this *GetBalanceRequest) Validate() error { 22 if this.Address == "" { 23 return github_com_mwitkow_go_proto_validators.FieldError("Address", fmt.Errorf(`value '%v' must not be an empty string`, this.Address)) 24 } 25 return nil 26 } 27 func (this *ListAddressBalancesRequest) Validate() error { 28 if this.Address == "" { 29 return github_com_mwitkow_go_proto_validators.FieldError("Address", fmt.Errorf(`value '%v' must not be an empty string`, this.Address)) 30 } 31 return nil 32 } 33 func (this *TransferRequest) Validate() error { 34 if this.RecipientAddress == "" { 35 return github_com_mwitkow_go_proto_validators.FieldError("RecipientAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.RecipientAddress)) 36 } 37 if !(this.Amount > 0) { 38 return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must be greater than '0'`, this.Amount)) 39 } 40 for _, item := range this.Meta { 41 if item != nil { 42 if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { 43 return github_com_mwitkow_go_proto_validators.FieldError("Meta", err) 44 } 45 } 46 } 47 return nil 48 } 49 func (this *TransferResponse) Validate() error { 50 for _, item := range this.Meta { 51 if item != nil { 52 if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { 53 return github_com_mwitkow_go_proto_validators.FieldError("Meta", err) 54 } 55 } 56 } 57 return nil 58 } 59 func (this *BalanceId) Validate() error { 60 return nil 61 } 62 func (this *Balance) Validate() error { 63 return nil 64 } 65 func (this *Balances) Validate() error { 66 for _, item := range this.Items { 67 if item != nil { 68 if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { 69 return github_com_mwitkow_go_proto_validators.FieldError("Items", err) 70 } 71 } 72 } 73 return nil 74 } 75 func (this *BalanceOperation) Validate() error { 76 return nil 77 } 78 func (this *Transferred) Validate() error { 79 for _, item := range this.Meta { 80 if item != nil { 81 if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { 82 return github_com_mwitkow_go_proto_validators.FieldError("Meta", err) 83 } 84 } 85 } 86 return nil 87 } 88 func (this *AddMetaRequest) Validate() error { 89 if this.Key == "" { 90 return github_com_mwitkow_go_proto_validators.FieldError("Key", fmt.Errorf(`value '%v' must not be an empty string`, this.Key)) 91 } 92 if this.Value == "" { 93 return github_com_mwitkow_go_proto_validators.FieldError("Value", fmt.Errorf(`value '%v' must not be an empty string`, this.Value)) 94 } 95 return nil 96 } 97 func (this *Meta) Validate() error { 98 return nil 99 }