├── .gitignore ├── gen.go ├── README.md ├── common ├── common.go └── loader.go ├── tools.go ├── Makefile ├── api_pb ├── swagger.pb.validate.go ├── swagger.pb.go ├── api.pb.validate.go ├── api.pb.gw.go └── api.pb.go ├── swagger.proto ├── cmd └── main.go ├── api.proto └── service └── service.go /.gitignore: -------------------------------------------------------------------------------- 1 | /bin -------------------------------------------------------------------------------- /gen.go: -------------------------------------------------------------------------------- 1 | //go:generate make 2 | 3 | package mt4grpc 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mt4-grpc 2 | gRPC wrapper for mt4 manager api 3 | -------------------------------------------------------------------------------- /common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "mtdealer" 4 | 5 | type IDealerLoader interface { 6 | Load(token string) (*mtdealer.DealerManager, error) 7 | } 8 | -------------------------------------------------------------------------------- /tools.go: -------------------------------------------------------------------------------- 1 | // +build tools 2 | 3 | package mt4grpc 4 | 5 | import ( 6 | _ "github.com/golang/protobuf/protoc-gen-go" 7 | _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" 8 | _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" 9 | ) 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | rd /s /q "api_pb" 3 | mkdir "api_pb" 4 | protoc -I/usr/local/include -I. \ 5 | -I${GOPATH}/src \ 6 | -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ 7 | -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway \ 8 | -I${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate \ 9 | --grpc-gateway_out=logtostderr=true:./api_pb \ 10 | --swagger_out=allow_merge=true,merge_file_name=api:./bin \ 11 | --go_out=plugins=grpc:./api_pb \ 12 | --validate_out="lang=go:./api_pb" ./*.proto 13 | -------------------------------------------------------------------------------- /api_pb/swagger.pb.validate.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-validate. DO NOT EDIT. 2 | // source: swagger.proto 3 | 4 | package api_pb 5 | 6 | import ( 7 | "bytes" 8 | "errors" 9 | "fmt" 10 | "net" 11 | "net/mail" 12 | "net/url" 13 | "regexp" 14 | "strings" 15 | "time" 16 | "unicode/utf8" 17 | 18 | "github.com/golang/protobuf/ptypes" 19 | ) 20 | 21 | // ensure the imports are used 22 | var ( 23 | _ = bytes.MinRead 24 | _ = errors.New("") 25 | _ = fmt.Print 26 | _ = utf8.UTFMax 27 | _ = (*regexp.Regexp)(nil) 28 | _ = (*strings.Reader)(nil) 29 | _ = net.IPv4len 30 | _ = time.Duration(0) 31 | _ = (*url.URL)(nil) 32 | _ = (*mail.Address)(nil) 33 | _ = ptypes.DynamicAny{} 34 | ) 35 | 36 | // define the regex for a UUID once up-front 37 | var _swagger_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") 38 | -------------------------------------------------------------------------------- /swagger.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "protoc-gen-swagger/options/annotations.proto"; 4 | import "google/rpc/status.proto"; 5 | 6 | package api_pb; 7 | 8 | option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { 9 | info: { 10 | title: "Metatrader gRPC" 11 | version: "1.0" 12 | contact: { 13 | name: "Mikhail" 14 | url: "https://github.com/mikha-dev" 15 | email: "mikhail@dev4traders.com" 16 | }; 17 | }; 18 | schemes: [HTTP,HTTPS,WS,WSS] 19 | consumes: "application/json" 20 | produces: "application/json" 21 | responses: { 22 | key: "default" 23 | value: { 24 | description: "" 25 | schema: { 26 | json_schema: { 27 | ref: ".google.rpc.Status" 28 | }; 29 | }; 30 | }; 31 | }; 32 | }; -------------------------------------------------------------------------------- /common/loader.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "errors" 5 | "mtdealer" 6 | "sync" 7 | ) 8 | 9 | type DealerLoader struct { 10 | mu sync.Mutex 11 | configs map[string]mtdealer.Config 12 | dealers map[string]*mtdealer.DealerManager 13 | } 14 | 15 | func NewDealerLoader(configs map[string]mtdealer.Config) *DealerLoader { 16 | return &DealerLoader{ 17 | configs: configs, 18 | dealers: make(map[string]*mtdealer.DealerManager, len(configs)), 19 | } 20 | } 21 | 22 | func (this *DealerLoader) Load(token string) (*mtdealer.DealerManager, error) { 23 | this.mu.Lock() 24 | defer this.mu.Unlock() 25 | 26 | if c, ok := this.configs[token]; !ok { 27 | return nil, errors.New("ManagerToken not found, check token") 28 | } else { 29 | 30 | if dealer, ok := this.dealers[token]; ok { 31 | return dealer, nil 32 | } 33 | 34 | dealer := mtdealer.NewDealerManager(&c) 35 | this.dealers[token] = dealer 36 | 37 | return dealer, nil 38 | } 39 | 40 | } 41 | 42 | func (this *DealerLoader) Stop() { 43 | for _, dealer := range this.dealers { 44 | dealer.Stop() 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api_pb/swagger.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: swagger.proto 3 | 4 | package api_pb 5 | 6 | import ( 7 | fmt "fmt" 8 | proto "github.com/golang/protobuf/proto" 9 | _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" 10 | _ "google.golang.org/genproto/googleapis/rpc/status" 11 | math "math" 12 | ) 13 | 14 | // Reference imports to suppress errors if they are not otherwise used. 15 | var _ = proto.Marshal 16 | var _ = fmt.Errorf 17 | var _ = math.Inf 18 | 19 | // This is a compile-time assertion to ensure that this generated file 20 | // is compatible with the proto package it is being compiled against. 21 | // A compilation error at this line likely means your copy of the 22 | // proto package needs to be updated. 23 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 24 | 25 | func init() { proto.RegisterFile("swagger.proto", fileDescriptor_49635b75e059a131) } 26 | 27 | var fileDescriptor_49635b75e059a131 = []byte{ 28 | // 238 bytes of a gzipped FileDescriptorProto 29 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x8e, 0xc1, 0x4a, 0xc3, 0x40, 30 | 0x10, 0x86, 0x89, 0x2d, 0x2d, 0x04, 0x44, 0x59, 0xc4, 0x4a, 0xf0, 0x20, 0x7a, 0x13, 0xb3, 0xab, 31 | 0xd5, 0x53, 0x4f, 0x55, 0xcf, 0x05, 0xa9, 0x17, 0x6f, 0x32, 0xd9, 0xac, 0x9b, 0xd5, 0x64, 0x67, 32 | 0xd8, 0x9d, 0xd4, 0xf7, 0xf0, 0x2d, 0x3c, 0xf8, 0x8e, 0xd2, 0x4d, 0x6f, 0xbd, 0xcd, 0xcc, 0xff, 33 | 0xcd, 0xcf, 0x97, 0x1f, 0xc6, 0x6f, 0xb0, 0xd6, 0x04, 0x49, 0x01, 0x19, 0xc5, 0x04, 0xc8, 0xbd, 34 | 0x53, 0x55, 0xdc, 0xa4, 0x55, 0x97, 0xd6, 0xf8, 0x72, 0x47, 0x28, 0x24, 0x76, 0xe8, 0xa3, 0x02, 35 | 0xef, 0x91, 0x21, 0xcd, 0xc3, 0x57, 0x31, 0xb3, 0x88, 0xb6, 0x35, 0x2a, 0x90, 0x56, 0x91, 0x81, 36 | 0xfb, 0x5d, 0xf0, 0xf4, 0x97, 0xfd, 0x3c, 0xfe, 0x66, 0xe2, 0x2d, 0x3f, 0x5a, 0x19, 0x06, 0x0e, 37 | 0x50, 0x9b, 0x70, 0x61, 0xd7, 0x2f, 0xcf, 0x97, 0xcb, 0x7c, 0xba, 0x72, 0x5f, 0x0d, 0xb8, 0x56, 38 | 0x9c, 0x37, 0xcc, 0x14, 0x17, 0x4a, 0x59, 0xc7, 0x4d, 0x5f, 0x49, 0x8d, 0x9d, 0xea, 0xb6, 0x59, 39 | 0x59, 0x9b, 0x4d, 0x31, 0xeb, 0x06, 0x6c, 0x59, 0x9b, 0xcd, 0xc3, 0xd0, 0x10, 0xb7, 0xc8, 0x7c, 40 | 0x74, 0x27, 0x6f, 0xaf, 0xc7, 0xd9, 0xc1, 0x68, 0x3c, 0x3f, 0x06, 0xa2, 0xd6, 0xe9, 0xe4, 0xa4, 41 | 0x3e, 0x23, 0xfa, 0xc5, 0xde, 0x65, 0x7d, 0x95, 0x4f, 0x6b, 0xf3, 0x01, 0x7d, 0xcb, 0xe2, 0x4c, 42 | 0x9c, 0xe6, 0x27, 0x85, 0x90, 0x83, 0xb5, 0x0c, 0xa4, 0xe5, 0x6b, 0xb2, 0xae, 0x26, 0x49, 0xfb, 43 | 0xfe, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x38, 0x91, 0x07, 0x16, 0x01, 0x00, 0x00, 44 | } 45 | -------------------------------------------------------------------------------- /cmd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "flag" 7 | "io/ioutil" 8 | "mt4grpc/api_pb" 9 | "mt4grpc/common" 10 | "mt4grpc/service" 11 | "mtconfig" 12 | "mtdealer" 13 | "mtlog" 14 | "net" 15 | "net/http" 16 | 17 | grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" 18 | "github.com/grpc-ecosystem/grpc-gateway/runtime" 19 | "github.com/prometheus/client_golang/prometheus/promhttp" 20 | "github.com/sherifabdlnaby/configuro" 21 | "github.com/tmc/grpc-websocket-proxy/wsproxy" 22 | "go.uber.org/zap" 23 | "golang.org/x/sync/errgroup" 24 | "google.golang.org/grpc" 25 | ) 26 | 27 | type Config struct { 28 | Server struct { 29 | RestAddr string 30 | GrpcAddr string 31 | PromAddr string 32 | WsAddr string 33 | Mode string 34 | } 35 | 36 | ManagerLogger mtconfig.Common 37 | 38 | Dealers map[string]mtdealer.Config 39 | } 40 | 41 | var conf *Config 42 | var log *zap.Logger 43 | 44 | func initLog() error { 45 | 46 | // loading mt4 api manager logger 47 | l, err := mtlog.NewLogger(conf.ManagerLogger.LogPath, conf.ManagerLogger.LogLevel) 48 | if err != nil { 49 | return err 50 | } 51 | 52 | mtlog.SetDefault(l) 53 | mtlog.Info("log path: \"%s\" with level \"%s\"", conf.ManagerLogger.LogPath, conf.ManagerLogger.LogLevel) 54 | // -- loading mt4 api manager logger 55 | 56 | // loading zap logger 57 | var cfg zap.Config 58 | f, _ := ioutil.ReadFile(".\\logger.json") 59 | if err := json.Unmarshal(f, &cfg); err != nil { 60 | panic(err) 61 | } 62 | if log, err = cfg.Build(); err != nil { 63 | panic(err) 64 | } 65 | // -- loading zap logger 66 | 67 | return nil 68 | } 69 | 70 | func run() error { 71 | 72 | configLoader, err := configuro.NewConfig() 73 | if err != nil { 74 | return err 75 | } 76 | 77 | conf = &Config{} 78 | 79 | if err := configLoader.Load(conf); err != nil { 80 | return err 81 | } 82 | 83 | if err := initLog(); err != nil { 84 | panic(err) 85 | } 86 | 87 | log.Info("loader servers", 88 | zap.String("rest", conf.Server.RestAddr), 89 | zap.String("grpc", conf.Server.GrpcAddr), 90 | zap.String("prometheus", conf.Server.PromAddr), 91 | zap.String("ws", conf.Server.WsAddr), 92 | ) 93 | 94 | for k, v := range conf.Dealers { 95 | log.Info( 96 | "loaded manager config", 97 | zap.String("token", k), 98 | zap.String("server", v.ServerAddr), 99 | zap.Int("accont", v.Account), 100 | ) 101 | } 102 | loader := common.NewDealerLoader(conf.Dealers) 103 | 104 | defer func() { 105 | loader.Stop() 106 | }() 107 | 108 | ctx := context.Background() 109 | ctx, cancel := context.WithCancel(ctx) 110 | defer cancel() 111 | 112 | lis, err := net.Listen("tcp", conf.Server.GrpcAddr) 113 | if err != nil { 114 | return err 115 | } 116 | 117 | grpcServer := grpc.NewServer( 118 | grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor), 119 | grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor), 120 | ) 121 | 122 | api_pb.RegisterUserServiceServer(grpcServer, service.NewUserService(loader, log)) 123 | grpc_prometheus.Register(grpcServer) 124 | 125 | var group errgroup.Group 126 | 127 | group.Go(func() error { 128 | return grpcServer.Serve(lis) 129 | }) 130 | 131 | mux := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: true})) 132 | runtime.SetHTTPBodyMarshaler(mux) 133 | opts := []grpc.DialOption{ 134 | grpc.WithInsecure(), 135 | grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(50000000)), 136 | } 137 | 138 | hmux := http.NewServeMux() 139 | hmux.HandleFunc("/swagger.json", func(w http.ResponseWriter, req *http.Request) { 140 | http.ServeFile(w, req, "api.swagger.json") 141 | }) 142 | 143 | hmux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { 144 | http.ServeFile(w, req, "doc.html") 145 | }) 146 | 147 | group.Go(func() error { 148 | return http.ListenAndServe(conf.Server.RestAddr, hmux) 149 | }) 150 | 151 | group.Go(func() error { 152 | return api_pb.RegisterUserServiceHandlerFromEndpoint(ctx, mux, conf.Server.GrpcAddr, opts) 153 | }) 154 | group.Go(func() error { 155 | return http.ListenAndServe(conf.Server.WsAddr, wsproxy.WebsocketProxy(mux)) 156 | }) 157 | group.Go(func() error { 158 | return http.ListenAndServe(conf.Server.PromAddr, promhttp.Handler()) 159 | }) 160 | 161 | return group.Wait() 162 | } 163 | 164 | func main() { 165 | flag.Parse() 166 | 167 | defer func() { 168 | if err := log.Sync(); err != nil { 169 | panic(err) 170 | } 171 | }() 172 | 173 | if err := run(); err != nil { 174 | log.Fatal(err.Error()) 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /api.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package api_pb; 4 | 5 | import "google/api/annotations.proto"; 6 | import "google/protobuf/struct.proto"; 7 | import "google/api/httpbody.proto"; 8 | import "google/protobuf/empty.proto"; 9 | import "validate/validate.proto"; 10 | import "google/protobuf/field_mask.proto"; 11 | 12 | enum Cmd { 13 | CMD_BUY = 0; 14 | CMD_SELL = 1; 15 | } 16 | 17 | message UserInfo { 18 | // Output only. 19 | int32 login = 1; 20 | string group = 2; 21 | string name = 3; 22 | int32 enabled = 4; 23 | int32 leverage = 5; 24 | // Output only. 25 | double balance = 6; 26 | // Output only. 27 | double credit = 7; 28 | int32 agent_account = 8; 29 | } 30 | 31 | message UserInfoRequest { 32 | string token = 1; 33 | int32 login = 2; 34 | } 35 | 36 | message UserInfoResponse { 37 | UserInfo user = 1; 38 | int32 code = 2; 39 | string message = 3; 40 | } 41 | 42 | 43 | message AddUserInfo { 44 | string email = 1; 45 | string password = 2; 46 | string password_investor = 3; 47 | string group = 4; 48 | string name = 5; 49 | int32 login = 6; 50 | int32 enabled = 7; 51 | string city = 8; 52 | string phone = 9; 53 | } 54 | 55 | message AddUserRequest { 56 | string token = 1; 57 | AddUserInfo user = 2; 58 | google.protobuf.FieldMask update_mask = 3; 59 | } 60 | 61 | message AddUserResponse { 62 | int32 login = 1; 63 | int32 code = 2; 64 | string message = 3; 65 | } 66 | 67 | message UpdateUserInfo { 68 | int32 login = 1; 69 | string email = 2; 70 | string name = 3; 71 | int32 enabled = 4; 72 | string password = 5; 73 | string password_investor = 6; 74 | string phone = 7; 75 | string city = 8; 76 | string group = 9; 77 | } 78 | 79 | message UpdateUserRequest { 80 | string token = 1; 81 | UpdateUserInfo user = 2; 82 | google.protobuf.FieldMask update_mask = 3; 83 | } 84 | 85 | message UpdateUserResponse { 86 | int32 code = 1; 87 | string message = 2; 88 | } 89 | 90 | message DeleteUserRequest { 91 | string token = 1; 92 | int32 login = 2; 93 | } 94 | 95 | message DeleteUserResponse { 96 | int32 code = 1; 97 | string message = 2; 98 | } 99 | 100 | message ResetPasswordInfo { 101 | int32 login = 1; 102 | string password = 2; 103 | string password_investor = 3; 104 | } 105 | 106 | message ResetPasswordRequest { 107 | string token = 1; 108 | ResetPasswordInfo user = 2; 109 | google.protobuf.FieldMask update_mask = 3; 110 | } 111 | 112 | message ResetPasswordResponse { 113 | int32 code = 1; 114 | string message = 2; 115 | } 116 | 117 | message FundsInfo { 118 | int32 login = 1; 119 | double amount = 2; 120 | int32 is_credit = 3; 121 | string comment = 4; 122 | } 123 | 124 | message FundsRequest { 125 | string token = 1; 126 | FundsInfo user = 2; 127 | google.protobuf.FieldMask update_mask = 3; 128 | } 129 | 130 | message FundsResponse { 131 | double balance = 1; 132 | double credit = 2; 133 | } 134 | 135 | message TradeInfo { 136 | int32 ticket = 1; 137 | int32 login = 2; 138 | string symbol = 3; 139 | int32 digits = 4; 140 | Cmd cmd = 5; 141 | int32 volume = 6; 142 | int32 open_time = 7; 143 | int32 state = 8; 144 | double open_price = 9; 145 | double sl = 10; 146 | double tp = 11; 147 | int32 close_time = 12; 148 | int32 expiration = 13; 149 | double commission = 14; 150 | double close_price = 15; 151 | double profit = 16; 152 | int32 magic = 17; 153 | string comment = 18; 154 | } 155 | 156 | message OpenTradeRequest { 157 | int32 login = 1; 158 | string symbol = 2; 159 | Cmd cmd = 3; 160 | double price = 4; 161 | int32 slippage = 5; 162 | double sl = 6; 163 | double tp = 7; 164 | int32 volume = 8; 165 | string comment = 9; 166 | } 167 | 168 | message OpenTradeResponse { 169 | int32 ticket = 1; 170 | int32 error_code = 2; 171 | string message = 3; 172 | } 173 | 174 | message UpdateTradeRequest { 175 | int32 ticket = 1; 176 | double price = 4; 177 | double sl = 6; 178 | double tp = 7; 179 | } 180 | 181 | message UpdateTradeResponse { 182 | int32 error_code = 1; 183 | string message = 2; 184 | } 185 | 186 | message CloseTradeRequest { 187 | int32 ticket = 1; 188 | int32 volume = 2; 189 | } 190 | 191 | message CloseTradeResponse { 192 | int32 error_code = 1; 193 | string message = 2; 194 | } 195 | 196 | service UserService { 197 | 198 | rpc GetInfo(UserInfoRequest) returns (UserInfoResponse) { 199 | option (google.api.http) = { 200 | get: "/user/{login}" 201 | }; 202 | } 203 | 204 | rpc Delete(DeleteUserRequest) returns (DeleteUserResponse) { 205 | option (google.api.http) = { 206 | delete: "/user/{token}/{login}" 207 | }; 208 | } 209 | 210 | rpc Add(AddUserRequest) returns (AddUserResponse) { 211 | option (google.api.http) = { 212 | post: "/user/add/{token}", 213 | body: "user" 214 | }; 215 | } 216 | 217 | rpc Update(UpdateUserRequest) returns (UpdateUserResponse) { 218 | option (google.api.http) = { 219 | put: "/user/update/{token}" 220 | body: "user" 221 | additional_bindings { 222 | patch: "/user/update/{token}" 223 | body: "user" 224 | } 225 | }; 226 | } 227 | 228 | rpc Withdraw(FundsRequest) returns (FundsResponse) { 229 | option (google.api.http) = { 230 | put: "/user/withdraw/{token}" 231 | body: "user" 232 | additional_bindings { 233 | patch: "/user/withraw/{token}" 234 | body: "user" 235 | } 236 | }; 237 | } 238 | 239 | rpc Deposit(FundsRequest) returns (FundsResponse) { 240 | option (google.api.http) = { 241 | put: "/user/deposit/{token}" 242 | body: "user" 243 | additional_bindings { 244 | patch: "/user/deposit/{token}" 245 | body: "user" 246 | } 247 | }; 248 | } 249 | 250 | rpc ResetPassword(ResetPasswordRequest) returns (ResetPasswordResponse) { 251 | option (google.api.http) = { 252 | put: "/user/reset_password/{token}" 253 | body: "user" 254 | additional_bindings { 255 | patch: "/user/reset_password/{token}" 256 | body: "user" 257 | } 258 | }; 259 | } 260 | 261 | } -------------------------------------------------------------------------------- /service/service.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | "mt4grpc/common" 6 | 7 | "mt4grpc/api_pb" 8 | 9 | "github.com/pkg/errors" 10 | "go.uber.org/zap" 11 | ) 12 | 13 | type UserService struct { 14 | log *zap.Logger 15 | dealerLoader *common.DealerLoader 16 | } 17 | 18 | func NewUserService(dealerLoader *common.DealerLoader, log *zap.Logger) *UserService { 19 | return &UserService{dealerLoader: dealerLoader, log: log} 20 | } 21 | 22 | func (this *UserService) Add(_ context.Context, req *api_pb.AddUserRequest) (*api_pb.AddUserResponse, error) { 23 | 24 | dealer, err := this.dealerLoader.Load(req.Token) 25 | 26 | if err != nil { 27 | this.log.Error( 28 | "Filed to load dealer", 29 | zap.String("token", req.Token), 30 | zap.String("name", req.User.Name), 31 | zap.String("email", req.User.Email), 32 | ) 33 | return &api_pb.AddUserResponse{ 34 | Message: err.Error(), 35 | Code: 0, 36 | }, err 37 | } 38 | 39 | user, err := dealer.CreateAccount( 40 | req.User.Name, 41 | req.User.Password, 42 | req.User.PasswordInvestor, 43 | req.User.Group, 44 | req.User.City, 45 | req.User.Email, 46 | req.User.Phone, 47 | ) 48 | 49 | if err != nil { 50 | this.log.Info( 51 | "user added", 52 | zap.String("token", req.Token), 53 | zap.String("name", req.User.Name), 54 | zap.String("email", req.User.Email), 55 | ) 56 | return &api_pb.AddUserResponse{ 57 | Login: int32(user.Login), 58 | Message: "Added", 59 | Code: 100, 60 | }, nil 61 | } else { 62 | this.log.Error( 63 | "Filed to add user", 64 | zap.String("token", req.Token), 65 | zap.String("name", req.User.Name), 66 | zap.String("email", req.User.Email), 67 | ) 68 | return &api_pb.AddUserResponse{ 69 | Message: err.Error(), 70 | Code: 0, 71 | }, err 72 | } 73 | } 74 | 75 | func (this *UserService) GetInfo(_ context.Context, req *api_pb.UserInfoRequest) (*api_pb.UserInfoResponse, error) { 76 | 77 | dealer, err := this.dealerLoader.Load(req.Token) 78 | 79 | if err != nil { 80 | return nil, err 81 | } 82 | 83 | user, err := dealer.GetAsset(int(req.Login)) 84 | 85 | if err == nil { 86 | u := &api_pb.UserInfo{ 87 | Group: user.Group, 88 | Name: user.Name, 89 | Enabled: int32(user.Enabled), 90 | Leverage: int32(user.Leverage), 91 | Balance: user.Balance, 92 | Credit: user.Credit, 93 | AgentAccount: int32(user.AgentAccount), 94 | } 95 | return &api_pb.UserInfoResponse{ 96 | User: u, 97 | }, nil 98 | } else { 99 | this.log.Error( 100 | "Filed to get user", 101 | zap.String("token", req.Token), 102 | zap.Int32("login", req.Login), 103 | ) 104 | return &api_pb.UserInfoResponse{ 105 | Message: err.Error(), 106 | Code: 0, 107 | }, err 108 | } 109 | 110 | return nil, nil 111 | } 112 | 113 | func (this *UserService) Update(_ context.Context, req *api_pb.UpdateUserRequest) (*api_pb.UpdateUserResponse, error) { 114 | 115 | dealer, err := this.dealerLoader.Load(req.Token) 116 | 117 | if err != nil { 118 | this.log.Error( 119 | "Filed to load dealer", 120 | zap.String("token", req.Token), 121 | zap.Int32("login", req.User.Login), 122 | ) 123 | return &api_pb.UpdateUserResponse{ 124 | Message: err.Error(), 125 | Code: 0, 126 | }, err 127 | } 128 | 129 | _, retErr := dealer.UpdateAccount( 130 | int(req.User.Login), 131 | req.User.Name, 132 | req.User.Password, 133 | req.User.PasswordInvestor, 134 | req.User.Group, 135 | req.User.City, 136 | req.User.Email, 137 | req.User.Phone, 138 | ) 139 | 140 | if err == nil { 141 | this.log.Info( 142 | "user updated", 143 | zap.String("token", req.Token), 144 | zap.Int32("login", req.User.Login), 145 | zap.String("name", req.User.Name), 146 | zap.String("email", req.User.Email), 147 | ) 148 | return &api_pb.UpdateUserResponse{ 149 | Message: "Updated", 150 | Code: 100, 151 | }, nil 152 | } else { 153 | this.log.Error( 154 | "Filed to update user", 155 | zap.String("token", req.Token), 156 | zap.Int32("login", req.User.Login), 157 | zap.String("name", req.User.Name), 158 | zap.String("email", req.User.Email), 159 | zap.String("mt4_err", retErr.Error()), 160 | ) 161 | return &api_pb.UpdateUserResponse{ 162 | Message: err.Error(), 163 | Code: 0, 164 | }, retErr 165 | } 166 | } 167 | 168 | func (this *UserService) Delete(_ context.Context, req *api_pb.DeleteUserRequest) (*api_pb.DeleteUserResponse, error) { 169 | 170 | dealer, err := this.dealerLoader.Load(req.Token) 171 | 172 | if err != nil { 173 | this.log.Error( 174 | "Filed to load dealer", 175 | zap.String("token", req.Token), 176 | zap.Int32("login", req.Login), 177 | ) 178 | return &api_pb.DeleteUserResponse{ 179 | Message: err.Error(), 180 | Code: 0, 181 | }, err 182 | } 183 | 184 | retErr := dealer.DeleteAccount(int(req.Login)) 185 | 186 | if err == nil { 187 | this.log.Info( 188 | "user removed", 189 | zap.String("token", req.Token), 190 | zap.Int32("login", req.Login), 191 | ) 192 | return &api_pb.DeleteUserResponse{ 193 | Message: "Deleted", 194 | Code: 100, 195 | }, nil 196 | } else { 197 | this.log.Error( 198 | "Filed to delete user", 199 | zap.String("token", req.Token), 200 | zap.Int32("login", req.Login), 201 | zap.String("mt4_err", retErr.Error()), 202 | ) 203 | return &api_pb.DeleteUserResponse{ 204 | Message: err.Error(), 205 | Code: 0, 206 | }, retErr 207 | } 208 | } 209 | 210 | func (this *UserService) ResetPassword(_ context.Context, req *api_pb.ResetPasswordRequest) (*api_pb.ResetPasswordResponse, error) { 211 | 212 | dealer, err := this.dealerLoader.Load(req.Token) 213 | 214 | if err != nil { 215 | this.log.Error( 216 | "Filed to load dealer", 217 | zap.String("token", req.Token), 218 | zap.Int32("login", req.User.Login), 219 | zap.String("password", req.User.Password), 220 | zap.String("password_investor", req.User.PasswordInvestor), 221 | zap.String("mt4_err", err.Error()), 222 | ) 223 | return &api_pb.ResetPasswordResponse{ 224 | Message: err.Error(), 225 | Code: 0, 226 | }, err 227 | } 228 | 229 | var retErr error 230 | if len(req.User.Password) > 0 { 231 | retErr = dealer.ResetPassword( 232 | int(req.User.Login), 233 | req.User.Password, 234 | 0, 235 | ) 236 | } else { 237 | retErr = dealer.ResetPassword( 238 | int(req.User.Login), 239 | req.User.PasswordInvestor, 240 | 1, 241 | ) 242 | } 243 | 244 | if retErr == nil { 245 | this.log.Info( 246 | "user password reset", 247 | zap.String("token", req.Token), 248 | zap.Int32("login", req.User.Login), 249 | ) 250 | return &api_pb.ResetPasswordResponse{ 251 | Message: "Reset", 252 | Code: 100, 253 | }, nil 254 | } else { 255 | this.log.Error( 256 | "Filed to reset password", 257 | zap.String("token", req.Token), 258 | zap.Int32("login", req.User.Login), 259 | zap.String("password", req.User.Password), 260 | zap.String("password_investor", req.User.PasswordInvestor), 261 | zap.String("mt4_err", retErr.Error()), 262 | ) 263 | return &api_pb.ResetPasswordResponse{ 264 | Message: retErr.Error(), 265 | Code: 0, 266 | }, err 267 | } 268 | 269 | return nil, nil 270 | } 271 | 272 | func (this *UserService) Deposit(_ context.Context, req *api_pb.FundsRequest) (*api_pb.FundsResponse, error) { 273 | 274 | dealer, err := this.dealerLoader.Load(req.Token) 275 | 276 | if err != nil { 277 | this.log.Error( 278 | "Filed to load dealer", 279 | zap.String("token", req.Token), 280 | zap.Int32("login", req.User.Login), 281 | ) 282 | return &api_pb.FundsResponse{}, err 283 | } 284 | 285 | var is_credit bool 286 | if req.User.IsCredit == 1 { 287 | is_credit = true 288 | } 289 | retErr := dealer.DepositAccount( 290 | int(req.User.Login), 291 | req.User.Amount, 292 | req.User.Comment, 293 | is_credit, 294 | ) 295 | 296 | if retErr == nil { 297 | this.log.Info( 298 | "user deposited", 299 | zap.String("token", req.Token), 300 | zap.Int32("login", req.User.Login), 301 | zap.Float64("amount", req.User.Amount), 302 | ) 303 | user, err := dealer.GetAsset(int(req.User.Login)) 304 | 305 | if err != nil { 306 | return &api_pb.FundsResponse{ 307 | Balance: user.Balance, 308 | Credit: user.Credit, 309 | }, nil 310 | } else { 311 | return &api_pb.FundsResponse{}, err 312 | } 313 | } else { 314 | this.log.Error( 315 | "Filed to deposit user", 316 | zap.String("token", req.Token), 317 | zap.Int32("login", req.User.Login), 318 | zap.Float64("amount", req.User.Amount), 319 | zap.String("mt4_err", retErr.Error()), 320 | ) 321 | return &api_pb.FundsResponse{}, retErr 322 | } 323 | 324 | } 325 | 326 | func (this *UserService) Withdraw(_ context.Context, req *api_pb.FundsRequest) (*api_pb.FundsResponse, error) { 327 | 328 | dealer, err := this.dealerLoader.Load(req.Token) 329 | 330 | if err != nil { 331 | this.log.Error( 332 | "Filed to load dealer", 333 | zap.String("token", req.Token), 334 | zap.Int32("login", req.User.Login), 335 | ) 336 | return &api_pb.FundsResponse{}, err 337 | } 338 | user, err := dealer.GetAsset(int(req.User.Login)) 339 | 340 | if err != nil { 341 | this.log.Error( 342 | "Filed to load User", 343 | zap.String("token", req.Token), 344 | zap.Int32("login", req.User.Login), 345 | zap.String("mt4_err", err.Error()), 346 | ) 347 | return &api_pb.FundsResponse{}, err 348 | } 349 | 350 | if user.FreeMargin < req.User.Amount { 351 | this.log.Error( 352 | "Filed withdraw more than free margin", 353 | zap.String("token", req.Token), 354 | zap.Int32("login", req.User.Login), 355 | zap.Float64("amount", req.User.Amount), 356 | zap.Float64("free_margin", user.FreeMargin), 357 | ) 358 | return &api_pb.FundsResponse{Balance: user.Balance, Credit: user.Credit}, errors.New("Failed withdraw more than free margin") 359 | } 360 | 361 | var is_credit bool 362 | if req.User.IsCredit == 1 { 363 | is_credit = true 364 | } 365 | retErr := dealer.WithdrawAccount( 366 | int(req.User.Login), 367 | req.User.Amount, 368 | req.User.Comment, 369 | is_credit, 370 | ) 371 | 372 | if retErr == nil { 373 | this.log.Info( 374 | "user withdrawan", 375 | zap.String("token", req.Token), 376 | zap.Int32("login", req.User.Login), 377 | zap.Float64("amount", req.User.Amount), 378 | ) 379 | 380 | return &api_pb.FundsResponse{ 381 | Balance: user.Balance, 382 | Credit: user.Credit, 383 | }, nil 384 | } else { 385 | this.log.Error( 386 | "Filed to withdraw user", 387 | zap.String("token", req.Token), 388 | zap.Int32("login", req.User.Login), 389 | zap.Float64("amount", req.User.Amount), 390 | zap.String("mt4_err", retErr.Error()), 391 | ) 392 | return &api_pb.FundsResponse{ 393 | Balance: user.Balance, 394 | Credit: user.Credit, 395 | }, retErr 396 | } 397 | 398 | } 399 | -------------------------------------------------------------------------------- /api_pb/api.pb.validate.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-validate. DO NOT EDIT. 2 | // source: api.proto 3 | 4 | package api_pb 5 | 6 | import ( 7 | "bytes" 8 | "errors" 9 | "fmt" 10 | "net" 11 | "net/mail" 12 | "net/url" 13 | "regexp" 14 | "strings" 15 | "time" 16 | "unicode/utf8" 17 | 18 | "github.com/golang/protobuf/ptypes" 19 | ) 20 | 21 | // ensure the imports are used 22 | var ( 23 | _ = bytes.MinRead 24 | _ = errors.New("") 25 | _ = fmt.Print 26 | _ = utf8.UTFMax 27 | _ = (*regexp.Regexp)(nil) 28 | _ = (*strings.Reader)(nil) 29 | _ = net.IPv4len 30 | _ = time.Duration(0) 31 | _ = (*url.URL)(nil) 32 | _ = (*mail.Address)(nil) 33 | _ = ptypes.DynamicAny{} 34 | ) 35 | 36 | // define the regex for a UUID once up-front 37 | var _api_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") 38 | 39 | // Validate checks the field values on UserInfo with the rules defined in the 40 | // proto definition for this message. If any rules are violated, an error is returned. 41 | func (m *UserInfo) Validate() error { 42 | if m == nil { 43 | return nil 44 | } 45 | 46 | // no validation rules for Login 47 | 48 | // no validation rules for Group 49 | 50 | // no validation rules for Name 51 | 52 | // no validation rules for Enabled 53 | 54 | // no validation rules for Leverage 55 | 56 | // no validation rules for Balance 57 | 58 | // no validation rules for Credit 59 | 60 | // no validation rules for AgentAccount 61 | 62 | return nil 63 | } 64 | 65 | // UserInfoValidationError is the validation error returned by 66 | // UserInfo.Validate if the designated constraints aren't met. 67 | type UserInfoValidationError struct { 68 | field string 69 | reason string 70 | cause error 71 | key bool 72 | } 73 | 74 | // Field function returns field value. 75 | func (e UserInfoValidationError) Field() string { return e.field } 76 | 77 | // Reason function returns reason value. 78 | func (e UserInfoValidationError) Reason() string { return e.reason } 79 | 80 | // Cause function returns cause value. 81 | func (e UserInfoValidationError) Cause() error { return e.cause } 82 | 83 | // Key function returns key value. 84 | func (e UserInfoValidationError) Key() bool { return e.key } 85 | 86 | // ErrorName returns error name. 87 | func (e UserInfoValidationError) ErrorName() string { return "UserInfoValidationError" } 88 | 89 | // Error satisfies the builtin error interface 90 | func (e UserInfoValidationError) Error() string { 91 | cause := "" 92 | if e.cause != nil { 93 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 94 | } 95 | 96 | key := "" 97 | if e.key { 98 | key = "key for " 99 | } 100 | 101 | return fmt.Sprintf( 102 | "invalid %sUserInfo.%s: %s%s", 103 | key, 104 | e.field, 105 | e.reason, 106 | cause) 107 | } 108 | 109 | var _ error = UserInfoValidationError{} 110 | 111 | var _ interface { 112 | Field() string 113 | Reason() string 114 | Key() bool 115 | Cause() error 116 | ErrorName() string 117 | } = UserInfoValidationError{} 118 | 119 | // Validate checks the field values on UserInfoRequest with the rules defined 120 | // in the proto definition for this message. If any rules are violated, an 121 | // error is returned. 122 | func (m *UserInfoRequest) Validate() error { 123 | if m == nil { 124 | return nil 125 | } 126 | 127 | // no validation rules for Token 128 | 129 | // no validation rules for Login 130 | 131 | return nil 132 | } 133 | 134 | // UserInfoRequestValidationError is the validation error returned by 135 | // UserInfoRequest.Validate if the designated constraints aren't met. 136 | type UserInfoRequestValidationError struct { 137 | field string 138 | reason string 139 | cause error 140 | key bool 141 | } 142 | 143 | // Field function returns field value. 144 | func (e UserInfoRequestValidationError) Field() string { return e.field } 145 | 146 | // Reason function returns reason value. 147 | func (e UserInfoRequestValidationError) Reason() string { return e.reason } 148 | 149 | // Cause function returns cause value. 150 | func (e UserInfoRequestValidationError) Cause() error { return e.cause } 151 | 152 | // Key function returns key value. 153 | func (e UserInfoRequestValidationError) Key() bool { return e.key } 154 | 155 | // ErrorName returns error name. 156 | func (e UserInfoRequestValidationError) ErrorName() string { return "UserInfoRequestValidationError" } 157 | 158 | // Error satisfies the builtin error interface 159 | func (e UserInfoRequestValidationError) Error() string { 160 | cause := "" 161 | if e.cause != nil { 162 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 163 | } 164 | 165 | key := "" 166 | if e.key { 167 | key = "key for " 168 | } 169 | 170 | return fmt.Sprintf( 171 | "invalid %sUserInfoRequest.%s: %s%s", 172 | key, 173 | e.field, 174 | e.reason, 175 | cause) 176 | } 177 | 178 | var _ error = UserInfoRequestValidationError{} 179 | 180 | var _ interface { 181 | Field() string 182 | Reason() string 183 | Key() bool 184 | Cause() error 185 | ErrorName() string 186 | } = UserInfoRequestValidationError{} 187 | 188 | // Validate checks the field values on UserInfoResponse with the rules defined 189 | // in the proto definition for this message. If any rules are violated, an 190 | // error is returned. 191 | func (m *UserInfoResponse) Validate() error { 192 | if m == nil { 193 | return nil 194 | } 195 | 196 | if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { 197 | if err := v.Validate(); err != nil { 198 | return UserInfoResponseValidationError{ 199 | field: "User", 200 | reason: "embedded message failed validation", 201 | cause: err, 202 | } 203 | } 204 | } 205 | 206 | // no validation rules for Code 207 | 208 | // no validation rules for Message 209 | 210 | return nil 211 | } 212 | 213 | // UserInfoResponseValidationError is the validation error returned by 214 | // UserInfoResponse.Validate if the designated constraints aren't met. 215 | type UserInfoResponseValidationError struct { 216 | field string 217 | reason string 218 | cause error 219 | key bool 220 | } 221 | 222 | // Field function returns field value. 223 | func (e UserInfoResponseValidationError) Field() string { return e.field } 224 | 225 | // Reason function returns reason value. 226 | func (e UserInfoResponseValidationError) Reason() string { return e.reason } 227 | 228 | // Cause function returns cause value. 229 | func (e UserInfoResponseValidationError) Cause() error { return e.cause } 230 | 231 | // Key function returns key value. 232 | func (e UserInfoResponseValidationError) Key() bool { return e.key } 233 | 234 | // ErrorName returns error name. 235 | func (e UserInfoResponseValidationError) ErrorName() string { return "UserInfoResponseValidationError" } 236 | 237 | // Error satisfies the builtin error interface 238 | func (e UserInfoResponseValidationError) Error() string { 239 | cause := "" 240 | if e.cause != nil { 241 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 242 | } 243 | 244 | key := "" 245 | if e.key { 246 | key = "key for " 247 | } 248 | 249 | return fmt.Sprintf( 250 | "invalid %sUserInfoResponse.%s: %s%s", 251 | key, 252 | e.field, 253 | e.reason, 254 | cause) 255 | } 256 | 257 | var _ error = UserInfoResponseValidationError{} 258 | 259 | var _ interface { 260 | Field() string 261 | Reason() string 262 | Key() bool 263 | Cause() error 264 | ErrorName() string 265 | } = UserInfoResponseValidationError{} 266 | 267 | // Validate checks the field values on AddUserInfo with the rules defined in 268 | // the proto definition for this message. If any rules are violated, an error 269 | // is returned. 270 | func (m *AddUserInfo) Validate() error { 271 | if m == nil { 272 | return nil 273 | } 274 | 275 | // no validation rules for Email 276 | 277 | // no validation rules for Password 278 | 279 | // no validation rules for PasswordInvestor 280 | 281 | // no validation rules for Group 282 | 283 | // no validation rules for Name 284 | 285 | // no validation rules for Login 286 | 287 | // no validation rules for Enabled 288 | 289 | // no validation rules for City 290 | 291 | // no validation rules for Phone 292 | 293 | return nil 294 | } 295 | 296 | // AddUserInfoValidationError is the validation error returned by 297 | // AddUserInfo.Validate if the designated constraints aren't met. 298 | type AddUserInfoValidationError struct { 299 | field string 300 | reason string 301 | cause error 302 | key bool 303 | } 304 | 305 | // Field function returns field value. 306 | func (e AddUserInfoValidationError) Field() string { return e.field } 307 | 308 | // Reason function returns reason value. 309 | func (e AddUserInfoValidationError) Reason() string { return e.reason } 310 | 311 | // Cause function returns cause value. 312 | func (e AddUserInfoValidationError) Cause() error { return e.cause } 313 | 314 | // Key function returns key value. 315 | func (e AddUserInfoValidationError) Key() bool { return e.key } 316 | 317 | // ErrorName returns error name. 318 | func (e AddUserInfoValidationError) ErrorName() string { return "AddUserInfoValidationError" } 319 | 320 | // Error satisfies the builtin error interface 321 | func (e AddUserInfoValidationError) Error() string { 322 | cause := "" 323 | if e.cause != nil { 324 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 325 | } 326 | 327 | key := "" 328 | if e.key { 329 | key = "key for " 330 | } 331 | 332 | return fmt.Sprintf( 333 | "invalid %sAddUserInfo.%s: %s%s", 334 | key, 335 | e.field, 336 | e.reason, 337 | cause) 338 | } 339 | 340 | var _ error = AddUserInfoValidationError{} 341 | 342 | var _ interface { 343 | Field() string 344 | Reason() string 345 | Key() bool 346 | Cause() error 347 | ErrorName() string 348 | } = AddUserInfoValidationError{} 349 | 350 | // Validate checks the field values on AddUserRequest with the rules defined in 351 | // the proto definition for this message. If any rules are violated, an error 352 | // is returned. 353 | func (m *AddUserRequest) Validate() error { 354 | if m == nil { 355 | return nil 356 | } 357 | 358 | // no validation rules for Token 359 | 360 | if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { 361 | if err := v.Validate(); err != nil { 362 | return AddUserRequestValidationError{ 363 | field: "User", 364 | reason: "embedded message failed validation", 365 | cause: err, 366 | } 367 | } 368 | } 369 | 370 | if v, ok := interface{}(m.GetUpdateMask()).(interface{ Validate() error }); ok { 371 | if err := v.Validate(); err != nil { 372 | return AddUserRequestValidationError{ 373 | field: "UpdateMask", 374 | reason: "embedded message failed validation", 375 | cause: err, 376 | } 377 | } 378 | } 379 | 380 | return nil 381 | } 382 | 383 | // AddUserRequestValidationError is the validation error returned by 384 | // AddUserRequest.Validate if the designated constraints aren't met. 385 | type AddUserRequestValidationError struct { 386 | field string 387 | reason string 388 | cause error 389 | key bool 390 | } 391 | 392 | // Field function returns field value. 393 | func (e AddUserRequestValidationError) Field() string { return e.field } 394 | 395 | // Reason function returns reason value. 396 | func (e AddUserRequestValidationError) Reason() string { return e.reason } 397 | 398 | // Cause function returns cause value. 399 | func (e AddUserRequestValidationError) Cause() error { return e.cause } 400 | 401 | // Key function returns key value. 402 | func (e AddUserRequestValidationError) Key() bool { return e.key } 403 | 404 | // ErrorName returns error name. 405 | func (e AddUserRequestValidationError) ErrorName() string { return "AddUserRequestValidationError" } 406 | 407 | // Error satisfies the builtin error interface 408 | func (e AddUserRequestValidationError) Error() string { 409 | cause := "" 410 | if e.cause != nil { 411 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 412 | } 413 | 414 | key := "" 415 | if e.key { 416 | key = "key for " 417 | } 418 | 419 | return fmt.Sprintf( 420 | "invalid %sAddUserRequest.%s: %s%s", 421 | key, 422 | e.field, 423 | e.reason, 424 | cause) 425 | } 426 | 427 | var _ error = AddUserRequestValidationError{} 428 | 429 | var _ interface { 430 | Field() string 431 | Reason() string 432 | Key() bool 433 | Cause() error 434 | ErrorName() string 435 | } = AddUserRequestValidationError{} 436 | 437 | // Validate checks the field values on AddUserResponse with the rules defined 438 | // in the proto definition for this message. If any rules are violated, an 439 | // error is returned. 440 | func (m *AddUserResponse) Validate() error { 441 | if m == nil { 442 | return nil 443 | } 444 | 445 | // no validation rules for Login 446 | 447 | // no validation rules for Code 448 | 449 | // no validation rules for Message 450 | 451 | return nil 452 | } 453 | 454 | // AddUserResponseValidationError is the validation error returned by 455 | // AddUserResponse.Validate if the designated constraints aren't met. 456 | type AddUserResponseValidationError struct { 457 | field string 458 | reason string 459 | cause error 460 | key bool 461 | } 462 | 463 | // Field function returns field value. 464 | func (e AddUserResponseValidationError) Field() string { return e.field } 465 | 466 | // Reason function returns reason value. 467 | func (e AddUserResponseValidationError) Reason() string { return e.reason } 468 | 469 | // Cause function returns cause value. 470 | func (e AddUserResponseValidationError) Cause() error { return e.cause } 471 | 472 | // Key function returns key value. 473 | func (e AddUserResponseValidationError) Key() bool { return e.key } 474 | 475 | // ErrorName returns error name. 476 | func (e AddUserResponseValidationError) ErrorName() string { return "AddUserResponseValidationError" } 477 | 478 | // Error satisfies the builtin error interface 479 | func (e AddUserResponseValidationError) Error() string { 480 | cause := "" 481 | if e.cause != nil { 482 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 483 | } 484 | 485 | key := "" 486 | if e.key { 487 | key = "key for " 488 | } 489 | 490 | return fmt.Sprintf( 491 | "invalid %sAddUserResponse.%s: %s%s", 492 | key, 493 | e.field, 494 | e.reason, 495 | cause) 496 | } 497 | 498 | var _ error = AddUserResponseValidationError{} 499 | 500 | var _ interface { 501 | Field() string 502 | Reason() string 503 | Key() bool 504 | Cause() error 505 | ErrorName() string 506 | } = AddUserResponseValidationError{} 507 | 508 | // Validate checks the field values on UpdateUserInfo with the rules defined in 509 | // the proto definition for this message. If any rules are violated, an error 510 | // is returned. 511 | func (m *UpdateUserInfo) Validate() error { 512 | if m == nil { 513 | return nil 514 | } 515 | 516 | // no validation rules for Login 517 | 518 | // no validation rules for Email 519 | 520 | // no validation rules for Name 521 | 522 | // no validation rules for Enabled 523 | 524 | // no validation rules for Password 525 | 526 | // no validation rules for PasswordInvestor 527 | 528 | // no validation rules for Phone 529 | 530 | // no validation rules for City 531 | 532 | // no validation rules for Group 533 | 534 | return nil 535 | } 536 | 537 | // UpdateUserInfoValidationError is the validation error returned by 538 | // UpdateUserInfo.Validate if the designated constraints aren't met. 539 | type UpdateUserInfoValidationError struct { 540 | field string 541 | reason string 542 | cause error 543 | key bool 544 | } 545 | 546 | // Field function returns field value. 547 | func (e UpdateUserInfoValidationError) Field() string { return e.field } 548 | 549 | // Reason function returns reason value. 550 | func (e UpdateUserInfoValidationError) Reason() string { return e.reason } 551 | 552 | // Cause function returns cause value. 553 | func (e UpdateUserInfoValidationError) Cause() error { return e.cause } 554 | 555 | // Key function returns key value. 556 | func (e UpdateUserInfoValidationError) Key() bool { return e.key } 557 | 558 | // ErrorName returns error name. 559 | func (e UpdateUserInfoValidationError) ErrorName() string { return "UpdateUserInfoValidationError" } 560 | 561 | // Error satisfies the builtin error interface 562 | func (e UpdateUserInfoValidationError) Error() string { 563 | cause := "" 564 | if e.cause != nil { 565 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 566 | } 567 | 568 | key := "" 569 | if e.key { 570 | key = "key for " 571 | } 572 | 573 | return fmt.Sprintf( 574 | "invalid %sUpdateUserInfo.%s: %s%s", 575 | key, 576 | e.field, 577 | e.reason, 578 | cause) 579 | } 580 | 581 | var _ error = UpdateUserInfoValidationError{} 582 | 583 | var _ interface { 584 | Field() string 585 | Reason() string 586 | Key() bool 587 | Cause() error 588 | ErrorName() string 589 | } = UpdateUserInfoValidationError{} 590 | 591 | // Validate checks the field values on UpdateUserRequest with the rules defined 592 | // in the proto definition for this message. If any rules are violated, an 593 | // error is returned. 594 | func (m *UpdateUserRequest) Validate() error { 595 | if m == nil { 596 | return nil 597 | } 598 | 599 | // no validation rules for Token 600 | 601 | if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { 602 | if err := v.Validate(); err != nil { 603 | return UpdateUserRequestValidationError{ 604 | field: "User", 605 | reason: "embedded message failed validation", 606 | cause: err, 607 | } 608 | } 609 | } 610 | 611 | if v, ok := interface{}(m.GetUpdateMask()).(interface{ Validate() error }); ok { 612 | if err := v.Validate(); err != nil { 613 | return UpdateUserRequestValidationError{ 614 | field: "UpdateMask", 615 | reason: "embedded message failed validation", 616 | cause: err, 617 | } 618 | } 619 | } 620 | 621 | return nil 622 | } 623 | 624 | // UpdateUserRequestValidationError is the validation error returned by 625 | // UpdateUserRequest.Validate if the designated constraints aren't met. 626 | type UpdateUserRequestValidationError struct { 627 | field string 628 | reason string 629 | cause error 630 | key bool 631 | } 632 | 633 | // Field function returns field value. 634 | func (e UpdateUserRequestValidationError) Field() string { return e.field } 635 | 636 | // Reason function returns reason value. 637 | func (e UpdateUserRequestValidationError) Reason() string { return e.reason } 638 | 639 | // Cause function returns cause value. 640 | func (e UpdateUserRequestValidationError) Cause() error { return e.cause } 641 | 642 | // Key function returns key value. 643 | func (e UpdateUserRequestValidationError) Key() bool { return e.key } 644 | 645 | // ErrorName returns error name. 646 | func (e UpdateUserRequestValidationError) ErrorName() string { 647 | return "UpdateUserRequestValidationError" 648 | } 649 | 650 | // Error satisfies the builtin error interface 651 | func (e UpdateUserRequestValidationError) Error() string { 652 | cause := "" 653 | if e.cause != nil { 654 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 655 | } 656 | 657 | key := "" 658 | if e.key { 659 | key = "key for " 660 | } 661 | 662 | return fmt.Sprintf( 663 | "invalid %sUpdateUserRequest.%s: %s%s", 664 | key, 665 | e.field, 666 | e.reason, 667 | cause) 668 | } 669 | 670 | var _ error = UpdateUserRequestValidationError{} 671 | 672 | var _ interface { 673 | Field() string 674 | Reason() string 675 | Key() bool 676 | Cause() error 677 | ErrorName() string 678 | } = UpdateUserRequestValidationError{} 679 | 680 | // Validate checks the field values on UpdateUserResponse with the rules 681 | // defined in the proto definition for this message. If any rules are 682 | // violated, an error is returned. 683 | func (m *UpdateUserResponse) Validate() error { 684 | if m == nil { 685 | return nil 686 | } 687 | 688 | // no validation rules for Code 689 | 690 | // no validation rules for Message 691 | 692 | return nil 693 | } 694 | 695 | // UpdateUserResponseValidationError is the validation error returned by 696 | // UpdateUserResponse.Validate if the designated constraints aren't met. 697 | type UpdateUserResponseValidationError struct { 698 | field string 699 | reason string 700 | cause error 701 | key bool 702 | } 703 | 704 | // Field function returns field value. 705 | func (e UpdateUserResponseValidationError) Field() string { return e.field } 706 | 707 | // Reason function returns reason value. 708 | func (e UpdateUserResponseValidationError) Reason() string { return e.reason } 709 | 710 | // Cause function returns cause value. 711 | func (e UpdateUserResponseValidationError) Cause() error { return e.cause } 712 | 713 | // Key function returns key value. 714 | func (e UpdateUserResponseValidationError) Key() bool { return e.key } 715 | 716 | // ErrorName returns error name. 717 | func (e UpdateUserResponseValidationError) ErrorName() string { 718 | return "UpdateUserResponseValidationError" 719 | } 720 | 721 | // Error satisfies the builtin error interface 722 | func (e UpdateUserResponseValidationError) Error() string { 723 | cause := "" 724 | if e.cause != nil { 725 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 726 | } 727 | 728 | key := "" 729 | if e.key { 730 | key = "key for " 731 | } 732 | 733 | return fmt.Sprintf( 734 | "invalid %sUpdateUserResponse.%s: %s%s", 735 | key, 736 | e.field, 737 | e.reason, 738 | cause) 739 | } 740 | 741 | var _ error = UpdateUserResponseValidationError{} 742 | 743 | var _ interface { 744 | Field() string 745 | Reason() string 746 | Key() bool 747 | Cause() error 748 | ErrorName() string 749 | } = UpdateUserResponseValidationError{} 750 | 751 | // Validate checks the field values on DeleteUserRequest with the rules defined 752 | // in the proto definition for this message. If any rules are violated, an 753 | // error is returned. 754 | func (m *DeleteUserRequest) Validate() error { 755 | if m == nil { 756 | return nil 757 | } 758 | 759 | // no validation rules for Token 760 | 761 | // no validation rules for Login 762 | 763 | return nil 764 | } 765 | 766 | // DeleteUserRequestValidationError is the validation error returned by 767 | // DeleteUserRequest.Validate if the designated constraints aren't met. 768 | type DeleteUserRequestValidationError struct { 769 | field string 770 | reason string 771 | cause error 772 | key bool 773 | } 774 | 775 | // Field function returns field value. 776 | func (e DeleteUserRequestValidationError) Field() string { return e.field } 777 | 778 | // Reason function returns reason value. 779 | func (e DeleteUserRequestValidationError) Reason() string { return e.reason } 780 | 781 | // Cause function returns cause value. 782 | func (e DeleteUserRequestValidationError) Cause() error { return e.cause } 783 | 784 | // Key function returns key value. 785 | func (e DeleteUserRequestValidationError) Key() bool { return e.key } 786 | 787 | // ErrorName returns error name. 788 | func (e DeleteUserRequestValidationError) ErrorName() string { 789 | return "DeleteUserRequestValidationError" 790 | } 791 | 792 | // Error satisfies the builtin error interface 793 | func (e DeleteUserRequestValidationError) Error() string { 794 | cause := "" 795 | if e.cause != nil { 796 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 797 | } 798 | 799 | key := "" 800 | if e.key { 801 | key = "key for " 802 | } 803 | 804 | return fmt.Sprintf( 805 | "invalid %sDeleteUserRequest.%s: %s%s", 806 | key, 807 | e.field, 808 | e.reason, 809 | cause) 810 | } 811 | 812 | var _ error = DeleteUserRequestValidationError{} 813 | 814 | var _ interface { 815 | Field() string 816 | Reason() string 817 | Key() bool 818 | Cause() error 819 | ErrorName() string 820 | } = DeleteUserRequestValidationError{} 821 | 822 | // Validate checks the field values on DeleteUserResponse with the rules 823 | // defined in the proto definition for this message. If any rules are 824 | // violated, an error is returned. 825 | func (m *DeleteUserResponse) Validate() error { 826 | if m == nil { 827 | return nil 828 | } 829 | 830 | // no validation rules for Code 831 | 832 | // no validation rules for Message 833 | 834 | return nil 835 | } 836 | 837 | // DeleteUserResponseValidationError is the validation error returned by 838 | // DeleteUserResponse.Validate if the designated constraints aren't met. 839 | type DeleteUserResponseValidationError struct { 840 | field string 841 | reason string 842 | cause error 843 | key bool 844 | } 845 | 846 | // Field function returns field value. 847 | func (e DeleteUserResponseValidationError) Field() string { return e.field } 848 | 849 | // Reason function returns reason value. 850 | func (e DeleteUserResponseValidationError) Reason() string { return e.reason } 851 | 852 | // Cause function returns cause value. 853 | func (e DeleteUserResponseValidationError) Cause() error { return e.cause } 854 | 855 | // Key function returns key value. 856 | func (e DeleteUserResponseValidationError) Key() bool { return e.key } 857 | 858 | // ErrorName returns error name. 859 | func (e DeleteUserResponseValidationError) ErrorName() string { 860 | return "DeleteUserResponseValidationError" 861 | } 862 | 863 | // Error satisfies the builtin error interface 864 | func (e DeleteUserResponseValidationError) Error() string { 865 | cause := "" 866 | if e.cause != nil { 867 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 868 | } 869 | 870 | key := "" 871 | if e.key { 872 | key = "key for " 873 | } 874 | 875 | return fmt.Sprintf( 876 | "invalid %sDeleteUserResponse.%s: %s%s", 877 | key, 878 | e.field, 879 | e.reason, 880 | cause) 881 | } 882 | 883 | var _ error = DeleteUserResponseValidationError{} 884 | 885 | var _ interface { 886 | Field() string 887 | Reason() string 888 | Key() bool 889 | Cause() error 890 | ErrorName() string 891 | } = DeleteUserResponseValidationError{} 892 | 893 | // Validate checks the field values on ResetPasswordInfo with the rules defined 894 | // in the proto definition for this message. If any rules are violated, an 895 | // error is returned. 896 | func (m *ResetPasswordInfo) Validate() error { 897 | if m == nil { 898 | return nil 899 | } 900 | 901 | // no validation rules for Login 902 | 903 | // no validation rules for Password 904 | 905 | // no validation rules for PasswordInvestor 906 | 907 | return nil 908 | } 909 | 910 | // ResetPasswordInfoValidationError is the validation error returned by 911 | // ResetPasswordInfo.Validate if the designated constraints aren't met. 912 | type ResetPasswordInfoValidationError struct { 913 | field string 914 | reason string 915 | cause error 916 | key bool 917 | } 918 | 919 | // Field function returns field value. 920 | func (e ResetPasswordInfoValidationError) Field() string { return e.field } 921 | 922 | // Reason function returns reason value. 923 | func (e ResetPasswordInfoValidationError) Reason() string { return e.reason } 924 | 925 | // Cause function returns cause value. 926 | func (e ResetPasswordInfoValidationError) Cause() error { return e.cause } 927 | 928 | // Key function returns key value. 929 | func (e ResetPasswordInfoValidationError) Key() bool { return e.key } 930 | 931 | // ErrorName returns error name. 932 | func (e ResetPasswordInfoValidationError) ErrorName() string { 933 | return "ResetPasswordInfoValidationError" 934 | } 935 | 936 | // Error satisfies the builtin error interface 937 | func (e ResetPasswordInfoValidationError) Error() string { 938 | cause := "" 939 | if e.cause != nil { 940 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 941 | } 942 | 943 | key := "" 944 | if e.key { 945 | key = "key for " 946 | } 947 | 948 | return fmt.Sprintf( 949 | "invalid %sResetPasswordInfo.%s: %s%s", 950 | key, 951 | e.field, 952 | e.reason, 953 | cause) 954 | } 955 | 956 | var _ error = ResetPasswordInfoValidationError{} 957 | 958 | var _ interface { 959 | Field() string 960 | Reason() string 961 | Key() bool 962 | Cause() error 963 | ErrorName() string 964 | } = ResetPasswordInfoValidationError{} 965 | 966 | // Validate checks the field values on ResetPasswordRequest with the rules 967 | // defined in the proto definition for this message. If any rules are 968 | // violated, an error is returned. 969 | func (m *ResetPasswordRequest) Validate() error { 970 | if m == nil { 971 | return nil 972 | } 973 | 974 | // no validation rules for Token 975 | 976 | if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { 977 | if err := v.Validate(); err != nil { 978 | return ResetPasswordRequestValidationError{ 979 | field: "User", 980 | reason: "embedded message failed validation", 981 | cause: err, 982 | } 983 | } 984 | } 985 | 986 | if v, ok := interface{}(m.GetUpdateMask()).(interface{ Validate() error }); ok { 987 | if err := v.Validate(); err != nil { 988 | return ResetPasswordRequestValidationError{ 989 | field: "UpdateMask", 990 | reason: "embedded message failed validation", 991 | cause: err, 992 | } 993 | } 994 | } 995 | 996 | return nil 997 | } 998 | 999 | // ResetPasswordRequestValidationError is the validation error returned by 1000 | // ResetPasswordRequest.Validate if the designated constraints aren't met. 1001 | type ResetPasswordRequestValidationError struct { 1002 | field string 1003 | reason string 1004 | cause error 1005 | key bool 1006 | } 1007 | 1008 | // Field function returns field value. 1009 | func (e ResetPasswordRequestValidationError) Field() string { return e.field } 1010 | 1011 | // Reason function returns reason value. 1012 | func (e ResetPasswordRequestValidationError) Reason() string { return e.reason } 1013 | 1014 | // Cause function returns cause value. 1015 | func (e ResetPasswordRequestValidationError) Cause() error { return e.cause } 1016 | 1017 | // Key function returns key value. 1018 | func (e ResetPasswordRequestValidationError) Key() bool { return e.key } 1019 | 1020 | // ErrorName returns error name. 1021 | func (e ResetPasswordRequestValidationError) ErrorName() string { 1022 | return "ResetPasswordRequestValidationError" 1023 | } 1024 | 1025 | // Error satisfies the builtin error interface 1026 | func (e ResetPasswordRequestValidationError) Error() string { 1027 | cause := "" 1028 | if e.cause != nil { 1029 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1030 | } 1031 | 1032 | key := "" 1033 | if e.key { 1034 | key = "key for " 1035 | } 1036 | 1037 | return fmt.Sprintf( 1038 | "invalid %sResetPasswordRequest.%s: %s%s", 1039 | key, 1040 | e.field, 1041 | e.reason, 1042 | cause) 1043 | } 1044 | 1045 | var _ error = ResetPasswordRequestValidationError{} 1046 | 1047 | var _ interface { 1048 | Field() string 1049 | Reason() string 1050 | Key() bool 1051 | Cause() error 1052 | ErrorName() string 1053 | } = ResetPasswordRequestValidationError{} 1054 | 1055 | // Validate checks the field values on ResetPasswordResponse with the rules 1056 | // defined in the proto definition for this message. If any rules are 1057 | // violated, an error is returned. 1058 | func (m *ResetPasswordResponse) Validate() error { 1059 | if m == nil { 1060 | return nil 1061 | } 1062 | 1063 | // no validation rules for Code 1064 | 1065 | // no validation rules for Message 1066 | 1067 | return nil 1068 | } 1069 | 1070 | // ResetPasswordResponseValidationError is the validation error returned by 1071 | // ResetPasswordResponse.Validate if the designated constraints aren't met. 1072 | type ResetPasswordResponseValidationError struct { 1073 | field string 1074 | reason string 1075 | cause error 1076 | key bool 1077 | } 1078 | 1079 | // Field function returns field value. 1080 | func (e ResetPasswordResponseValidationError) Field() string { return e.field } 1081 | 1082 | // Reason function returns reason value. 1083 | func (e ResetPasswordResponseValidationError) Reason() string { return e.reason } 1084 | 1085 | // Cause function returns cause value. 1086 | func (e ResetPasswordResponseValidationError) Cause() error { return e.cause } 1087 | 1088 | // Key function returns key value. 1089 | func (e ResetPasswordResponseValidationError) Key() bool { return e.key } 1090 | 1091 | // ErrorName returns error name. 1092 | func (e ResetPasswordResponseValidationError) ErrorName() string { 1093 | return "ResetPasswordResponseValidationError" 1094 | } 1095 | 1096 | // Error satisfies the builtin error interface 1097 | func (e ResetPasswordResponseValidationError) Error() string { 1098 | cause := "" 1099 | if e.cause != nil { 1100 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1101 | } 1102 | 1103 | key := "" 1104 | if e.key { 1105 | key = "key for " 1106 | } 1107 | 1108 | return fmt.Sprintf( 1109 | "invalid %sResetPasswordResponse.%s: %s%s", 1110 | key, 1111 | e.field, 1112 | e.reason, 1113 | cause) 1114 | } 1115 | 1116 | var _ error = ResetPasswordResponseValidationError{} 1117 | 1118 | var _ interface { 1119 | Field() string 1120 | Reason() string 1121 | Key() bool 1122 | Cause() error 1123 | ErrorName() string 1124 | } = ResetPasswordResponseValidationError{} 1125 | 1126 | // Validate checks the field values on FundsInfo with the rules defined in the 1127 | // proto definition for this message. If any rules are violated, an error is returned. 1128 | func (m *FundsInfo) Validate() error { 1129 | if m == nil { 1130 | return nil 1131 | } 1132 | 1133 | // no validation rules for Login 1134 | 1135 | // no validation rules for Amount 1136 | 1137 | // no validation rules for IsCredit 1138 | 1139 | // no validation rules for Comment 1140 | 1141 | return nil 1142 | } 1143 | 1144 | // FundsInfoValidationError is the validation error returned by 1145 | // FundsInfo.Validate if the designated constraints aren't met. 1146 | type FundsInfoValidationError struct { 1147 | field string 1148 | reason string 1149 | cause error 1150 | key bool 1151 | } 1152 | 1153 | // Field function returns field value. 1154 | func (e FundsInfoValidationError) Field() string { return e.field } 1155 | 1156 | // Reason function returns reason value. 1157 | func (e FundsInfoValidationError) Reason() string { return e.reason } 1158 | 1159 | // Cause function returns cause value. 1160 | func (e FundsInfoValidationError) Cause() error { return e.cause } 1161 | 1162 | // Key function returns key value. 1163 | func (e FundsInfoValidationError) Key() bool { return e.key } 1164 | 1165 | // ErrorName returns error name. 1166 | func (e FundsInfoValidationError) ErrorName() string { return "FundsInfoValidationError" } 1167 | 1168 | // Error satisfies the builtin error interface 1169 | func (e FundsInfoValidationError) Error() string { 1170 | cause := "" 1171 | if e.cause != nil { 1172 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1173 | } 1174 | 1175 | key := "" 1176 | if e.key { 1177 | key = "key for " 1178 | } 1179 | 1180 | return fmt.Sprintf( 1181 | "invalid %sFundsInfo.%s: %s%s", 1182 | key, 1183 | e.field, 1184 | e.reason, 1185 | cause) 1186 | } 1187 | 1188 | var _ error = FundsInfoValidationError{} 1189 | 1190 | var _ interface { 1191 | Field() string 1192 | Reason() string 1193 | Key() bool 1194 | Cause() error 1195 | ErrorName() string 1196 | } = FundsInfoValidationError{} 1197 | 1198 | // Validate checks the field values on FundsRequest with the rules defined in 1199 | // the proto definition for this message. If any rules are violated, an error 1200 | // is returned. 1201 | func (m *FundsRequest) Validate() error { 1202 | if m == nil { 1203 | return nil 1204 | } 1205 | 1206 | // no validation rules for Token 1207 | 1208 | if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { 1209 | if err := v.Validate(); err != nil { 1210 | return FundsRequestValidationError{ 1211 | field: "User", 1212 | reason: "embedded message failed validation", 1213 | cause: err, 1214 | } 1215 | } 1216 | } 1217 | 1218 | if v, ok := interface{}(m.GetUpdateMask()).(interface{ Validate() error }); ok { 1219 | if err := v.Validate(); err != nil { 1220 | return FundsRequestValidationError{ 1221 | field: "UpdateMask", 1222 | reason: "embedded message failed validation", 1223 | cause: err, 1224 | } 1225 | } 1226 | } 1227 | 1228 | return nil 1229 | } 1230 | 1231 | // FundsRequestValidationError is the validation error returned by 1232 | // FundsRequest.Validate if the designated constraints aren't met. 1233 | type FundsRequestValidationError struct { 1234 | field string 1235 | reason string 1236 | cause error 1237 | key bool 1238 | } 1239 | 1240 | // Field function returns field value. 1241 | func (e FundsRequestValidationError) Field() string { return e.field } 1242 | 1243 | // Reason function returns reason value. 1244 | func (e FundsRequestValidationError) Reason() string { return e.reason } 1245 | 1246 | // Cause function returns cause value. 1247 | func (e FundsRequestValidationError) Cause() error { return e.cause } 1248 | 1249 | // Key function returns key value. 1250 | func (e FundsRequestValidationError) Key() bool { return e.key } 1251 | 1252 | // ErrorName returns error name. 1253 | func (e FundsRequestValidationError) ErrorName() string { return "FundsRequestValidationError" } 1254 | 1255 | // Error satisfies the builtin error interface 1256 | func (e FundsRequestValidationError) Error() string { 1257 | cause := "" 1258 | if e.cause != nil { 1259 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1260 | } 1261 | 1262 | key := "" 1263 | if e.key { 1264 | key = "key for " 1265 | } 1266 | 1267 | return fmt.Sprintf( 1268 | "invalid %sFundsRequest.%s: %s%s", 1269 | key, 1270 | e.field, 1271 | e.reason, 1272 | cause) 1273 | } 1274 | 1275 | var _ error = FundsRequestValidationError{} 1276 | 1277 | var _ interface { 1278 | Field() string 1279 | Reason() string 1280 | Key() bool 1281 | Cause() error 1282 | ErrorName() string 1283 | } = FundsRequestValidationError{} 1284 | 1285 | // Validate checks the field values on FundsResponse with the rules defined in 1286 | // the proto definition for this message. If any rules are violated, an error 1287 | // is returned. 1288 | func (m *FundsResponse) Validate() error { 1289 | if m == nil { 1290 | return nil 1291 | } 1292 | 1293 | // no validation rules for Balance 1294 | 1295 | // no validation rules for Credit 1296 | 1297 | return nil 1298 | } 1299 | 1300 | // FundsResponseValidationError is the validation error returned by 1301 | // FundsResponse.Validate if the designated constraints aren't met. 1302 | type FundsResponseValidationError struct { 1303 | field string 1304 | reason string 1305 | cause error 1306 | key bool 1307 | } 1308 | 1309 | // Field function returns field value. 1310 | func (e FundsResponseValidationError) Field() string { return e.field } 1311 | 1312 | // Reason function returns reason value. 1313 | func (e FundsResponseValidationError) Reason() string { return e.reason } 1314 | 1315 | // Cause function returns cause value. 1316 | func (e FundsResponseValidationError) Cause() error { return e.cause } 1317 | 1318 | // Key function returns key value. 1319 | func (e FundsResponseValidationError) Key() bool { return e.key } 1320 | 1321 | // ErrorName returns error name. 1322 | func (e FundsResponseValidationError) ErrorName() string { return "FundsResponseValidationError" } 1323 | 1324 | // Error satisfies the builtin error interface 1325 | func (e FundsResponseValidationError) Error() string { 1326 | cause := "" 1327 | if e.cause != nil { 1328 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1329 | } 1330 | 1331 | key := "" 1332 | if e.key { 1333 | key = "key for " 1334 | } 1335 | 1336 | return fmt.Sprintf( 1337 | "invalid %sFundsResponse.%s: %s%s", 1338 | key, 1339 | e.field, 1340 | e.reason, 1341 | cause) 1342 | } 1343 | 1344 | var _ error = FundsResponseValidationError{} 1345 | 1346 | var _ interface { 1347 | Field() string 1348 | Reason() string 1349 | Key() bool 1350 | Cause() error 1351 | ErrorName() string 1352 | } = FundsResponseValidationError{} 1353 | 1354 | // Validate checks the field values on TradeInfo with the rules defined in the 1355 | // proto definition for this message. If any rules are violated, an error is returned. 1356 | func (m *TradeInfo) Validate() error { 1357 | if m == nil { 1358 | return nil 1359 | } 1360 | 1361 | // no validation rules for Ticket 1362 | 1363 | // no validation rules for Login 1364 | 1365 | // no validation rules for Symbol 1366 | 1367 | // no validation rules for Digits 1368 | 1369 | // no validation rules for Cmd 1370 | 1371 | // no validation rules for Volume 1372 | 1373 | // no validation rules for OpenTime 1374 | 1375 | // no validation rules for State 1376 | 1377 | // no validation rules for OpenPrice 1378 | 1379 | // no validation rules for Sl 1380 | 1381 | // no validation rules for Tp 1382 | 1383 | // no validation rules for CloseTime 1384 | 1385 | // no validation rules for Expiration 1386 | 1387 | // no validation rules for Commission 1388 | 1389 | // no validation rules for ClosePrice 1390 | 1391 | // no validation rules for Profit 1392 | 1393 | // no validation rules for Magic 1394 | 1395 | // no validation rules for Comment 1396 | 1397 | return nil 1398 | } 1399 | 1400 | // TradeInfoValidationError is the validation error returned by 1401 | // TradeInfo.Validate if the designated constraints aren't met. 1402 | type TradeInfoValidationError struct { 1403 | field string 1404 | reason string 1405 | cause error 1406 | key bool 1407 | } 1408 | 1409 | // Field function returns field value. 1410 | func (e TradeInfoValidationError) Field() string { return e.field } 1411 | 1412 | // Reason function returns reason value. 1413 | func (e TradeInfoValidationError) Reason() string { return e.reason } 1414 | 1415 | // Cause function returns cause value. 1416 | func (e TradeInfoValidationError) Cause() error { return e.cause } 1417 | 1418 | // Key function returns key value. 1419 | func (e TradeInfoValidationError) Key() bool { return e.key } 1420 | 1421 | // ErrorName returns error name. 1422 | func (e TradeInfoValidationError) ErrorName() string { return "TradeInfoValidationError" } 1423 | 1424 | // Error satisfies the builtin error interface 1425 | func (e TradeInfoValidationError) Error() string { 1426 | cause := "" 1427 | if e.cause != nil { 1428 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1429 | } 1430 | 1431 | key := "" 1432 | if e.key { 1433 | key = "key for " 1434 | } 1435 | 1436 | return fmt.Sprintf( 1437 | "invalid %sTradeInfo.%s: %s%s", 1438 | key, 1439 | e.field, 1440 | e.reason, 1441 | cause) 1442 | } 1443 | 1444 | var _ error = TradeInfoValidationError{} 1445 | 1446 | var _ interface { 1447 | Field() string 1448 | Reason() string 1449 | Key() bool 1450 | Cause() error 1451 | ErrorName() string 1452 | } = TradeInfoValidationError{} 1453 | 1454 | // Validate checks the field values on OpenTradeRequest with the rules defined 1455 | // in the proto definition for this message. If any rules are violated, an 1456 | // error is returned. 1457 | func (m *OpenTradeRequest) Validate() error { 1458 | if m == nil { 1459 | return nil 1460 | } 1461 | 1462 | // no validation rules for Login 1463 | 1464 | // no validation rules for Symbol 1465 | 1466 | // no validation rules for Cmd 1467 | 1468 | // no validation rules for Price 1469 | 1470 | // no validation rules for Slippage 1471 | 1472 | // no validation rules for Sl 1473 | 1474 | // no validation rules for Tp 1475 | 1476 | // no validation rules for Volume 1477 | 1478 | // no validation rules for Comment 1479 | 1480 | return nil 1481 | } 1482 | 1483 | // OpenTradeRequestValidationError is the validation error returned by 1484 | // OpenTradeRequest.Validate if the designated constraints aren't met. 1485 | type OpenTradeRequestValidationError struct { 1486 | field string 1487 | reason string 1488 | cause error 1489 | key bool 1490 | } 1491 | 1492 | // Field function returns field value. 1493 | func (e OpenTradeRequestValidationError) Field() string { return e.field } 1494 | 1495 | // Reason function returns reason value. 1496 | func (e OpenTradeRequestValidationError) Reason() string { return e.reason } 1497 | 1498 | // Cause function returns cause value. 1499 | func (e OpenTradeRequestValidationError) Cause() error { return e.cause } 1500 | 1501 | // Key function returns key value. 1502 | func (e OpenTradeRequestValidationError) Key() bool { return e.key } 1503 | 1504 | // ErrorName returns error name. 1505 | func (e OpenTradeRequestValidationError) ErrorName() string { return "OpenTradeRequestValidationError" } 1506 | 1507 | // Error satisfies the builtin error interface 1508 | func (e OpenTradeRequestValidationError) Error() string { 1509 | cause := "" 1510 | if e.cause != nil { 1511 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1512 | } 1513 | 1514 | key := "" 1515 | if e.key { 1516 | key = "key for " 1517 | } 1518 | 1519 | return fmt.Sprintf( 1520 | "invalid %sOpenTradeRequest.%s: %s%s", 1521 | key, 1522 | e.field, 1523 | e.reason, 1524 | cause) 1525 | } 1526 | 1527 | var _ error = OpenTradeRequestValidationError{} 1528 | 1529 | var _ interface { 1530 | Field() string 1531 | Reason() string 1532 | Key() bool 1533 | Cause() error 1534 | ErrorName() string 1535 | } = OpenTradeRequestValidationError{} 1536 | 1537 | // Validate checks the field values on OpenTradeResponse with the rules defined 1538 | // in the proto definition for this message. If any rules are violated, an 1539 | // error is returned. 1540 | func (m *OpenTradeResponse) Validate() error { 1541 | if m == nil { 1542 | return nil 1543 | } 1544 | 1545 | // no validation rules for Ticket 1546 | 1547 | // no validation rules for ErrorCode 1548 | 1549 | // no validation rules for Message 1550 | 1551 | return nil 1552 | } 1553 | 1554 | // OpenTradeResponseValidationError is the validation error returned by 1555 | // OpenTradeResponse.Validate if the designated constraints aren't met. 1556 | type OpenTradeResponseValidationError struct { 1557 | field string 1558 | reason string 1559 | cause error 1560 | key bool 1561 | } 1562 | 1563 | // Field function returns field value. 1564 | func (e OpenTradeResponseValidationError) Field() string { return e.field } 1565 | 1566 | // Reason function returns reason value. 1567 | func (e OpenTradeResponseValidationError) Reason() string { return e.reason } 1568 | 1569 | // Cause function returns cause value. 1570 | func (e OpenTradeResponseValidationError) Cause() error { return e.cause } 1571 | 1572 | // Key function returns key value. 1573 | func (e OpenTradeResponseValidationError) Key() bool { return e.key } 1574 | 1575 | // ErrorName returns error name. 1576 | func (e OpenTradeResponseValidationError) ErrorName() string { 1577 | return "OpenTradeResponseValidationError" 1578 | } 1579 | 1580 | // Error satisfies the builtin error interface 1581 | func (e OpenTradeResponseValidationError) Error() string { 1582 | cause := "" 1583 | if e.cause != nil { 1584 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1585 | } 1586 | 1587 | key := "" 1588 | if e.key { 1589 | key = "key for " 1590 | } 1591 | 1592 | return fmt.Sprintf( 1593 | "invalid %sOpenTradeResponse.%s: %s%s", 1594 | key, 1595 | e.field, 1596 | e.reason, 1597 | cause) 1598 | } 1599 | 1600 | var _ error = OpenTradeResponseValidationError{} 1601 | 1602 | var _ interface { 1603 | Field() string 1604 | Reason() string 1605 | Key() bool 1606 | Cause() error 1607 | ErrorName() string 1608 | } = OpenTradeResponseValidationError{} 1609 | 1610 | // Validate checks the field values on UpdateTradeRequest with the rules 1611 | // defined in the proto definition for this message. If any rules are 1612 | // violated, an error is returned. 1613 | func (m *UpdateTradeRequest) Validate() error { 1614 | if m == nil { 1615 | return nil 1616 | } 1617 | 1618 | // no validation rules for Ticket 1619 | 1620 | // no validation rules for Price 1621 | 1622 | // no validation rules for Sl 1623 | 1624 | // no validation rules for Tp 1625 | 1626 | return nil 1627 | } 1628 | 1629 | // UpdateTradeRequestValidationError is the validation error returned by 1630 | // UpdateTradeRequest.Validate if the designated constraints aren't met. 1631 | type UpdateTradeRequestValidationError struct { 1632 | field string 1633 | reason string 1634 | cause error 1635 | key bool 1636 | } 1637 | 1638 | // Field function returns field value. 1639 | func (e UpdateTradeRequestValidationError) Field() string { return e.field } 1640 | 1641 | // Reason function returns reason value. 1642 | func (e UpdateTradeRequestValidationError) Reason() string { return e.reason } 1643 | 1644 | // Cause function returns cause value. 1645 | func (e UpdateTradeRequestValidationError) Cause() error { return e.cause } 1646 | 1647 | // Key function returns key value. 1648 | func (e UpdateTradeRequestValidationError) Key() bool { return e.key } 1649 | 1650 | // ErrorName returns error name. 1651 | func (e UpdateTradeRequestValidationError) ErrorName() string { 1652 | return "UpdateTradeRequestValidationError" 1653 | } 1654 | 1655 | // Error satisfies the builtin error interface 1656 | func (e UpdateTradeRequestValidationError) Error() string { 1657 | cause := "" 1658 | if e.cause != nil { 1659 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1660 | } 1661 | 1662 | key := "" 1663 | if e.key { 1664 | key = "key for " 1665 | } 1666 | 1667 | return fmt.Sprintf( 1668 | "invalid %sUpdateTradeRequest.%s: %s%s", 1669 | key, 1670 | e.field, 1671 | e.reason, 1672 | cause) 1673 | } 1674 | 1675 | var _ error = UpdateTradeRequestValidationError{} 1676 | 1677 | var _ interface { 1678 | Field() string 1679 | Reason() string 1680 | Key() bool 1681 | Cause() error 1682 | ErrorName() string 1683 | } = UpdateTradeRequestValidationError{} 1684 | 1685 | // Validate checks the field values on UpdateTradeResponse with the rules 1686 | // defined in the proto definition for this message. If any rules are 1687 | // violated, an error is returned. 1688 | func (m *UpdateTradeResponse) Validate() error { 1689 | if m == nil { 1690 | return nil 1691 | } 1692 | 1693 | // no validation rules for ErrorCode 1694 | 1695 | // no validation rules for Message 1696 | 1697 | return nil 1698 | } 1699 | 1700 | // UpdateTradeResponseValidationError is the validation error returned by 1701 | // UpdateTradeResponse.Validate if the designated constraints aren't met. 1702 | type UpdateTradeResponseValidationError struct { 1703 | field string 1704 | reason string 1705 | cause error 1706 | key bool 1707 | } 1708 | 1709 | // Field function returns field value. 1710 | func (e UpdateTradeResponseValidationError) Field() string { return e.field } 1711 | 1712 | // Reason function returns reason value. 1713 | func (e UpdateTradeResponseValidationError) Reason() string { return e.reason } 1714 | 1715 | // Cause function returns cause value. 1716 | func (e UpdateTradeResponseValidationError) Cause() error { return e.cause } 1717 | 1718 | // Key function returns key value. 1719 | func (e UpdateTradeResponseValidationError) Key() bool { return e.key } 1720 | 1721 | // ErrorName returns error name. 1722 | func (e UpdateTradeResponseValidationError) ErrorName() string { 1723 | return "UpdateTradeResponseValidationError" 1724 | } 1725 | 1726 | // Error satisfies the builtin error interface 1727 | func (e UpdateTradeResponseValidationError) Error() string { 1728 | cause := "" 1729 | if e.cause != nil { 1730 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1731 | } 1732 | 1733 | key := "" 1734 | if e.key { 1735 | key = "key for " 1736 | } 1737 | 1738 | return fmt.Sprintf( 1739 | "invalid %sUpdateTradeResponse.%s: %s%s", 1740 | key, 1741 | e.field, 1742 | e.reason, 1743 | cause) 1744 | } 1745 | 1746 | var _ error = UpdateTradeResponseValidationError{} 1747 | 1748 | var _ interface { 1749 | Field() string 1750 | Reason() string 1751 | Key() bool 1752 | Cause() error 1753 | ErrorName() string 1754 | } = UpdateTradeResponseValidationError{} 1755 | 1756 | // Validate checks the field values on CloseTradeRequest with the rules defined 1757 | // in the proto definition for this message. If any rules are violated, an 1758 | // error is returned. 1759 | func (m *CloseTradeRequest) Validate() error { 1760 | if m == nil { 1761 | return nil 1762 | } 1763 | 1764 | // no validation rules for Ticket 1765 | 1766 | // no validation rules for Volume 1767 | 1768 | return nil 1769 | } 1770 | 1771 | // CloseTradeRequestValidationError is the validation error returned by 1772 | // CloseTradeRequest.Validate if the designated constraints aren't met. 1773 | type CloseTradeRequestValidationError struct { 1774 | field string 1775 | reason string 1776 | cause error 1777 | key bool 1778 | } 1779 | 1780 | // Field function returns field value. 1781 | func (e CloseTradeRequestValidationError) Field() string { return e.field } 1782 | 1783 | // Reason function returns reason value. 1784 | func (e CloseTradeRequestValidationError) Reason() string { return e.reason } 1785 | 1786 | // Cause function returns cause value. 1787 | func (e CloseTradeRequestValidationError) Cause() error { return e.cause } 1788 | 1789 | // Key function returns key value. 1790 | func (e CloseTradeRequestValidationError) Key() bool { return e.key } 1791 | 1792 | // ErrorName returns error name. 1793 | func (e CloseTradeRequestValidationError) ErrorName() string { 1794 | return "CloseTradeRequestValidationError" 1795 | } 1796 | 1797 | // Error satisfies the builtin error interface 1798 | func (e CloseTradeRequestValidationError) Error() string { 1799 | cause := "" 1800 | if e.cause != nil { 1801 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1802 | } 1803 | 1804 | key := "" 1805 | if e.key { 1806 | key = "key for " 1807 | } 1808 | 1809 | return fmt.Sprintf( 1810 | "invalid %sCloseTradeRequest.%s: %s%s", 1811 | key, 1812 | e.field, 1813 | e.reason, 1814 | cause) 1815 | } 1816 | 1817 | var _ error = CloseTradeRequestValidationError{} 1818 | 1819 | var _ interface { 1820 | Field() string 1821 | Reason() string 1822 | Key() bool 1823 | Cause() error 1824 | ErrorName() string 1825 | } = CloseTradeRequestValidationError{} 1826 | 1827 | // Validate checks the field values on CloseTradeResponse with the rules 1828 | // defined in the proto definition for this message. If any rules are 1829 | // violated, an error is returned. 1830 | func (m *CloseTradeResponse) Validate() error { 1831 | if m == nil { 1832 | return nil 1833 | } 1834 | 1835 | // no validation rules for ErrorCode 1836 | 1837 | // no validation rules for Message 1838 | 1839 | return nil 1840 | } 1841 | 1842 | // CloseTradeResponseValidationError is the validation error returned by 1843 | // CloseTradeResponse.Validate if the designated constraints aren't met. 1844 | type CloseTradeResponseValidationError struct { 1845 | field string 1846 | reason string 1847 | cause error 1848 | key bool 1849 | } 1850 | 1851 | // Field function returns field value. 1852 | func (e CloseTradeResponseValidationError) Field() string { return e.field } 1853 | 1854 | // Reason function returns reason value. 1855 | func (e CloseTradeResponseValidationError) Reason() string { return e.reason } 1856 | 1857 | // Cause function returns cause value. 1858 | func (e CloseTradeResponseValidationError) Cause() error { return e.cause } 1859 | 1860 | // Key function returns key value. 1861 | func (e CloseTradeResponseValidationError) Key() bool { return e.key } 1862 | 1863 | // ErrorName returns error name. 1864 | func (e CloseTradeResponseValidationError) ErrorName() string { 1865 | return "CloseTradeResponseValidationError" 1866 | } 1867 | 1868 | // Error satisfies the builtin error interface 1869 | func (e CloseTradeResponseValidationError) Error() string { 1870 | cause := "" 1871 | if e.cause != nil { 1872 | cause = fmt.Sprintf(" | caused by: %v", e.cause) 1873 | } 1874 | 1875 | key := "" 1876 | if e.key { 1877 | key = "key for " 1878 | } 1879 | 1880 | return fmt.Sprintf( 1881 | "invalid %sCloseTradeResponse.%s: %s%s", 1882 | key, 1883 | e.field, 1884 | e.reason, 1885 | cause) 1886 | } 1887 | 1888 | var _ error = CloseTradeResponseValidationError{} 1889 | 1890 | var _ interface { 1891 | Field() string 1892 | Reason() string 1893 | Key() bool 1894 | Cause() error 1895 | ErrorName() string 1896 | } = CloseTradeResponseValidationError{} 1897 | -------------------------------------------------------------------------------- /api_pb/api.pb.gw.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 | // source: api.proto 3 | 4 | /* 5 | Package api_pb is a reverse proxy. 6 | 7 | It translates gRPC into RESTful JSON APIs. 8 | */ 9 | package api_pb 10 | 11 | import ( 12 | "context" 13 | "io" 14 | "net/http" 15 | 16 | "github.com/golang/protobuf/descriptor" 17 | "github.com/golang/protobuf/proto" 18 | "github.com/grpc-ecosystem/grpc-gateway/runtime" 19 | "github.com/grpc-ecosystem/grpc-gateway/utilities" 20 | "google.golang.org/grpc" 21 | "google.golang.org/grpc/codes" 22 | "google.golang.org/grpc/grpclog" 23 | "google.golang.org/grpc/status" 24 | ) 25 | 26 | // Suppress "imported and not used" errors 27 | var _ codes.Code 28 | var _ io.Reader 29 | var _ status.Status 30 | var _ = runtime.String 31 | var _ = utilities.NewDoubleArray 32 | var _ = descriptor.ForMessage 33 | 34 | var ( 35 | filter_UserService_GetInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{"login": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 36 | ) 37 | 38 | func request_UserService_GetInfo_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 39 | var protoReq UserInfoRequest 40 | var metadata runtime.ServerMetadata 41 | 42 | var ( 43 | val string 44 | ok bool 45 | err error 46 | _ = err 47 | ) 48 | 49 | val, ok = pathParams["login"] 50 | if !ok { 51 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "login") 52 | } 53 | 54 | protoReq.Login, err = runtime.Int32(val) 55 | 56 | if err != nil { 57 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "login", err) 58 | } 59 | 60 | if err := req.ParseForm(); err != nil { 61 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 62 | } 63 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetInfo_0); err != nil { 64 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 65 | } 66 | 67 | msg, err := client.GetInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 68 | return msg, metadata, err 69 | 70 | } 71 | 72 | func local_request_UserService_GetInfo_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 73 | var protoReq UserInfoRequest 74 | var metadata runtime.ServerMetadata 75 | 76 | var ( 77 | val string 78 | ok bool 79 | err error 80 | _ = err 81 | ) 82 | 83 | val, ok = pathParams["login"] 84 | if !ok { 85 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "login") 86 | } 87 | 88 | protoReq.Login, err = runtime.Int32(val) 89 | 90 | if err != nil { 91 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "login", err) 92 | } 93 | 94 | if err := req.ParseForm(); err != nil { 95 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 96 | } 97 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetInfo_0); err != nil { 98 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 99 | } 100 | 101 | msg, err := server.GetInfo(ctx, &protoReq) 102 | return msg, metadata, err 103 | 104 | } 105 | 106 | func request_UserService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 107 | var protoReq DeleteUserRequest 108 | var metadata runtime.ServerMetadata 109 | 110 | var ( 111 | val string 112 | ok bool 113 | err error 114 | _ = err 115 | ) 116 | 117 | val, ok = pathParams["token"] 118 | if !ok { 119 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 120 | } 121 | 122 | protoReq.Token, err = runtime.String(val) 123 | 124 | if err != nil { 125 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 126 | } 127 | 128 | val, ok = pathParams["login"] 129 | if !ok { 130 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "login") 131 | } 132 | 133 | protoReq.Login, err = runtime.Int32(val) 134 | 135 | if err != nil { 136 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "login", err) 137 | } 138 | 139 | msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 140 | return msg, metadata, err 141 | 142 | } 143 | 144 | func local_request_UserService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 145 | var protoReq DeleteUserRequest 146 | var metadata runtime.ServerMetadata 147 | 148 | var ( 149 | val string 150 | ok bool 151 | err error 152 | _ = err 153 | ) 154 | 155 | val, ok = pathParams["token"] 156 | if !ok { 157 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 158 | } 159 | 160 | protoReq.Token, err = runtime.String(val) 161 | 162 | if err != nil { 163 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 164 | } 165 | 166 | val, ok = pathParams["login"] 167 | if !ok { 168 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "login") 169 | } 170 | 171 | protoReq.Login, err = runtime.Int32(val) 172 | 173 | if err != nil { 174 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "login", err) 175 | } 176 | 177 | msg, err := server.Delete(ctx, &protoReq) 178 | return msg, metadata, err 179 | 180 | } 181 | 182 | var ( 183 | filter_UserService_Add_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 184 | ) 185 | 186 | func request_UserService_Add_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 187 | var protoReq AddUserRequest 188 | var metadata runtime.ServerMetadata 189 | 190 | newReader, berr := utilities.IOReaderFactory(req.Body) 191 | if berr != nil { 192 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 193 | } 194 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 195 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 196 | } 197 | 198 | var ( 199 | val string 200 | ok bool 201 | err error 202 | _ = err 203 | ) 204 | 205 | val, ok = pathParams["token"] 206 | if !ok { 207 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 208 | } 209 | 210 | protoReq.Token, err = runtime.String(val) 211 | 212 | if err != nil { 213 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 214 | } 215 | 216 | if err := req.ParseForm(); err != nil { 217 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 218 | } 219 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Add_0); err != nil { 220 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 221 | } 222 | 223 | msg, err := client.Add(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 224 | return msg, metadata, err 225 | 226 | } 227 | 228 | func local_request_UserService_Add_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 229 | var protoReq AddUserRequest 230 | var metadata runtime.ServerMetadata 231 | 232 | newReader, berr := utilities.IOReaderFactory(req.Body) 233 | if berr != nil { 234 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 235 | } 236 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 237 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 238 | } 239 | 240 | var ( 241 | val string 242 | ok bool 243 | err error 244 | _ = err 245 | ) 246 | 247 | val, ok = pathParams["token"] 248 | if !ok { 249 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 250 | } 251 | 252 | protoReq.Token, err = runtime.String(val) 253 | 254 | if err != nil { 255 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 256 | } 257 | 258 | if err := req.ParseForm(); err != nil { 259 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 260 | } 261 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Add_0); err != nil { 262 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 263 | } 264 | 265 | msg, err := server.Add(ctx, &protoReq) 266 | return msg, metadata, err 267 | 268 | } 269 | 270 | var ( 271 | filter_UserService_Update_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 272 | ) 273 | 274 | func request_UserService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 275 | var protoReq UpdateUserRequest 276 | var metadata runtime.ServerMetadata 277 | 278 | newReader, berr := utilities.IOReaderFactory(req.Body) 279 | if berr != nil { 280 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 281 | } 282 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 283 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 284 | } 285 | 286 | var ( 287 | val string 288 | ok bool 289 | err error 290 | _ = err 291 | ) 292 | 293 | val, ok = pathParams["token"] 294 | if !ok { 295 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 296 | } 297 | 298 | protoReq.Token, err = runtime.String(val) 299 | 300 | if err != nil { 301 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 302 | } 303 | 304 | if err := req.ParseForm(); err != nil { 305 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 306 | } 307 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Update_0); err != nil { 308 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 309 | } 310 | 311 | msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 312 | return msg, metadata, err 313 | 314 | } 315 | 316 | func local_request_UserService_Update_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 317 | var protoReq UpdateUserRequest 318 | var metadata runtime.ServerMetadata 319 | 320 | newReader, berr := utilities.IOReaderFactory(req.Body) 321 | if berr != nil { 322 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 323 | } 324 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 325 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 326 | } 327 | 328 | var ( 329 | val string 330 | ok bool 331 | err error 332 | _ = err 333 | ) 334 | 335 | val, ok = pathParams["token"] 336 | if !ok { 337 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 338 | } 339 | 340 | protoReq.Token, err = runtime.String(val) 341 | 342 | if err != nil { 343 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 344 | } 345 | 346 | if err := req.ParseForm(); err != nil { 347 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 348 | } 349 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Update_0); err != nil { 350 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 351 | } 352 | 353 | msg, err := server.Update(ctx, &protoReq) 354 | return msg, metadata, err 355 | 356 | } 357 | 358 | var ( 359 | filter_UserService_Update_1 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 360 | ) 361 | 362 | func request_UserService_Update_1(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 363 | var protoReq UpdateUserRequest 364 | var metadata runtime.ServerMetadata 365 | 366 | newReader, berr := utilities.IOReaderFactory(req.Body) 367 | if berr != nil { 368 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 369 | } 370 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 371 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 372 | } 373 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 374 | _, md := descriptor.ForMessage(protoReq.User) 375 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 376 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 377 | } else { 378 | protoReq.UpdateMask = fieldMask 379 | } 380 | } 381 | 382 | var ( 383 | val string 384 | ok bool 385 | err error 386 | _ = err 387 | ) 388 | 389 | val, ok = pathParams["token"] 390 | if !ok { 391 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 392 | } 393 | 394 | protoReq.Token, err = runtime.String(val) 395 | 396 | if err != nil { 397 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 398 | } 399 | 400 | if err := req.ParseForm(); err != nil { 401 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 402 | } 403 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Update_1); err != nil { 404 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 405 | } 406 | 407 | msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 408 | return msg, metadata, err 409 | 410 | } 411 | 412 | func local_request_UserService_Update_1(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 413 | var protoReq UpdateUserRequest 414 | var metadata runtime.ServerMetadata 415 | 416 | newReader, berr := utilities.IOReaderFactory(req.Body) 417 | if berr != nil { 418 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 419 | } 420 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 421 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 422 | } 423 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 424 | _, md := descriptor.ForMessage(protoReq.User) 425 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 426 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 427 | } else { 428 | protoReq.UpdateMask = fieldMask 429 | } 430 | } 431 | 432 | var ( 433 | val string 434 | ok bool 435 | err error 436 | _ = err 437 | ) 438 | 439 | val, ok = pathParams["token"] 440 | if !ok { 441 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 442 | } 443 | 444 | protoReq.Token, err = runtime.String(val) 445 | 446 | if err != nil { 447 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 448 | } 449 | 450 | if err := req.ParseForm(); err != nil { 451 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 452 | } 453 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Update_1); err != nil { 454 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 455 | } 456 | 457 | msg, err := server.Update(ctx, &protoReq) 458 | return msg, metadata, err 459 | 460 | } 461 | 462 | var ( 463 | filter_UserService_Withdraw_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 464 | ) 465 | 466 | func request_UserService_Withdraw_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 467 | var protoReq FundsRequest 468 | var metadata runtime.ServerMetadata 469 | 470 | newReader, berr := utilities.IOReaderFactory(req.Body) 471 | if berr != nil { 472 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 473 | } 474 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 475 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 476 | } 477 | 478 | var ( 479 | val string 480 | ok bool 481 | err error 482 | _ = err 483 | ) 484 | 485 | val, ok = pathParams["token"] 486 | if !ok { 487 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 488 | } 489 | 490 | protoReq.Token, err = runtime.String(val) 491 | 492 | if err != nil { 493 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 494 | } 495 | 496 | if err := req.ParseForm(); err != nil { 497 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 498 | } 499 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Withdraw_0); err != nil { 500 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 501 | } 502 | 503 | msg, err := client.Withdraw(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 504 | return msg, metadata, err 505 | 506 | } 507 | 508 | func local_request_UserService_Withdraw_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 509 | var protoReq FundsRequest 510 | var metadata runtime.ServerMetadata 511 | 512 | newReader, berr := utilities.IOReaderFactory(req.Body) 513 | if berr != nil { 514 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 515 | } 516 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 517 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 518 | } 519 | 520 | var ( 521 | val string 522 | ok bool 523 | err error 524 | _ = err 525 | ) 526 | 527 | val, ok = pathParams["token"] 528 | if !ok { 529 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 530 | } 531 | 532 | protoReq.Token, err = runtime.String(val) 533 | 534 | if err != nil { 535 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 536 | } 537 | 538 | if err := req.ParseForm(); err != nil { 539 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 540 | } 541 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Withdraw_0); err != nil { 542 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 543 | } 544 | 545 | msg, err := server.Withdraw(ctx, &protoReq) 546 | return msg, metadata, err 547 | 548 | } 549 | 550 | var ( 551 | filter_UserService_Withdraw_1 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 552 | ) 553 | 554 | func request_UserService_Withdraw_1(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 555 | var protoReq FundsRequest 556 | var metadata runtime.ServerMetadata 557 | 558 | newReader, berr := utilities.IOReaderFactory(req.Body) 559 | if berr != nil { 560 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 561 | } 562 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 563 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 564 | } 565 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 566 | _, md := descriptor.ForMessage(protoReq.User) 567 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 568 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 569 | } else { 570 | protoReq.UpdateMask = fieldMask 571 | } 572 | } 573 | 574 | var ( 575 | val string 576 | ok bool 577 | err error 578 | _ = err 579 | ) 580 | 581 | val, ok = pathParams["token"] 582 | if !ok { 583 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 584 | } 585 | 586 | protoReq.Token, err = runtime.String(val) 587 | 588 | if err != nil { 589 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 590 | } 591 | 592 | if err := req.ParseForm(); err != nil { 593 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 594 | } 595 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Withdraw_1); err != nil { 596 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 597 | } 598 | 599 | msg, err := client.Withdraw(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 600 | return msg, metadata, err 601 | 602 | } 603 | 604 | func local_request_UserService_Withdraw_1(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 605 | var protoReq FundsRequest 606 | var metadata runtime.ServerMetadata 607 | 608 | newReader, berr := utilities.IOReaderFactory(req.Body) 609 | if berr != nil { 610 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 611 | } 612 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 613 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 614 | } 615 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 616 | _, md := descriptor.ForMessage(protoReq.User) 617 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 618 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 619 | } else { 620 | protoReq.UpdateMask = fieldMask 621 | } 622 | } 623 | 624 | var ( 625 | val string 626 | ok bool 627 | err error 628 | _ = err 629 | ) 630 | 631 | val, ok = pathParams["token"] 632 | if !ok { 633 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 634 | } 635 | 636 | protoReq.Token, err = runtime.String(val) 637 | 638 | if err != nil { 639 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 640 | } 641 | 642 | if err := req.ParseForm(); err != nil { 643 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 644 | } 645 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Withdraw_1); err != nil { 646 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 647 | } 648 | 649 | msg, err := server.Withdraw(ctx, &protoReq) 650 | return msg, metadata, err 651 | 652 | } 653 | 654 | var ( 655 | filter_UserService_Deposit_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 656 | ) 657 | 658 | func request_UserService_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 659 | var protoReq FundsRequest 660 | var metadata runtime.ServerMetadata 661 | 662 | newReader, berr := utilities.IOReaderFactory(req.Body) 663 | if berr != nil { 664 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 665 | } 666 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 667 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 668 | } 669 | 670 | var ( 671 | val string 672 | ok bool 673 | err error 674 | _ = err 675 | ) 676 | 677 | val, ok = pathParams["token"] 678 | if !ok { 679 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 680 | } 681 | 682 | protoReq.Token, err = runtime.String(val) 683 | 684 | if err != nil { 685 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 686 | } 687 | 688 | if err := req.ParseForm(); err != nil { 689 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 690 | } 691 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Deposit_0); err != nil { 692 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 693 | } 694 | 695 | msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 696 | return msg, metadata, err 697 | 698 | } 699 | 700 | func local_request_UserService_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 701 | var protoReq FundsRequest 702 | var metadata runtime.ServerMetadata 703 | 704 | newReader, berr := utilities.IOReaderFactory(req.Body) 705 | if berr != nil { 706 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 707 | } 708 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 709 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 710 | } 711 | 712 | var ( 713 | val string 714 | ok bool 715 | err error 716 | _ = err 717 | ) 718 | 719 | val, ok = pathParams["token"] 720 | if !ok { 721 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 722 | } 723 | 724 | protoReq.Token, err = runtime.String(val) 725 | 726 | if err != nil { 727 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 728 | } 729 | 730 | if err := req.ParseForm(); err != nil { 731 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 732 | } 733 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Deposit_0); err != nil { 734 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 735 | } 736 | 737 | msg, err := server.Deposit(ctx, &protoReq) 738 | return msg, metadata, err 739 | 740 | } 741 | 742 | var ( 743 | filter_UserService_Deposit_1 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 744 | ) 745 | 746 | func request_UserService_Deposit_1(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 747 | var protoReq FundsRequest 748 | var metadata runtime.ServerMetadata 749 | 750 | newReader, berr := utilities.IOReaderFactory(req.Body) 751 | if berr != nil { 752 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 753 | } 754 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 755 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 756 | } 757 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 758 | _, md := descriptor.ForMessage(protoReq.User) 759 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 760 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 761 | } else { 762 | protoReq.UpdateMask = fieldMask 763 | } 764 | } 765 | 766 | var ( 767 | val string 768 | ok bool 769 | err error 770 | _ = err 771 | ) 772 | 773 | val, ok = pathParams["token"] 774 | if !ok { 775 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 776 | } 777 | 778 | protoReq.Token, err = runtime.String(val) 779 | 780 | if err != nil { 781 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 782 | } 783 | 784 | if err := req.ParseForm(); err != nil { 785 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 786 | } 787 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Deposit_1); err != nil { 788 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 789 | } 790 | 791 | msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 792 | return msg, metadata, err 793 | 794 | } 795 | 796 | func local_request_UserService_Deposit_1(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 797 | var protoReq FundsRequest 798 | var metadata runtime.ServerMetadata 799 | 800 | newReader, berr := utilities.IOReaderFactory(req.Body) 801 | if berr != nil { 802 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 803 | } 804 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 805 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 806 | } 807 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 808 | _, md := descriptor.ForMessage(protoReq.User) 809 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 810 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 811 | } else { 812 | protoReq.UpdateMask = fieldMask 813 | } 814 | } 815 | 816 | var ( 817 | val string 818 | ok bool 819 | err error 820 | _ = err 821 | ) 822 | 823 | val, ok = pathParams["token"] 824 | if !ok { 825 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 826 | } 827 | 828 | protoReq.Token, err = runtime.String(val) 829 | 830 | if err != nil { 831 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 832 | } 833 | 834 | if err := req.ParseForm(); err != nil { 835 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 836 | } 837 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_Deposit_1); err != nil { 838 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 839 | } 840 | 841 | msg, err := server.Deposit(ctx, &protoReq) 842 | return msg, metadata, err 843 | 844 | } 845 | 846 | var ( 847 | filter_UserService_ResetPassword_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 848 | ) 849 | 850 | func request_UserService_ResetPassword_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 851 | var protoReq ResetPasswordRequest 852 | var metadata runtime.ServerMetadata 853 | 854 | newReader, berr := utilities.IOReaderFactory(req.Body) 855 | if berr != nil { 856 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 857 | } 858 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 859 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 860 | } 861 | 862 | var ( 863 | val string 864 | ok bool 865 | err error 866 | _ = err 867 | ) 868 | 869 | val, ok = pathParams["token"] 870 | if !ok { 871 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 872 | } 873 | 874 | protoReq.Token, err = runtime.String(val) 875 | 876 | if err != nil { 877 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 878 | } 879 | 880 | if err := req.ParseForm(); err != nil { 881 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 882 | } 883 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ResetPassword_0); err != nil { 884 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 885 | } 886 | 887 | msg, err := client.ResetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 888 | return msg, metadata, err 889 | 890 | } 891 | 892 | func local_request_UserService_ResetPassword_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 893 | var protoReq ResetPasswordRequest 894 | var metadata runtime.ServerMetadata 895 | 896 | newReader, berr := utilities.IOReaderFactory(req.Body) 897 | if berr != nil { 898 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 899 | } 900 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 901 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 902 | } 903 | 904 | var ( 905 | val string 906 | ok bool 907 | err error 908 | _ = err 909 | ) 910 | 911 | val, ok = pathParams["token"] 912 | if !ok { 913 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 914 | } 915 | 916 | protoReq.Token, err = runtime.String(val) 917 | 918 | if err != nil { 919 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 920 | } 921 | 922 | if err := req.ParseForm(); err != nil { 923 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 924 | } 925 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ResetPassword_0); err != nil { 926 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 927 | } 928 | 929 | msg, err := server.ResetPassword(ctx, &protoReq) 930 | return msg, metadata, err 931 | 932 | } 933 | 934 | var ( 935 | filter_UserService_ResetPassword_1 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "token": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} 936 | ) 937 | 938 | func request_UserService_ResetPassword_1(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 939 | var protoReq ResetPasswordRequest 940 | var metadata runtime.ServerMetadata 941 | 942 | newReader, berr := utilities.IOReaderFactory(req.Body) 943 | if berr != nil { 944 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 945 | } 946 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 947 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 948 | } 949 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 950 | _, md := descriptor.ForMessage(protoReq.User) 951 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 952 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 953 | } else { 954 | protoReq.UpdateMask = fieldMask 955 | } 956 | } 957 | 958 | var ( 959 | val string 960 | ok bool 961 | err error 962 | _ = err 963 | ) 964 | 965 | val, ok = pathParams["token"] 966 | if !ok { 967 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 968 | } 969 | 970 | protoReq.Token, err = runtime.String(val) 971 | 972 | if err != nil { 973 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 974 | } 975 | 976 | if err := req.ParseForm(); err != nil { 977 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 978 | } 979 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ResetPassword_1); err != nil { 980 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 981 | } 982 | 983 | msg, err := client.ResetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 984 | return msg, metadata, err 985 | 986 | } 987 | 988 | func local_request_UserService_ResetPassword_1(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 989 | var protoReq ResetPasswordRequest 990 | var metadata runtime.ServerMetadata 991 | 992 | newReader, berr := utilities.IOReaderFactory(req.Body) 993 | if berr != nil { 994 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 995 | } 996 | if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF { 997 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 998 | } 999 | if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { 1000 | _, md := descriptor.ForMessage(protoReq.User) 1001 | if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil { 1002 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 1003 | } else { 1004 | protoReq.UpdateMask = fieldMask 1005 | } 1006 | } 1007 | 1008 | var ( 1009 | val string 1010 | ok bool 1011 | err error 1012 | _ = err 1013 | ) 1014 | 1015 | val, ok = pathParams["token"] 1016 | if !ok { 1017 | return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "token") 1018 | } 1019 | 1020 | protoReq.Token, err = runtime.String(val) 1021 | 1022 | if err != nil { 1023 | return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "token", err) 1024 | } 1025 | 1026 | if err := req.ParseForm(); err != nil { 1027 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 1028 | } 1029 | if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_ResetPassword_1); err != nil { 1030 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 1031 | } 1032 | 1033 | msg, err := server.ResetPassword(ctx, &protoReq) 1034 | return msg, metadata, err 1035 | 1036 | } 1037 | 1038 | // RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". 1039 | // UnaryRPC :call UserServiceServer directly. 1040 | // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 1041 | func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error { 1042 | 1043 | mux.Handle("GET", pattern_UserService_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1044 | ctx, cancel := context.WithCancel(req.Context()) 1045 | defer cancel() 1046 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1047 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1048 | if err != nil { 1049 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1050 | return 1051 | } 1052 | resp, md, err := local_request_UserService_GetInfo_0(rctx, inboundMarshaler, server, req, pathParams) 1053 | ctx = runtime.NewServerMetadataContext(ctx, md) 1054 | if err != nil { 1055 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1056 | return 1057 | } 1058 | 1059 | forward_UserService_GetInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1060 | 1061 | }) 1062 | 1063 | mux.Handle("DELETE", pattern_UserService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1064 | ctx, cancel := context.WithCancel(req.Context()) 1065 | defer cancel() 1066 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1067 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1068 | if err != nil { 1069 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1070 | return 1071 | } 1072 | resp, md, err := local_request_UserService_Delete_0(rctx, inboundMarshaler, server, req, pathParams) 1073 | ctx = runtime.NewServerMetadataContext(ctx, md) 1074 | if err != nil { 1075 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1076 | return 1077 | } 1078 | 1079 | forward_UserService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1080 | 1081 | }) 1082 | 1083 | mux.Handle("POST", pattern_UserService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1084 | ctx, cancel := context.WithCancel(req.Context()) 1085 | defer cancel() 1086 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1087 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1088 | if err != nil { 1089 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1090 | return 1091 | } 1092 | resp, md, err := local_request_UserService_Add_0(rctx, inboundMarshaler, server, req, pathParams) 1093 | ctx = runtime.NewServerMetadataContext(ctx, md) 1094 | if err != nil { 1095 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1096 | return 1097 | } 1098 | 1099 | forward_UserService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1100 | 1101 | }) 1102 | 1103 | mux.Handle("PUT", pattern_UserService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1104 | ctx, cancel := context.WithCancel(req.Context()) 1105 | defer cancel() 1106 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1107 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1108 | if err != nil { 1109 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1110 | return 1111 | } 1112 | resp, md, err := local_request_UserService_Update_0(rctx, inboundMarshaler, server, req, pathParams) 1113 | ctx = runtime.NewServerMetadataContext(ctx, md) 1114 | if err != nil { 1115 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1116 | return 1117 | } 1118 | 1119 | forward_UserService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1120 | 1121 | }) 1122 | 1123 | mux.Handle("PATCH", pattern_UserService_Update_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1124 | ctx, cancel := context.WithCancel(req.Context()) 1125 | defer cancel() 1126 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1127 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1128 | if err != nil { 1129 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1130 | return 1131 | } 1132 | resp, md, err := local_request_UserService_Update_1(rctx, inboundMarshaler, server, req, pathParams) 1133 | ctx = runtime.NewServerMetadataContext(ctx, md) 1134 | if err != nil { 1135 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1136 | return 1137 | } 1138 | 1139 | forward_UserService_Update_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1140 | 1141 | }) 1142 | 1143 | mux.Handle("PUT", pattern_UserService_Withdraw_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1144 | ctx, cancel := context.WithCancel(req.Context()) 1145 | defer cancel() 1146 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1147 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1148 | if err != nil { 1149 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1150 | return 1151 | } 1152 | resp, md, err := local_request_UserService_Withdraw_0(rctx, inboundMarshaler, server, req, pathParams) 1153 | ctx = runtime.NewServerMetadataContext(ctx, md) 1154 | if err != nil { 1155 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1156 | return 1157 | } 1158 | 1159 | forward_UserService_Withdraw_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1160 | 1161 | }) 1162 | 1163 | mux.Handle("PATCH", pattern_UserService_Withdraw_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1164 | ctx, cancel := context.WithCancel(req.Context()) 1165 | defer cancel() 1166 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1167 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1168 | if err != nil { 1169 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1170 | return 1171 | } 1172 | resp, md, err := local_request_UserService_Withdraw_1(rctx, inboundMarshaler, server, req, pathParams) 1173 | ctx = runtime.NewServerMetadataContext(ctx, md) 1174 | if err != nil { 1175 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1176 | return 1177 | } 1178 | 1179 | forward_UserService_Withdraw_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1180 | 1181 | }) 1182 | 1183 | mux.Handle("PUT", pattern_UserService_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1184 | ctx, cancel := context.WithCancel(req.Context()) 1185 | defer cancel() 1186 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1187 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1188 | if err != nil { 1189 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1190 | return 1191 | } 1192 | resp, md, err := local_request_UserService_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) 1193 | ctx = runtime.NewServerMetadataContext(ctx, md) 1194 | if err != nil { 1195 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1196 | return 1197 | } 1198 | 1199 | forward_UserService_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1200 | 1201 | }) 1202 | 1203 | mux.Handle("PATCH", pattern_UserService_Deposit_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1204 | ctx, cancel := context.WithCancel(req.Context()) 1205 | defer cancel() 1206 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1207 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1208 | if err != nil { 1209 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1210 | return 1211 | } 1212 | resp, md, err := local_request_UserService_Deposit_1(rctx, inboundMarshaler, server, req, pathParams) 1213 | ctx = runtime.NewServerMetadataContext(ctx, md) 1214 | if err != nil { 1215 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1216 | return 1217 | } 1218 | 1219 | forward_UserService_Deposit_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1220 | 1221 | }) 1222 | 1223 | mux.Handle("PUT", pattern_UserService_ResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1224 | ctx, cancel := context.WithCancel(req.Context()) 1225 | defer cancel() 1226 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1227 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1228 | if err != nil { 1229 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1230 | return 1231 | } 1232 | resp, md, err := local_request_UserService_ResetPassword_0(rctx, inboundMarshaler, server, req, pathParams) 1233 | ctx = runtime.NewServerMetadataContext(ctx, md) 1234 | if err != nil { 1235 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1236 | return 1237 | } 1238 | 1239 | forward_UserService_ResetPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1240 | 1241 | }) 1242 | 1243 | mux.Handle("PATCH", pattern_UserService_ResetPassword_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1244 | ctx, cancel := context.WithCancel(req.Context()) 1245 | defer cancel() 1246 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1247 | rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 1248 | if err != nil { 1249 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1250 | return 1251 | } 1252 | resp, md, err := local_request_UserService_ResetPassword_1(rctx, inboundMarshaler, server, req, pathParams) 1253 | ctx = runtime.NewServerMetadataContext(ctx, md) 1254 | if err != nil { 1255 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1256 | return 1257 | } 1258 | 1259 | forward_UserService_ResetPassword_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1260 | 1261 | }) 1262 | 1263 | return nil 1264 | } 1265 | 1266 | // RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but 1267 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 1268 | func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 1269 | conn, err := grpc.Dial(endpoint, opts...) 1270 | if err != nil { 1271 | return err 1272 | } 1273 | defer func() { 1274 | if err != nil { 1275 | if cerr := conn.Close(); cerr != nil { 1276 | grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 1277 | } 1278 | return 1279 | } 1280 | go func() { 1281 | <-ctx.Done() 1282 | if cerr := conn.Close(); cerr != nil { 1283 | grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 1284 | } 1285 | }() 1286 | }() 1287 | 1288 | return RegisterUserServiceHandler(ctx, mux, conn) 1289 | } 1290 | 1291 | // RegisterUserServiceHandler registers the http handlers for service UserService to "mux". 1292 | // The handlers forward requests to the grpc endpoint over "conn". 1293 | func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 1294 | return RegisterUserServiceHandlerClient(ctx, mux, NewUserServiceClient(conn)) 1295 | } 1296 | 1297 | // RegisterUserServiceHandlerClient registers the http handlers for service UserService 1298 | // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". 1299 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" 1300 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 1301 | // "UserServiceClient" to call the correct interceptors. 1302 | func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error { 1303 | 1304 | mux.Handle("GET", pattern_UserService_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1305 | ctx, cancel := context.WithCancel(req.Context()) 1306 | defer cancel() 1307 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1308 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1309 | if err != nil { 1310 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1311 | return 1312 | } 1313 | resp, md, err := request_UserService_GetInfo_0(rctx, inboundMarshaler, client, req, pathParams) 1314 | ctx = runtime.NewServerMetadataContext(ctx, md) 1315 | if err != nil { 1316 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1317 | return 1318 | } 1319 | 1320 | forward_UserService_GetInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1321 | 1322 | }) 1323 | 1324 | mux.Handle("DELETE", pattern_UserService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1325 | ctx, cancel := context.WithCancel(req.Context()) 1326 | defer cancel() 1327 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1328 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1329 | if err != nil { 1330 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1331 | return 1332 | } 1333 | resp, md, err := request_UserService_Delete_0(rctx, inboundMarshaler, client, req, pathParams) 1334 | ctx = runtime.NewServerMetadataContext(ctx, md) 1335 | if err != nil { 1336 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1337 | return 1338 | } 1339 | 1340 | forward_UserService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1341 | 1342 | }) 1343 | 1344 | mux.Handle("POST", pattern_UserService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1345 | ctx, cancel := context.WithCancel(req.Context()) 1346 | defer cancel() 1347 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1348 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1349 | if err != nil { 1350 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1351 | return 1352 | } 1353 | resp, md, err := request_UserService_Add_0(rctx, inboundMarshaler, client, req, pathParams) 1354 | ctx = runtime.NewServerMetadataContext(ctx, md) 1355 | if err != nil { 1356 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1357 | return 1358 | } 1359 | 1360 | forward_UserService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1361 | 1362 | }) 1363 | 1364 | mux.Handle("PUT", pattern_UserService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1365 | ctx, cancel := context.WithCancel(req.Context()) 1366 | defer cancel() 1367 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1368 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1369 | if err != nil { 1370 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1371 | return 1372 | } 1373 | resp, md, err := request_UserService_Update_0(rctx, inboundMarshaler, client, req, pathParams) 1374 | ctx = runtime.NewServerMetadataContext(ctx, md) 1375 | if err != nil { 1376 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1377 | return 1378 | } 1379 | 1380 | forward_UserService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1381 | 1382 | }) 1383 | 1384 | mux.Handle("PATCH", pattern_UserService_Update_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1385 | ctx, cancel := context.WithCancel(req.Context()) 1386 | defer cancel() 1387 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1388 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1389 | if err != nil { 1390 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1391 | return 1392 | } 1393 | resp, md, err := request_UserService_Update_1(rctx, inboundMarshaler, client, req, pathParams) 1394 | ctx = runtime.NewServerMetadataContext(ctx, md) 1395 | if err != nil { 1396 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1397 | return 1398 | } 1399 | 1400 | forward_UserService_Update_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1401 | 1402 | }) 1403 | 1404 | mux.Handle("PUT", pattern_UserService_Withdraw_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1405 | ctx, cancel := context.WithCancel(req.Context()) 1406 | defer cancel() 1407 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1408 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1409 | if err != nil { 1410 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1411 | return 1412 | } 1413 | resp, md, err := request_UserService_Withdraw_0(rctx, inboundMarshaler, client, req, pathParams) 1414 | ctx = runtime.NewServerMetadataContext(ctx, md) 1415 | if err != nil { 1416 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1417 | return 1418 | } 1419 | 1420 | forward_UserService_Withdraw_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1421 | 1422 | }) 1423 | 1424 | mux.Handle("PATCH", pattern_UserService_Withdraw_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1425 | ctx, cancel := context.WithCancel(req.Context()) 1426 | defer cancel() 1427 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1428 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1429 | if err != nil { 1430 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1431 | return 1432 | } 1433 | resp, md, err := request_UserService_Withdraw_1(rctx, inboundMarshaler, client, req, pathParams) 1434 | ctx = runtime.NewServerMetadataContext(ctx, md) 1435 | if err != nil { 1436 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1437 | return 1438 | } 1439 | 1440 | forward_UserService_Withdraw_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1441 | 1442 | }) 1443 | 1444 | mux.Handle("PUT", pattern_UserService_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1445 | ctx, cancel := context.WithCancel(req.Context()) 1446 | defer cancel() 1447 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1448 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1449 | if err != nil { 1450 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1451 | return 1452 | } 1453 | resp, md, err := request_UserService_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) 1454 | ctx = runtime.NewServerMetadataContext(ctx, md) 1455 | if err != nil { 1456 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1457 | return 1458 | } 1459 | 1460 | forward_UserService_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1461 | 1462 | }) 1463 | 1464 | mux.Handle("PATCH", pattern_UserService_Deposit_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1465 | ctx, cancel := context.WithCancel(req.Context()) 1466 | defer cancel() 1467 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1468 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1469 | if err != nil { 1470 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1471 | return 1472 | } 1473 | resp, md, err := request_UserService_Deposit_1(rctx, inboundMarshaler, client, req, pathParams) 1474 | ctx = runtime.NewServerMetadataContext(ctx, md) 1475 | if err != nil { 1476 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1477 | return 1478 | } 1479 | 1480 | forward_UserService_Deposit_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1481 | 1482 | }) 1483 | 1484 | mux.Handle("PUT", pattern_UserService_ResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1485 | ctx, cancel := context.WithCancel(req.Context()) 1486 | defer cancel() 1487 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1488 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1489 | if err != nil { 1490 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1491 | return 1492 | } 1493 | resp, md, err := request_UserService_ResetPassword_0(rctx, inboundMarshaler, client, req, pathParams) 1494 | ctx = runtime.NewServerMetadataContext(ctx, md) 1495 | if err != nil { 1496 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1497 | return 1498 | } 1499 | 1500 | forward_UserService_ResetPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1501 | 1502 | }) 1503 | 1504 | mux.Handle("PATCH", pattern_UserService_ResetPassword_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 1505 | ctx, cancel := context.WithCancel(req.Context()) 1506 | defer cancel() 1507 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 1508 | rctx, err := runtime.AnnotateContext(ctx, mux, req) 1509 | if err != nil { 1510 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1511 | return 1512 | } 1513 | resp, md, err := request_UserService_ResetPassword_1(rctx, inboundMarshaler, client, req, pathParams) 1514 | ctx = runtime.NewServerMetadataContext(ctx, md) 1515 | if err != nil { 1516 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 1517 | return 1518 | } 1519 | 1520 | forward_UserService_ResetPassword_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 1521 | 1522 | }) 1523 | 1524 | return nil 1525 | } 1526 | 1527 | var ( 1528 | pattern_UserService_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"user", "login"}, "", runtime.AssumeColonVerbOpt(true))) 1529 | 1530 | pattern_UserService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "token", "login"}, "", runtime.AssumeColonVerbOpt(true))) 1531 | 1532 | pattern_UserService_Add_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "add", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1533 | 1534 | pattern_UserService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "update", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1535 | 1536 | pattern_UserService_Update_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "update", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1537 | 1538 | pattern_UserService_Withdraw_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "withdraw", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1539 | 1540 | pattern_UserService_Withdraw_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "withraw", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1541 | 1542 | pattern_UserService_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "deposit", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1543 | 1544 | pattern_UserService_Deposit_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "deposit", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1545 | 1546 | pattern_UserService_ResetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "reset_password", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1547 | 1548 | pattern_UserService_ResetPassword_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"user", "reset_password", "token"}, "", runtime.AssumeColonVerbOpt(true))) 1549 | ) 1550 | 1551 | var ( 1552 | forward_UserService_GetInfo_0 = runtime.ForwardResponseMessage 1553 | 1554 | forward_UserService_Delete_0 = runtime.ForwardResponseMessage 1555 | 1556 | forward_UserService_Add_0 = runtime.ForwardResponseMessage 1557 | 1558 | forward_UserService_Update_0 = runtime.ForwardResponseMessage 1559 | 1560 | forward_UserService_Update_1 = runtime.ForwardResponseMessage 1561 | 1562 | forward_UserService_Withdraw_0 = runtime.ForwardResponseMessage 1563 | 1564 | forward_UserService_Withdraw_1 = runtime.ForwardResponseMessage 1565 | 1566 | forward_UserService_Deposit_0 = runtime.ForwardResponseMessage 1567 | 1568 | forward_UserService_Deposit_1 = runtime.ForwardResponseMessage 1569 | 1570 | forward_UserService_ResetPassword_0 = runtime.ForwardResponseMessage 1571 | 1572 | forward_UserService_ResetPassword_1 = runtime.ForwardResponseMessage 1573 | ) 1574 | -------------------------------------------------------------------------------- /api_pb/api.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: api.proto 3 | 4 | package api_pb 5 | 6 | import ( 7 | context "context" 8 | fmt "fmt" 9 | _ "github.com/envoyproxy/protoc-gen-validate/validate" 10 | proto "github.com/golang/protobuf/proto" 11 | _ "github.com/golang/protobuf/ptypes/empty" 12 | _ "github.com/golang/protobuf/ptypes/struct" 13 | _ "google.golang.org/genproto/googleapis/api/annotations" 14 | _ "google.golang.org/genproto/googleapis/api/httpbody" 15 | field_mask "google.golang.org/genproto/protobuf/field_mask" 16 | grpc "google.golang.org/grpc" 17 | codes "google.golang.org/grpc/codes" 18 | status "google.golang.org/grpc/status" 19 | math "math" 20 | ) 21 | 22 | // Reference imports to suppress errors if they are not otherwise used. 23 | var _ = proto.Marshal 24 | var _ = fmt.Errorf 25 | var _ = math.Inf 26 | 27 | // This is a compile-time assertion to ensure that this generated file 28 | // is compatible with the proto package it is being compiled against. 29 | // A compilation error at this line likely means your copy of the 30 | // proto package needs to be updated. 31 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 32 | 33 | type Cmd int32 34 | 35 | const ( 36 | Cmd_CMD_BUY Cmd = 0 37 | Cmd_CMD_SELL Cmd = 1 38 | ) 39 | 40 | var Cmd_name = map[int32]string{ 41 | 0: "CMD_BUY", 42 | 1: "CMD_SELL", 43 | } 44 | 45 | var Cmd_value = map[string]int32{ 46 | "CMD_BUY": 0, 47 | "CMD_SELL": 1, 48 | } 49 | 50 | func (x Cmd) String() string { 51 | return proto.EnumName(Cmd_name, int32(x)) 52 | } 53 | 54 | func (Cmd) EnumDescriptor() ([]byte, []int) { 55 | return fileDescriptor_00212fb1f9d3bf1c, []int{0} 56 | } 57 | 58 | type UserInfo struct { 59 | // Output only. 60 | Login int32 `protobuf:"varint,1,opt,name=login,proto3" json:"login,omitempty"` 61 | Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` 62 | Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` 63 | Enabled int32 `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` 64 | Leverage int32 `protobuf:"varint,5,opt,name=leverage,proto3" json:"leverage,omitempty"` 65 | // Output only. 66 | Balance float64 `protobuf:"fixed64,6,opt,name=balance,proto3" json:"balance,omitempty"` 67 | // Output only. 68 | Credit float64 `protobuf:"fixed64,7,opt,name=credit,proto3" json:"credit,omitempty"` 69 | AgentAccount int32 `protobuf:"varint,8,opt,name=agent_account,json=agentAccount,proto3" json:"agent_account,omitempty"` 70 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 71 | XXX_unrecognized []byte `json:"-"` 72 | XXX_sizecache int32 `json:"-"` 73 | } 74 | 75 | func (m *UserInfo) Reset() { *m = UserInfo{} } 76 | func (m *UserInfo) String() string { return proto.CompactTextString(m) } 77 | func (*UserInfo) ProtoMessage() {} 78 | func (*UserInfo) Descriptor() ([]byte, []int) { 79 | return fileDescriptor_00212fb1f9d3bf1c, []int{0} 80 | } 81 | 82 | func (m *UserInfo) XXX_Unmarshal(b []byte) error { 83 | return xxx_messageInfo_UserInfo.Unmarshal(m, b) 84 | } 85 | func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 86 | return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) 87 | } 88 | func (m *UserInfo) XXX_Merge(src proto.Message) { 89 | xxx_messageInfo_UserInfo.Merge(m, src) 90 | } 91 | func (m *UserInfo) XXX_Size() int { 92 | return xxx_messageInfo_UserInfo.Size(m) 93 | } 94 | func (m *UserInfo) XXX_DiscardUnknown() { 95 | xxx_messageInfo_UserInfo.DiscardUnknown(m) 96 | } 97 | 98 | var xxx_messageInfo_UserInfo proto.InternalMessageInfo 99 | 100 | func (m *UserInfo) GetLogin() int32 { 101 | if m != nil { 102 | return m.Login 103 | } 104 | return 0 105 | } 106 | 107 | func (m *UserInfo) GetGroup() string { 108 | if m != nil { 109 | return m.Group 110 | } 111 | return "" 112 | } 113 | 114 | func (m *UserInfo) GetName() string { 115 | if m != nil { 116 | return m.Name 117 | } 118 | return "" 119 | } 120 | 121 | func (m *UserInfo) GetEnabled() int32 { 122 | if m != nil { 123 | return m.Enabled 124 | } 125 | return 0 126 | } 127 | 128 | func (m *UserInfo) GetLeverage() int32 { 129 | if m != nil { 130 | return m.Leverage 131 | } 132 | return 0 133 | } 134 | 135 | func (m *UserInfo) GetBalance() float64 { 136 | if m != nil { 137 | return m.Balance 138 | } 139 | return 0 140 | } 141 | 142 | func (m *UserInfo) GetCredit() float64 { 143 | if m != nil { 144 | return m.Credit 145 | } 146 | return 0 147 | } 148 | 149 | func (m *UserInfo) GetAgentAccount() int32 { 150 | if m != nil { 151 | return m.AgentAccount 152 | } 153 | return 0 154 | } 155 | 156 | type UserInfoRequest struct { 157 | Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` 158 | Login int32 `protobuf:"varint,2,opt,name=login,proto3" json:"login,omitempty"` 159 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 160 | XXX_unrecognized []byte `json:"-"` 161 | XXX_sizecache int32 `json:"-"` 162 | } 163 | 164 | func (m *UserInfoRequest) Reset() { *m = UserInfoRequest{} } 165 | func (m *UserInfoRequest) String() string { return proto.CompactTextString(m) } 166 | func (*UserInfoRequest) ProtoMessage() {} 167 | func (*UserInfoRequest) Descriptor() ([]byte, []int) { 168 | return fileDescriptor_00212fb1f9d3bf1c, []int{1} 169 | } 170 | 171 | func (m *UserInfoRequest) XXX_Unmarshal(b []byte) error { 172 | return xxx_messageInfo_UserInfoRequest.Unmarshal(m, b) 173 | } 174 | func (m *UserInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 175 | return xxx_messageInfo_UserInfoRequest.Marshal(b, m, deterministic) 176 | } 177 | func (m *UserInfoRequest) XXX_Merge(src proto.Message) { 178 | xxx_messageInfo_UserInfoRequest.Merge(m, src) 179 | } 180 | func (m *UserInfoRequest) XXX_Size() int { 181 | return xxx_messageInfo_UserInfoRequest.Size(m) 182 | } 183 | func (m *UserInfoRequest) XXX_DiscardUnknown() { 184 | xxx_messageInfo_UserInfoRequest.DiscardUnknown(m) 185 | } 186 | 187 | var xxx_messageInfo_UserInfoRequest proto.InternalMessageInfo 188 | 189 | func (m *UserInfoRequest) GetToken() string { 190 | if m != nil { 191 | return m.Token 192 | } 193 | return "" 194 | } 195 | 196 | func (m *UserInfoRequest) GetLogin() int32 { 197 | if m != nil { 198 | return m.Login 199 | } 200 | return 0 201 | } 202 | 203 | type UserInfoResponse struct { 204 | User *UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` 205 | Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` 206 | Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` 207 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 208 | XXX_unrecognized []byte `json:"-"` 209 | XXX_sizecache int32 `json:"-"` 210 | } 211 | 212 | func (m *UserInfoResponse) Reset() { *m = UserInfoResponse{} } 213 | func (m *UserInfoResponse) String() string { return proto.CompactTextString(m) } 214 | func (*UserInfoResponse) ProtoMessage() {} 215 | func (*UserInfoResponse) Descriptor() ([]byte, []int) { 216 | return fileDescriptor_00212fb1f9d3bf1c, []int{2} 217 | } 218 | 219 | func (m *UserInfoResponse) XXX_Unmarshal(b []byte) error { 220 | return xxx_messageInfo_UserInfoResponse.Unmarshal(m, b) 221 | } 222 | func (m *UserInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 223 | return xxx_messageInfo_UserInfoResponse.Marshal(b, m, deterministic) 224 | } 225 | func (m *UserInfoResponse) XXX_Merge(src proto.Message) { 226 | xxx_messageInfo_UserInfoResponse.Merge(m, src) 227 | } 228 | func (m *UserInfoResponse) XXX_Size() int { 229 | return xxx_messageInfo_UserInfoResponse.Size(m) 230 | } 231 | func (m *UserInfoResponse) XXX_DiscardUnknown() { 232 | xxx_messageInfo_UserInfoResponse.DiscardUnknown(m) 233 | } 234 | 235 | var xxx_messageInfo_UserInfoResponse proto.InternalMessageInfo 236 | 237 | func (m *UserInfoResponse) GetUser() *UserInfo { 238 | if m != nil { 239 | return m.User 240 | } 241 | return nil 242 | } 243 | 244 | func (m *UserInfoResponse) GetCode() int32 { 245 | if m != nil { 246 | return m.Code 247 | } 248 | return 0 249 | } 250 | 251 | func (m *UserInfoResponse) GetMessage() string { 252 | if m != nil { 253 | return m.Message 254 | } 255 | return "" 256 | } 257 | 258 | type AddUserInfo struct { 259 | Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` 260 | Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` 261 | PasswordInvestor string `protobuf:"bytes,3,opt,name=password_investor,json=passwordInvestor,proto3" json:"password_investor,omitempty"` 262 | Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` 263 | Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` 264 | Login int32 `protobuf:"varint,6,opt,name=login,proto3" json:"login,omitempty"` 265 | Enabled int32 `protobuf:"varint,7,opt,name=enabled,proto3" json:"enabled,omitempty"` 266 | City string `protobuf:"bytes,8,opt,name=city,proto3" json:"city,omitempty"` 267 | Phone string `protobuf:"bytes,9,opt,name=phone,proto3" json:"phone,omitempty"` 268 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 269 | XXX_unrecognized []byte `json:"-"` 270 | XXX_sizecache int32 `json:"-"` 271 | } 272 | 273 | func (m *AddUserInfo) Reset() { *m = AddUserInfo{} } 274 | func (m *AddUserInfo) String() string { return proto.CompactTextString(m) } 275 | func (*AddUserInfo) ProtoMessage() {} 276 | func (*AddUserInfo) Descriptor() ([]byte, []int) { 277 | return fileDescriptor_00212fb1f9d3bf1c, []int{3} 278 | } 279 | 280 | func (m *AddUserInfo) XXX_Unmarshal(b []byte) error { 281 | return xxx_messageInfo_AddUserInfo.Unmarshal(m, b) 282 | } 283 | func (m *AddUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 284 | return xxx_messageInfo_AddUserInfo.Marshal(b, m, deterministic) 285 | } 286 | func (m *AddUserInfo) XXX_Merge(src proto.Message) { 287 | xxx_messageInfo_AddUserInfo.Merge(m, src) 288 | } 289 | func (m *AddUserInfo) XXX_Size() int { 290 | return xxx_messageInfo_AddUserInfo.Size(m) 291 | } 292 | func (m *AddUserInfo) XXX_DiscardUnknown() { 293 | xxx_messageInfo_AddUserInfo.DiscardUnknown(m) 294 | } 295 | 296 | var xxx_messageInfo_AddUserInfo proto.InternalMessageInfo 297 | 298 | func (m *AddUserInfo) GetEmail() string { 299 | if m != nil { 300 | return m.Email 301 | } 302 | return "" 303 | } 304 | 305 | func (m *AddUserInfo) GetPassword() string { 306 | if m != nil { 307 | return m.Password 308 | } 309 | return "" 310 | } 311 | 312 | func (m *AddUserInfo) GetPasswordInvestor() string { 313 | if m != nil { 314 | return m.PasswordInvestor 315 | } 316 | return "" 317 | } 318 | 319 | func (m *AddUserInfo) GetGroup() string { 320 | if m != nil { 321 | return m.Group 322 | } 323 | return "" 324 | } 325 | 326 | func (m *AddUserInfo) GetName() string { 327 | if m != nil { 328 | return m.Name 329 | } 330 | return "" 331 | } 332 | 333 | func (m *AddUserInfo) GetLogin() int32 { 334 | if m != nil { 335 | return m.Login 336 | } 337 | return 0 338 | } 339 | 340 | func (m *AddUserInfo) GetEnabled() int32 { 341 | if m != nil { 342 | return m.Enabled 343 | } 344 | return 0 345 | } 346 | 347 | func (m *AddUserInfo) GetCity() string { 348 | if m != nil { 349 | return m.City 350 | } 351 | return "" 352 | } 353 | 354 | func (m *AddUserInfo) GetPhone() string { 355 | if m != nil { 356 | return m.Phone 357 | } 358 | return "" 359 | } 360 | 361 | type AddUserRequest struct { 362 | Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` 363 | User *AddUserInfo `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` 364 | UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` 365 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 366 | XXX_unrecognized []byte `json:"-"` 367 | XXX_sizecache int32 `json:"-"` 368 | } 369 | 370 | func (m *AddUserRequest) Reset() { *m = AddUserRequest{} } 371 | func (m *AddUserRequest) String() string { return proto.CompactTextString(m) } 372 | func (*AddUserRequest) ProtoMessage() {} 373 | func (*AddUserRequest) Descriptor() ([]byte, []int) { 374 | return fileDescriptor_00212fb1f9d3bf1c, []int{4} 375 | } 376 | 377 | func (m *AddUserRequest) XXX_Unmarshal(b []byte) error { 378 | return xxx_messageInfo_AddUserRequest.Unmarshal(m, b) 379 | } 380 | func (m *AddUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 381 | return xxx_messageInfo_AddUserRequest.Marshal(b, m, deterministic) 382 | } 383 | func (m *AddUserRequest) XXX_Merge(src proto.Message) { 384 | xxx_messageInfo_AddUserRequest.Merge(m, src) 385 | } 386 | func (m *AddUserRequest) XXX_Size() int { 387 | return xxx_messageInfo_AddUserRequest.Size(m) 388 | } 389 | func (m *AddUserRequest) XXX_DiscardUnknown() { 390 | xxx_messageInfo_AddUserRequest.DiscardUnknown(m) 391 | } 392 | 393 | var xxx_messageInfo_AddUserRequest proto.InternalMessageInfo 394 | 395 | func (m *AddUserRequest) GetToken() string { 396 | if m != nil { 397 | return m.Token 398 | } 399 | return "" 400 | } 401 | 402 | func (m *AddUserRequest) GetUser() *AddUserInfo { 403 | if m != nil { 404 | return m.User 405 | } 406 | return nil 407 | } 408 | 409 | func (m *AddUserRequest) GetUpdateMask() *field_mask.FieldMask { 410 | if m != nil { 411 | return m.UpdateMask 412 | } 413 | return nil 414 | } 415 | 416 | type AddUserResponse struct { 417 | Login int32 `protobuf:"varint,1,opt,name=login,proto3" json:"login,omitempty"` 418 | Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` 419 | Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` 420 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 421 | XXX_unrecognized []byte `json:"-"` 422 | XXX_sizecache int32 `json:"-"` 423 | } 424 | 425 | func (m *AddUserResponse) Reset() { *m = AddUserResponse{} } 426 | func (m *AddUserResponse) String() string { return proto.CompactTextString(m) } 427 | func (*AddUserResponse) ProtoMessage() {} 428 | func (*AddUserResponse) Descriptor() ([]byte, []int) { 429 | return fileDescriptor_00212fb1f9d3bf1c, []int{5} 430 | } 431 | 432 | func (m *AddUserResponse) XXX_Unmarshal(b []byte) error { 433 | return xxx_messageInfo_AddUserResponse.Unmarshal(m, b) 434 | } 435 | func (m *AddUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 436 | return xxx_messageInfo_AddUserResponse.Marshal(b, m, deterministic) 437 | } 438 | func (m *AddUserResponse) XXX_Merge(src proto.Message) { 439 | xxx_messageInfo_AddUserResponse.Merge(m, src) 440 | } 441 | func (m *AddUserResponse) XXX_Size() int { 442 | return xxx_messageInfo_AddUserResponse.Size(m) 443 | } 444 | func (m *AddUserResponse) XXX_DiscardUnknown() { 445 | xxx_messageInfo_AddUserResponse.DiscardUnknown(m) 446 | } 447 | 448 | var xxx_messageInfo_AddUserResponse proto.InternalMessageInfo 449 | 450 | func (m *AddUserResponse) GetLogin() int32 { 451 | if m != nil { 452 | return m.Login 453 | } 454 | return 0 455 | } 456 | 457 | func (m *AddUserResponse) GetCode() int32 { 458 | if m != nil { 459 | return m.Code 460 | } 461 | return 0 462 | } 463 | 464 | func (m *AddUserResponse) GetMessage() string { 465 | if m != nil { 466 | return m.Message 467 | } 468 | return "" 469 | } 470 | 471 | type UpdateUserInfo struct { 472 | Login int32 `protobuf:"varint,1,opt,name=login,proto3" json:"login,omitempty"` 473 | Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` 474 | Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` 475 | Enabled int32 `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` 476 | Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` 477 | PasswordInvestor string `protobuf:"bytes,6,opt,name=password_investor,json=passwordInvestor,proto3" json:"password_investor,omitempty"` 478 | Phone string `protobuf:"bytes,7,opt,name=phone,proto3" json:"phone,omitempty"` 479 | City string `protobuf:"bytes,8,opt,name=city,proto3" json:"city,omitempty"` 480 | Group string `protobuf:"bytes,9,opt,name=group,proto3" json:"group,omitempty"` 481 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 482 | XXX_unrecognized []byte `json:"-"` 483 | XXX_sizecache int32 `json:"-"` 484 | } 485 | 486 | func (m *UpdateUserInfo) Reset() { *m = UpdateUserInfo{} } 487 | func (m *UpdateUserInfo) String() string { return proto.CompactTextString(m) } 488 | func (*UpdateUserInfo) ProtoMessage() {} 489 | func (*UpdateUserInfo) Descriptor() ([]byte, []int) { 490 | return fileDescriptor_00212fb1f9d3bf1c, []int{6} 491 | } 492 | 493 | func (m *UpdateUserInfo) XXX_Unmarshal(b []byte) error { 494 | return xxx_messageInfo_UpdateUserInfo.Unmarshal(m, b) 495 | } 496 | func (m *UpdateUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 497 | return xxx_messageInfo_UpdateUserInfo.Marshal(b, m, deterministic) 498 | } 499 | func (m *UpdateUserInfo) XXX_Merge(src proto.Message) { 500 | xxx_messageInfo_UpdateUserInfo.Merge(m, src) 501 | } 502 | func (m *UpdateUserInfo) XXX_Size() int { 503 | return xxx_messageInfo_UpdateUserInfo.Size(m) 504 | } 505 | func (m *UpdateUserInfo) XXX_DiscardUnknown() { 506 | xxx_messageInfo_UpdateUserInfo.DiscardUnknown(m) 507 | } 508 | 509 | var xxx_messageInfo_UpdateUserInfo proto.InternalMessageInfo 510 | 511 | func (m *UpdateUserInfo) GetLogin() int32 { 512 | if m != nil { 513 | return m.Login 514 | } 515 | return 0 516 | } 517 | 518 | func (m *UpdateUserInfo) GetEmail() string { 519 | if m != nil { 520 | return m.Email 521 | } 522 | return "" 523 | } 524 | 525 | func (m *UpdateUserInfo) GetName() string { 526 | if m != nil { 527 | return m.Name 528 | } 529 | return "" 530 | } 531 | 532 | func (m *UpdateUserInfo) GetEnabled() int32 { 533 | if m != nil { 534 | return m.Enabled 535 | } 536 | return 0 537 | } 538 | 539 | func (m *UpdateUserInfo) GetPassword() string { 540 | if m != nil { 541 | return m.Password 542 | } 543 | return "" 544 | } 545 | 546 | func (m *UpdateUserInfo) GetPasswordInvestor() string { 547 | if m != nil { 548 | return m.PasswordInvestor 549 | } 550 | return "" 551 | } 552 | 553 | func (m *UpdateUserInfo) GetPhone() string { 554 | if m != nil { 555 | return m.Phone 556 | } 557 | return "" 558 | } 559 | 560 | func (m *UpdateUserInfo) GetCity() string { 561 | if m != nil { 562 | return m.City 563 | } 564 | return "" 565 | } 566 | 567 | func (m *UpdateUserInfo) GetGroup() string { 568 | if m != nil { 569 | return m.Group 570 | } 571 | return "" 572 | } 573 | 574 | type UpdateUserRequest struct { 575 | Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` 576 | User *UpdateUserInfo `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` 577 | UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` 578 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 579 | XXX_unrecognized []byte `json:"-"` 580 | XXX_sizecache int32 `json:"-"` 581 | } 582 | 583 | func (m *UpdateUserRequest) Reset() { *m = UpdateUserRequest{} } 584 | func (m *UpdateUserRequest) String() string { return proto.CompactTextString(m) } 585 | func (*UpdateUserRequest) ProtoMessage() {} 586 | func (*UpdateUserRequest) Descriptor() ([]byte, []int) { 587 | return fileDescriptor_00212fb1f9d3bf1c, []int{7} 588 | } 589 | 590 | func (m *UpdateUserRequest) XXX_Unmarshal(b []byte) error { 591 | return xxx_messageInfo_UpdateUserRequest.Unmarshal(m, b) 592 | } 593 | func (m *UpdateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 594 | return xxx_messageInfo_UpdateUserRequest.Marshal(b, m, deterministic) 595 | } 596 | func (m *UpdateUserRequest) XXX_Merge(src proto.Message) { 597 | xxx_messageInfo_UpdateUserRequest.Merge(m, src) 598 | } 599 | func (m *UpdateUserRequest) XXX_Size() int { 600 | return xxx_messageInfo_UpdateUserRequest.Size(m) 601 | } 602 | func (m *UpdateUserRequest) XXX_DiscardUnknown() { 603 | xxx_messageInfo_UpdateUserRequest.DiscardUnknown(m) 604 | } 605 | 606 | var xxx_messageInfo_UpdateUserRequest proto.InternalMessageInfo 607 | 608 | func (m *UpdateUserRequest) GetToken() string { 609 | if m != nil { 610 | return m.Token 611 | } 612 | return "" 613 | } 614 | 615 | func (m *UpdateUserRequest) GetUser() *UpdateUserInfo { 616 | if m != nil { 617 | return m.User 618 | } 619 | return nil 620 | } 621 | 622 | func (m *UpdateUserRequest) GetUpdateMask() *field_mask.FieldMask { 623 | if m != nil { 624 | return m.UpdateMask 625 | } 626 | return nil 627 | } 628 | 629 | type UpdateUserResponse struct { 630 | Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` 631 | Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 632 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 633 | XXX_unrecognized []byte `json:"-"` 634 | XXX_sizecache int32 `json:"-"` 635 | } 636 | 637 | func (m *UpdateUserResponse) Reset() { *m = UpdateUserResponse{} } 638 | func (m *UpdateUserResponse) String() string { return proto.CompactTextString(m) } 639 | func (*UpdateUserResponse) ProtoMessage() {} 640 | func (*UpdateUserResponse) Descriptor() ([]byte, []int) { 641 | return fileDescriptor_00212fb1f9d3bf1c, []int{8} 642 | } 643 | 644 | func (m *UpdateUserResponse) XXX_Unmarshal(b []byte) error { 645 | return xxx_messageInfo_UpdateUserResponse.Unmarshal(m, b) 646 | } 647 | func (m *UpdateUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 648 | return xxx_messageInfo_UpdateUserResponse.Marshal(b, m, deterministic) 649 | } 650 | func (m *UpdateUserResponse) XXX_Merge(src proto.Message) { 651 | xxx_messageInfo_UpdateUserResponse.Merge(m, src) 652 | } 653 | func (m *UpdateUserResponse) XXX_Size() int { 654 | return xxx_messageInfo_UpdateUserResponse.Size(m) 655 | } 656 | func (m *UpdateUserResponse) XXX_DiscardUnknown() { 657 | xxx_messageInfo_UpdateUserResponse.DiscardUnknown(m) 658 | } 659 | 660 | var xxx_messageInfo_UpdateUserResponse proto.InternalMessageInfo 661 | 662 | func (m *UpdateUserResponse) GetCode() int32 { 663 | if m != nil { 664 | return m.Code 665 | } 666 | return 0 667 | } 668 | 669 | func (m *UpdateUserResponse) GetMessage() string { 670 | if m != nil { 671 | return m.Message 672 | } 673 | return "" 674 | } 675 | 676 | type DeleteUserRequest struct { 677 | Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` 678 | Login int32 `protobuf:"varint,2,opt,name=login,proto3" json:"login,omitempty"` 679 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 680 | XXX_unrecognized []byte `json:"-"` 681 | XXX_sizecache int32 `json:"-"` 682 | } 683 | 684 | func (m *DeleteUserRequest) Reset() { *m = DeleteUserRequest{} } 685 | func (m *DeleteUserRequest) String() string { return proto.CompactTextString(m) } 686 | func (*DeleteUserRequest) ProtoMessage() {} 687 | func (*DeleteUserRequest) Descriptor() ([]byte, []int) { 688 | return fileDescriptor_00212fb1f9d3bf1c, []int{9} 689 | } 690 | 691 | func (m *DeleteUserRequest) XXX_Unmarshal(b []byte) error { 692 | return xxx_messageInfo_DeleteUserRequest.Unmarshal(m, b) 693 | } 694 | func (m *DeleteUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 695 | return xxx_messageInfo_DeleteUserRequest.Marshal(b, m, deterministic) 696 | } 697 | func (m *DeleteUserRequest) XXX_Merge(src proto.Message) { 698 | xxx_messageInfo_DeleteUserRequest.Merge(m, src) 699 | } 700 | func (m *DeleteUserRequest) XXX_Size() int { 701 | return xxx_messageInfo_DeleteUserRequest.Size(m) 702 | } 703 | func (m *DeleteUserRequest) XXX_DiscardUnknown() { 704 | xxx_messageInfo_DeleteUserRequest.DiscardUnknown(m) 705 | } 706 | 707 | var xxx_messageInfo_DeleteUserRequest proto.InternalMessageInfo 708 | 709 | func (m *DeleteUserRequest) GetToken() string { 710 | if m != nil { 711 | return m.Token 712 | } 713 | return "" 714 | } 715 | 716 | func (m *DeleteUserRequest) GetLogin() int32 { 717 | if m != nil { 718 | return m.Login 719 | } 720 | return 0 721 | } 722 | 723 | type DeleteUserResponse struct { 724 | Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` 725 | Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 726 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 727 | XXX_unrecognized []byte `json:"-"` 728 | XXX_sizecache int32 `json:"-"` 729 | } 730 | 731 | func (m *DeleteUserResponse) Reset() { *m = DeleteUserResponse{} } 732 | func (m *DeleteUserResponse) String() string { return proto.CompactTextString(m) } 733 | func (*DeleteUserResponse) ProtoMessage() {} 734 | func (*DeleteUserResponse) Descriptor() ([]byte, []int) { 735 | return fileDescriptor_00212fb1f9d3bf1c, []int{10} 736 | } 737 | 738 | func (m *DeleteUserResponse) XXX_Unmarshal(b []byte) error { 739 | return xxx_messageInfo_DeleteUserResponse.Unmarshal(m, b) 740 | } 741 | func (m *DeleteUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 742 | return xxx_messageInfo_DeleteUserResponse.Marshal(b, m, deterministic) 743 | } 744 | func (m *DeleteUserResponse) XXX_Merge(src proto.Message) { 745 | xxx_messageInfo_DeleteUserResponse.Merge(m, src) 746 | } 747 | func (m *DeleteUserResponse) XXX_Size() int { 748 | return xxx_messageInfo_DeleteUserResponse.Size(m) 749 | } 750 | func (m *DeleteUserResponse) XXX_DiscardUnknown() { 751 | xxx_messageInfo_DeleteUserResponse.DiscardUnknown(m) 752 | } 753 | 754 | var xxx_messageInfo_DeleteUserResponse proto.InternalMessageInfo 755 | 756 | func (m *DeleteUserResponse) GetCode() int32 { 757 | if m != nil { 758 | return m.Code 759 | } 760 | return 0 761 | } 762 | 763 | func (m *DeleteUserResponse) GetMessage() string { 764 | if m != nil { 765 | return m.Message 766 | } 767 | return "" 768 | } 769 | 770 | type ResetPasswordInfo struct { 771 | Login int32 `protobuf:"varint,1,opt,name=login,proto3" json:"login,omitempty"` 772 | Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` 773 | PasswordInvestor string `protobuf:"bytes,3,opt,name=password_investor,json=passwordInvestor,proto3" json:"password_investor,omitempty"` 774 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 775 | XXX_unrecognized []byte `json:"-"` 776 | XXX_sizecache int32 `json:"-"` 777 | } 778 | 779 | func (m *ResetPasswordInfo) Reset() { *m = ResetPasswordInfo{} } 780 | func (m *ResetPasswordInfo) String() string { return proto.CompactTextString(m) } 781 | func (*ResetPasswordInfo) ProtoMessage() {} 782 | func (*ResetPasswordInfo) Descriptor() ([]byte, []int) { 783 | return fileDescriptor_00212fb1f9d3bf1c, []int{11} 784 | } 785 | 786 | func (m *ResetPasswordInfo) XXX_Unmarshal(b []byte) error { 787 | return xxx_messageInfo_ResetPasswordInfo.Unmarshal(m, b) 788 | } 789 | func (m *ResetPasswordInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 790 | return xxx_messageInfo_ResetPasswordInfo.Marshal(b, m, deterministic) 791 | } 792 | func (m *ResetPasswordInfo) XXX_Merge(src proto.Message) { 793 | xxx_messageInfo_ResetPasswordInfo.Merge(m, src) 794 | } 795 | func (m *ResetPasswordInfo) XXX_Size() int { 796 | return xxx_messageInfo_ResetPasswordInfo.Size(m) 797 | } 798 | func (m *ResetPasswordInfo) XXX_DiscardUnknown() { 799 | xxx_messageInfo_ResetPasswordInfo.DiscardUnknown(m) 800 | } 801 | 802 | var xxx_messageInfo_ResetPasswordInfo proto.InternalMessageInfo 803 | 804 | func (m *ResetPasswordInfo) GetLogin() int32 { 805 | if m != nil { 806 | return m.Login 807 | } 808 | return 0 809 | } 810 | 811 | func (m *ResetPasswordInfo) GetPassword() string { 812 | if m != nil { 813 | return m.Password 814 | } 815 | return "" 816 | } 817 | 818 | func (m *ResetPasswordInfo) GetPasswordInvestor() string { 819 | if m != nil { 820 | return m.PasswordInvestor 821 | } 822 | return "" 823 | } 824 | 825 | type ResetPasswordRequest struct { 826 | Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` 827 | User *ResetPasswordInfo `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` 828 | UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` 829 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 830 | XXX_unrecognized []byte `json:"-"` 831 | XXX_sizecache int32 `json:"-"` 832 | } 833 | 834 | func (m *ResetPasswordRequest) Reset() { *m = ResetPasswordRequest{} } 835 | func (m *ResetPasswordRequest) String() string { return proto.CompactTextString(m) } 836 | func (*ResetPasswordRequest) ProtoMessage() {} 837 | func (*ResetPasswordRequest) Descriptor() ([]byte, []int) { 838 | return fileDescriptor_00212fb1f9d3bf1c, []int{12} 839 | } 840 | 841 | func (m *ResetPasswordRequest) XXX_Unmarshal(b []byte) error { 842 | return xxx_messageInfo_ResetPasswordRequest.Unmarshal(m, b) 843 | } 844 | func (m *ResetPasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 845 | return xxx_messageInfo_ResetPasswordRequest.Marshal(b, m, deterministic) 846 | } 847 | func (m *ResetPasswordRequest) XXX_Merge(src proto.Message) { 848 | xxx_messageInfo_ResetPasswordRequest.Merge(m, src) 849 | } 850 | func (m *ResetPasswordRequest) XXX_Size() int { 851 | return xxx_messageInfo_ResetPasswordRequest.Size(m) 852 | } 853 | func (m *ResetPasswordRequest) XXX_DiscardUnknown() { 854 | xxx_messageInfo_ResetPasswordRequest.DiscardUnknown(m) 855 | } 856 | 857 | var xxx_messageInfo_ResetPasswordRequest proto.InternalMessageInfo 858 | 859 | func (m *ResetPasswordRequest) GetToken() string { 860 | if m != nil { 861 | return m.Token 862 | } 863 | return "" 864 | } 865 | 866 | func (m *ResetPasswordRequest) GetUser() *ResetPasswordInfo { 867 | if m != nil { 868 | return m.User 869 | } 870 | return nil 871 | } 872 | 873 | func (m *ResetPasswordRequest) GetUpdateMask() *field_mask.FieldMask { 874 | if m != nil { 875 | return m.UpdateMask 876 | } 877 | return nil 878 | } 879 | 880 | type ResetPasswordResponse struct { 881 | Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` 882 | Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 883 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 884 | XXX_unrecognized []byte `json:"-"` 885 | XXX_sizecache int32 `json:"-"` 886 | } 887 | 888 | func (m *ResetPasswordResponse) Reset() { *m = ResetPasswordResponse{} } 889 | func (m *ResetPasswordResponse) String() string { return proto.CompactTextString(m) } 890 | func (*ResetPasswordResponse) ProtoMessage() {} 891 | func (*ResetPasswordResponse) Descriptor() ([]byte, []int) { 892 | return fileDescriptor_00212fb1f9d3bf1c, []int{13} 893 | } 894 | 895 | func (m *ResetPasswordResponse) XXX_Unmarshal(b []byte) error { 896 | return xxx_messageInfo_ResetPasswordResponse.Unmarshal(m, b) 897 | } 898 | func (m *ResetPasswordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 899 | return xxx_messageInfo_ResetPasswordResponse.Marshal(b, m, deterministic) 900 | } 901 | func (m *ResetPasswordResponse) XXX_Merge(src proto.Message) { 902 | xxx_messageInfo_ResetPasswordResponse.Merge(m, src) 903 | } 904 | func (m *ResetPasswordResponse) XXX_Size() int { 905 | return xxx_messageInfo_ResetPasswordResponse.Size(m) 906 | } 907 | func (m *ResetPasswordResponse) XXX_DiscardUnknown() { 908 | xxx_messageInfo_ResetPasswordResponse.DiscardUnknown(m) 909 | } 910 | 911 | var xxx_messageInfo_ResetPasswordResponse proto.InternalMessageInfo 912 | 913 | func (m *ResetPasswordResponse) GetCode() int32 { 914 | if m != nil { 915 | return m.Code 916 | } 917 | return 0 918 | } 919 | 920 | func (m *ResetPasswordResponse) GetMessage() string { 921 | if m != nil { 922 | return m.Message 923 | } 924 | return "" 925 | } 926 | 927 | type FundsInfo struct { 928 | Login int32 `protobuf:"varint,1,opt,name=login,proto3" json:"login,omitempty"` 929 | Amount float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"` 930 | IsCredit int32 `protobuf:"varint,3,opt,name=is_credit,json=isCredit,proto3" json:"is_credit,omitempty"` 931 | Comment string `protobuf:"bytes,4,opt,name=comment,proto3" json:"comment,omitempty"` 932 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 933 | XXX_unrecognized []byte `json:"-"` 934 | XXX_sizecache int32 `json:"-"` 935 | } 936 | 937 | func (m *FundsInfo) Reset() { *m = FundsInfo{} } 938 | func (m *FundsInfo) String() string { return proto.CompactTextString(m) } 939 | func (*FundsInfo) ProtoMessage() {} 940 | func (*FundsInfo) Descriptor() ([]byte, []int) { 941 | return fileDescriptor_00212fb1f9d3bf1c, []int{14} 942 | } 943 | 944 | func (m *FundsInfo) XXX_Unmarshal(b []byte) error { 945 | return xxx_messageInfo_FundsInfo.Unmarshal(m, b) 946 | } 947 | func (m *FundsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 948 | return xxx_messageInfo_FundsInfo.Marshal(b, m, deterministic) 949 | } 950 | func (m *FundsInfo) XXX_Merge(src proto.Message) { 951 | xxx_messageInfo_FundsInfo.Merge(m, src) 952 | } 953 | func (m *FundsInfo) XXX_Size() int { 954 | return xxx_messageInfo_FundsInfo.Size(m) 955 | } 956 | func (m *FundsInfo) XXX_DiscardUnknown() { 957 | xxx_messageInfo_FundsInfo.DiscardUnknown(m) 958 | } 959 | 960 | var xxx_messageInfo_FundsInfo proto.InternalMessageInfo 961 | 962 | func (m *FundsInfo) GetLogin() int32 { 963 | if m != nil { 964 | return m.Login 965 | } 966 | return 0 967 | } 968 | 969 | func (m *FundsInfo) GetAmount() float64 { 970 | if m != nil { 971 | return m.Amount 972 | } 973 | return 0 974 | } 975 | 976 | func (m *FundsInfo) GetIsCredit() int32 { 977 | if m != nil { 978 | return m.IsCredit 979 | } 980 | return 0 981 | } 982 | 983 | func (m *FundsInfo) GetComment() string { 984 | if m != nil { 985 | return m.Comment 986 | } 987 | return "" 988 | } 989 | 990 | type FundsRequest struct { 991 | Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` 992 | User *FundsInfo `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` 993 | UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` 994 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 995 | XXX_unrecognized []byte `json:"-"` 996 | XXX_sizecache int32 `json:"-"` 997 | } 998 | 999 | func (m *FundsRequest) Reset() { *m = FundsRequest{} } 1000 | func (m *FundsRequest) String() string { return proto.CompactTextString(m) } 1001 | func (*FundsRequest) ProtoMessage() {} 1002 | func (*FundsRequest) Descriptor() ([]byte, []int) { 1003 | return fileDescriptor_00212fb1f9d3bf1c, []int{15} 1004 | } 1005 | 1006 | func (m *FundsRequest) XXX_Unmarshal(b []byte) error { 1007 | return xxx_messageInfo_FundsRequest.Unmarshal(m, b) 1008 | } 1009 | func (m *FundsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1010 | return xxx_messageInfo_FundsRequest.Marshal(b, m, deterministic) 1011 | } 1012 | func (m *FundsRequest) XXX_Merge(src proto.Message) { 1013 | xxx_messageInfo_FundsRequest.Merge(m, src) 1014 | } 1015 | func (m *FundsRequest) XXX_Size() int { 1016 | return xxx_messageInfo_FundsRequest.Size(m) 1017 | } 1018 | func (m *FundsRequest) XXX_DiscardUnknown() { 1019 | xxx_messageInfo_FundsRequest.DiscardUnknown(m) 1020 | } 1021 | 1022 | var xxx_messageInfo_FundsRequest proto.InternalMessageInfo 1023 | 1024 | func (m *FundsRequest) GetToken() string { 1025 | if m != nil { 1026 | return m.Token 1027 | } 1028 | return "" 1029 | } 1030 | 1031 | func (m *FundsRequest) GetUser() *FundsInfo { 1032 | if m != nil { 1033 | return m.User 1034 | } 1035 | return nil 1036 | } 1037 | 1038 | func (m *FundsRequest) GetUpdateMask() *field_mask.FieldMask { 1039 | if m != nil { 1040 | return m.UpdateMask 1041 | } 1042 | return nil 1043 | } 1044 | 1045 | type FundsResponse struct { 1046 | Balance float64 `protobuf:"fixed64,1,opt,name=balance,proto3" json:"balance,omitempty"` 1047 | Credit float64 `protobuf:"fixed64,2,opt,name=credit,proto3" json:"credit,omitempty"` 1048 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1049 | XXX_unrecognized []byte `json:"-"` 1050 | XXX_sizecache int32 `json:"-"` 1051 | } 1052 | 1053 | func (m *FundsResponse) Reset() { *m = FundsResponse{} } 1054 | func (m *FundsResponse) String() string { return proto.CompactTextString(m) } 1055 | func (*FundsResponse) ProtoMessage() {} 1056 | func (*FundsResponse) Descriptor() ([]byte, []int) { 1057 | return fileDescriptor_00212fb1f9d3bf1c, []int{16} 1058 | } 1059 | 1060 | func (m *FundsResponse) XXX_Unmarshal(b []byte) error { 1061 | return xxx_messageInfo_FundsResponse.Unmarshal(m, b) 1062 | } 1063 | func (m *FundsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1064 | return xxx_messageInfo_FundsResponse.Marshal(b, m, deterministic) 1065 | } 1066 | func (m *FundsResponse) XXX_Merge(src proto.Message) { 1067 | xxx_messageInfo_FundsResponse.Merge(m, src) 1068 | } 1069 | func (m *FundsResponse) XXX_Size() int { 1070 | return xxx_messageInfo_FundsResponse.Size(m) 1071 | } 1072 | func (m *FundsResponse) XXX_DiscardUnknown() { 1073 | xxx_messageInfo_FundsResponse.DiscardUnknown(m) 1074 | } 1075 | 1076 | var xxx_messageInfo_FundsResponse proto.InternalMessageInfo 1077 | 1078 | func (m *FundsResponse) GetBalance() float64 { 1079 | if m != nil { 1080 | return m.Balance 1081 | } 1082 | return 0 1083 | } 1084 | 1085 | func (m *FundsResponse) GetCredit() float64 { 1086 | if m != nil { 1087 | return m.Credit 1088 | } 1089 | return 0 1090 | } 1091 | 1092 | type TradeInfo struct { 1093 | Ticket int32 `protobuf:"varint,1,opt,name=ticket,proto3" json:"ticket,omitempty"` 1094 | Login int32 `protobuf:"varint,2,opt,name=login,proto3" json:"login,omitempty"` 1095 | Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` 1096 | Digits int32 `protobuf:"varint,4,opt,name=digits,proto3" json:"digits,omitempty"` 1097 | Cmd Cmd `protobuf:"varint,5,opt,name=cmd,proto3,enum=api_pb.Cmd" json:"cmd,omitempty"` 1098 | Volume int32 `protobuf:"varint,6,opt,name=volume,proto3" json:"volume,omitempty"` 1099 | OpenTime int32 `protobuf:"varint,7,opt,name=open_time,json=openTime,proto3" json:"open_time,omitempty"` 1100 | State int32 `protobuf:"varint,8,opt,name=state,proto3" json:"state,omitempty"` 1101 | OpenPrice float64 `protobuf:"fixed64,9,opt,name=open_price,json=openPrice,proto3" json:"open_price,omitempty"` 1102 | Sl float64 `protobuf:"fixed64,10,opt,name=sl,proto3" json:"sl,omitempty"` 1103 | Tp float64 `protobuf:"fixed64,11,opt,name=tp,proto3" json:"tp,omitempty"` 1104 | CloseTime int32 `protobuf:"varint,12,opt,name=close_time,json=closeTime,proto3" json:"close_time,omitempty"` 1105 | Expiration int32 `protobuf:"varint,13,opt,name=expiration,proto3" json:"expiration,omitempty"` 1106 | Commission float64 `protobuf:"fixed64,14,opt,name=commission,proto3" json:"commission,omitempty"` 1107 | ClosePrice float64 `protobuf:"fixed64,15,opt,name=close_price,json=closePrice,proto3" json:"close_price,omitempty"` 1108 | Profit float64 `protobuf:"fixed64,16,opt,name=profit,proto3" json:"profit,omitempty"` 1109 | Magic int32 `protobuf:"varint,17,opt,name=magic,proto3" json:"magic,omitempty"` 1110 | Comment string `protobuf:"bytes,18,opt,name=comment,proto3" json:"comment,omitempty"` 1111 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1112 | XXX_unrecognized []byte `json:"-"` 1113 | XXX_sizecache int32 `json:"-"` 1114 | } 1115 | 1116 | func (m *TradeInfo) Reset() { *m = TradeInfo{} } 1117 | func (m *TradeInfo) String() string { return proto.CompactTextString(m) } 1118 | func (*TradeInfo) ProtoMessage() {} 1119 | func (*TradeInfo) Descriptor() ([]byte, []int) { 1120 | return fileDescriptor_00212fb1f9d3bf1c, []int{17} 1121 | } 1122 | 1123 | func (m *TradeInfo) XXX_Unmarshal(b []byte) error { 1124 | return xxx_messageInfo_TradeInfo.Unmarshal(m, b) 1125 | } 1126 | func (m *TradeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1127 | return xxx_messageInfo_TradeInfo.Marshal(b, m, deterministic) 1128 | } 1129 | func (m *TradeInfo) XXX_Merge(src proto.Message) { 1130 | xxx_messageInfo_TradeInfo.Merge(m, src) 1131 | } 1132 | func (m *TradeInfo) XXX_Size() int { 1133 | return xxx_messageInfo_TradeInfo.Size(m) 1134 | } 1135 | func (m *TradeInfo) XXX_DiscardUnknown() { 1136 | xxx_messageInfo_TradeInfo.DiscardUnknown(m) 1137 | } 1138 | 1139 | var xxx_messageInfo_TradeInfo proto.InternalMessageInfo 1140 | 1141 | func (m *TradeInfo) GetTicket() int32 { 1142 | if m != nil { 1143 | return m.Ticket 1144 | } 1145 | return 0 1146 | } 1147 | 1148 | func (m *TradeInfo) GetLogin() int32 { 1149 | if m != nil { 1150 | return m.Login 1151 | } 1152 | return 0 1153 | } 1154 | 1155 | func (m *TradeInfo) GetSymbol() string { 1156 | if m != nil { 1157 | return m.Symbol 1158 | } 1159 | return "" 1160 | } 1161 | 1162 | func (m *TradeInfo) GetDigits() int32 { 1163 | if m != nil { 1164 | return m.Digits 1165 | } 1166 | return 0 1167 | } 1168 | 1169 | func (m *TradeInfo) GetCmd() Cmd { 1170 | if m != nil { 1171 | return m.Cmd 1172 | } 1173 | return Cmd_CMD_BUY 1174 | } 1175 | 1176 | func (m *TradeInfo) GetVolume() int32 { 1177 | if m != nil { 1178 | return m.Volume 1179 | } 1180 | return 0 1181 | } 1182 | 1183 | func (m *TradeInfo) GetOpenTime() int32 { 1184 | if m != nil { 1185 | return m.OpenTime 1186 | } 1187 | return 0 1188 | } 1189 | 1190 | func (m *TradeInfo) GetState() int32 { 1191 | if m != nil { 1192 | return m.State 1193 | } 1194 | return 0 1195 | } 1196 | 1197 | func (m *TradeInfo) GetOpenPrice() float64 { 1198 | if m != nil { 1199 | return m.OpenPrice 1200 | } 1201 | return 0 1202 | } 1203 | 1204 | func (m *TradeInfo) GetSl() float64 { 1205 | if m != nil { 1206 | return m.Sl 1207 | } 1208 | return 0 1209 | } 1210 | 1211 | func (m *TradeInfo) GetTp() float64 { 1212 | if m != nil { 1213 | return m.Tp 1214 | } 1215 | return 0 1216 | } 1217 | 1218 | func (m *TradeInfo) GetCloseTime() int32 { 1219 | if m != nil { 1220 | return m.CloseTime 1221 | } 1222 | return 0 1223 | } 1224 | 1225 | func (m *TradeInfo) GetExpiration() int32 { 1226 | if m != nil { 1227 | return m.Expiration 1228 | } 1229 | return 0 1230 | } 1231 | 1232 | func (m *TradeInfo) GetCommission() float64 { 1233 | if m != nil { 1234 | return m.Commission 1235 | } 1236 | return 0 1237 | } 1238 | 1239 | func (m *TradeInfo) GetClosePrice() float64 { 1240 | if m != nil { 1241 | return m.ClosePrice 1242 | } 1243 | return 0 1244 | } 1245 | 1246 | func (m *TradeInfo) GetProfit() float64 { 1247 | if m != nil { 1248 | return m.Profit 1249 | } 1250 | return 0 1251 | } 1252 | 1253 | func (m *TradeInfo) GetMagic() int32 { 1254 | if m != nil { 1255 | return m.Magic 1256 | } 1257 | return 0 1258 | } 1259 | 1260 | func (m *TradeInfo) GetComment() string { 1261 | if m != nil { 1262 | return m.Comment 1263 | } 1264 | return "" 1265 | } 1266 | 1267 | type OpenTradeRequest struct { 1268 | Login int32 `protobuf:"varint,1,opt,name=login,proto3" json:"login,omitempty"` 1269 | Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` 1270 | Cmd Cmd `protobuf:"varint,3,opt,name=cmd,proto3,enum=api_pb.Cmd" json:"cmd,omitempty"` 1271 | Price float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"` 1272 | Slippage int32 `protobuf:"varint,5,opt,name=slippage,proto3" json:"slippage,omitempty"` 1273 | Sl float64 `protobuf:"fixed64,6,opt,name=sl,proto3" json:"sl,omitempty"` 1274 | Tp float64 `protobuf:"fixed64,7,opt,name=tp,proto3" json:"tp,omitempty"` 1275 | Volume int32 `protobuf:"varint,8,opt,name=volume,proto3" json:"volume,omitempty"` 1276 | Comment string `protobuf:"bytes,9,opt,name=comment,proto3" json:"comment,omitempty"` 1277 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1278 | XXX_unrecognized []byte `json:"-"` 1279 | XXX_sizecache int32 `json:"-"` 1280 | } 1281 | 1282 | func (m *OpenTradeRequest) Reset() { *m = OpenTradeRequest{} } 1283 | func (m *OpenTradeRequest) String() string { return proto.CompactTextString(m) } 1284 | func (*OpenTradeRequest) ProtoMessage() {} 1285 | func (*OpenTradeRequest) Descriptor() ([]byte, []int) { 1286 | return fileDescriptor_00212fb1f9d3bf1c, []int{18} 1287 | } 1288 | 1289 | func (m *OpenTradeRequest) XXX_Unmarshal(b []byte) error { 1290 | return xxx_messageInfo_OpenTradeRequest.Unmarshal(m, b) 1291 | } 1292 | func (m *OpenTradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1293 | return xxx_messageInfo_OpenTradeRequest.Marshal(b, m, deterministic) 1294 | } 1295 | func (m *OpenTradeRequest) XXX_Merge(src proto.Message) { 1296 | xxx_messageInfo_OpenTradeRequest.Merge(m, src) 1297 | } 1298 | func (m *OpenTradeRequest) XXX_Size() int { 1299 | return xxx_messageInfo_OpenTradeRequest.Size(m) 1300 | } 1301 | func (m *OpenTradeRequest) XXX_DiscardUnknown() { 1302 | xxx_messageInfo_OpenTradeRequest.DiscardUnknown(m) 1303 | } 1304 | 1305 | var xxx_messageInfo_OpenTradeRequest proto.InternalMessageInfo 1306 | 1307 | func (m *OpenTradeRequest) GetLogin() int32 { 1308 | if m != nil { 1309 | return m.Login 1310 | } 1311 | return 0 1312 | } 1313 | 1314 | func (m *OpenTradeRequest) GetSymbol() string { 1315 | if m != nil { 1316 | return m.Symbol 1317 | } 1318 | return "" 1319 | } 1320 | 1321 | func (m *OpenTradeRequest) GetCmd() Cmd { 1322 | if m != nil { 1323 | return m.Cmd 1324 | } 1325 | return Cmd_CMD_BUY 1326 | } 1327 | 1328 | func (m *OpenTradeRequest) GetPrice() float64 { 1329 | if m != nil { 1330 | return m.Price 1331 | } 1332 | return 0 1333 | } 1334 | 1335 | func (m *OpenTradeRequest) GetSlippage() int32 { 1336 | if m != nil { 1337 | return m.Slippage 1338 | } 1339 | return 0 1340 | } 1341 | 1342 | func (m *OpenTradeRequest) GetSl() float64 { 1343 | if m != nil { 1344 | return m.Sl 1345 | } 1346 | return 0 1347 | } 1348 | 1349 | func (m *OpenTradeRequest) GetTp() float64 { 1350 | if m != nil { 1351 | return m.Tp 1352 | } 1353 | return 0 1354 | } 1355 | 1356 | func (m *OpenTradeRequest) GetVolume() int32 { 1357 | if m != nil { 1358 | return m.Volume 1359 | } 1360 | return 0 1361 | } 1362 | 1363 | func (m *OpenTradeRequest) GetComment() string { 1364 | if m != nil { 1365 | return m.Comment 1366 | } 1367 | return "" 1368 | } 1369 | 1370 | type OpenTradeResponse struct { 1371 | Ticket int32 `protobuf:"varint,1,opt,name=ticket,proto3" json:"ticket,omitempty"` 1372 | ErrorCode int32 `protobuf:"varint,2,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` 1373 | Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` 1374 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1375 | XXX_unrecognized []byte `json:"-"` 1376 | XXX_sizecache int32 `json:"-"` 1377 | } 1378 | 1379 | func (m *OpenTradeResponse) Reset() { *m = OpenTradeResponse{} } 1380 | func (m *OpenTradeResponse) String() string { return proto.CompactTextString(m) } 1381 | func (*OpenTradeResponse) ProtoMessage() {} 1382 | func (*OpenTradeResponse) Descriptor() ([]byte, []int) { 1383 | return fileDescriptor_00212fb1f9d3bf1c, []int{19} 1384 | } 1385 | 1386 | func (m *OpenTradeResponse) XXX_Unmarshal(b []byte) error { 1387 | return xxx_messageInfo_OpenTradeResponse.Unmarshal(m, b) 1388 | } 1389 | func (m *OpenTradeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1390 | return xxx_messageInfo_OpenTradeResponse.Marshal(b, m, deterministic) 1391 | } 1392 | func (m *OpenTradeResponse) XXX_Merge(src proto.Message) { 1393 | xxx_messageInfo_OpenTradeResponse.Merge(m, src) 1394 | } 1395 | func (m *OpenTradeResponse) XXX_Size() int { 1396 | return xxx_messageInfo_OpenTradeResponse.Size(m) 1397 | } 1398 | func (m *OpenTradeResponse) XXX_DiscardUnknown() { 1399 | xxx_messageInfo_OpenTradeResponse.DiscardUnknown(m) 1400 | } 1401 | 1402 | var xxx_messageInfo_OpenTradeResponse proto.InternalMessageInfo 1403 | 1404 | func (m *OpenTradeResponse) GetTicket() int32 { 1405 | if m != nil { 1406 | return m.Ticket 1407 | } 1408 | return 0 1409 | } 1410 | 1411 | func (m *OpenTradeResponse) GetErrorCode() int32 { 1412 | if m != nil { 1413 | return m.ErrorCode 1414 | } 1415 | return 0 1416 | } 1417 | 1418 | func (m *OpenTradeResponse) GetMessage() string { 1419 | if m != nil { 1420 | return m.Message 1421 | } 1422 | return "" 1423 | } 1424 | 1425 | type UpdateTradeRequest struct { 1426 | Ticket int32 `protobuf:"varint,1,opt,name=ticket,proto3" json:"ticket,omitempty"` 1427 | Price float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"` 1428 | Sl float64 `protobuf:"fixed64,6,opt,name=sl,proto3" json:"sl,omitempty"` 1429 | Tp float64 `protobuf:"fixed64,7,opt,name=tp,proto3" json:"tp,omitempty"` 1430 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1431 | XXX_unrecognized []byte `json:"-"` 1432 | XXX_sizecache int32 `json:"-"` 1433 | } 1434 | 1435 | func (m *UpdateTradeRequest) Reset() { *m = UpdateTradeRequest{} } 1436 | func (m *UpdateTradeRequest) String() string { return proto.CompactTextString(m) } 1437 | func (*UpdateTradeRequest) ProtoMessage() {} 1438 | func (*UpdateTradeRequest) Descriptor() ([]byte, []int) { 1439 | return fileDescriptor_00212fb1f9d3bf1c, []int{20} 1440 | } 1441 | 1442 | func (m *UpdateTradeRequest) XXX_Unmarshal(b []byte) error { 1443 | return xxx_messageInfo_UpdateTradeRequest.Unmarshal(m, b) 1444 | } 1445 | func (m *UpdateTradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1446 | return xxx_messageInfo_UpdateTradeRequest.Marshal(b, m, deterministic) 1447 | } 1448 | func (m *UpdateTradeRequest) XXX_Merge(src proto.Message) { 1449 | xxx_messageInfo_UpdateTradeRequest.Merge(m, src) 1450 | } 1451 | func (m *UpdateTradeRequest) XXX_Size() int { 1452 | return xxx_messageInfo_UpdateTradeRequest.Size(m) 1453 | } 1454 | func (m *UpdateTradeRequest) XXX_DiscardUnknown() { 1455 | xxx_messageInfo_UpdateTradeRequest.DiscardUnknown(m) 1456 | } 1457 | 1458 | var xxx_messageInfo_UpdateTradeRequest proto.InternalMessageInfo 1459 | 1460 | func (m *UpdateTradeRequest) GetTicket() int32 { 1461 | if m != nil { 1462 | return m.Ticket 1463 | } 1464 | return 0 1465 | } 1466 | 1467 | func (m *UpdateTradeRequest) GetPrice() float64 { 1468 | if m != nil { 1469 | return m.Price 1470 | } 1471 | return 0 1472 | } 1473 | 1474 | func (m *UpdateTradeRequest) GetSl() float64 { 1475 | if m != nil { 1476 | return m.Sl 1477 | } 1478 | return 0 1479 | } 1480 | 1481 | func (m *UpdateTradeRequest) GetTp() float64 { 1482 | if m != nil { 1483 | return m.Tp 1484 | } 1485 | return 0 1486 | } 1487 | 1488 | type UpdateTradeResponse struct { 1489 | ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` 1490 | Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 1491 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1492 | XXX_unrecognized []byte `json:"-"` 1493 | XXX_sizecache int32 `json:"-"` 1494 | } 1495 | 1496 | func (m *UpdateTradeResponse) Reset() { *m = UpdateTradeResponse{} } 1497 | func (m *UpdateTradeResponse) String() string { return proto.CompactTextString(m) } 1498 | func (*UpdateTradeResponse) ProtoMessage() {} 1499 | func (*UpdateTradeResponse) Descriptor() ([]byte, []int) { 1500 | return fileDescriptor_00212fb1f9d3bf1c, []int{21} 1501 | } 1502 | 1503 | func (m *UpdateTradeResponse) XXX_Unmarshal(b []byte) error { 1504 | return xxx_messageInfo_UpdateTradeResponse.Unmarshal(m, b) 1505 | } 1506 | func (m *UpdateTradeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1507 | return xxx_messageInfo_UpdateTradeResponse.Marshal(b, m, deterministic) 1508 | } 1509 | func (m *UpdateTradeResponse) XXX_Merge(src proto.Message) { 1510 | xxx_messageInfo_UpdateTradeResponse.Merge(m, src) 1511 | } 1512 | func (m *UpdateTradeResponse) XXX_Size() int { 1513 | return xxx_messageInfo_UpdateTradeResponse.Size(m) 1514 | } 1515 | func (m *UpdateTradeResponse) XXX_DiscardUnknown() { 1516 | xxx_messageInfo_UpdateTradeResponse.DiscardUnknown(m) 1517 | } 1518 | 1519 | var xxx_messageInfo_UpdateTradeResponse proto.InternalMessageInfo 1520 | 1521 | func (m *UpdateTradeResponse) GetErrorCode() int32 { 1522 | if m != nil { 1523 | return m.ErrorCode 1524 | } 1525 | return 0 1526 | } 1527 | 1528 | func (m *UpdateTradeResponse) GetMessage() string { 1529 | if m != nil { 1530 | return m.Message 1531 | } 1532 | return "" 1533 | } 1534 | 1535 | type CloseTradeRequest struct { 1536 | Ticket int32 `protobuf:"varint,1,opt,name=ticket,proto3" json:"ticket,omitempty"` 1537 | Volume int32 `protobuf:"varint,2,opt,name=volume,proto3" json:"volume,omitempty"` 1538 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1539 | XXX_unrecognized []byte `json:"-"` 1540 | XXX_sizecache int32 `json:"-"` 1541 | } 1542 | 1543 | func (m *CloseTradeRequest) Reset() { *m = CloseTradeRequest{} } 1544 | func (m *CloseTradeRequest) String() string { return proto.CompactTextString(m) } 1545 | func (*CloseTradeRequest) ProtoMessage() {} 1546 | func (*CloseTradeRequest) Descriptor() ([]byte, []int) { 1547 | return fileDescriptor_00212fb1f9d3bf1c, []int{22} 1548 | } 1549 | 1550 | func (m *CloseTradeRequest) XXX_Unmarshal(b []byte) error { 1551 | return xxx_messageInfo_CloseTradeRequest.Unmarshal(m, b) 1552 | } 1553 | func (m *CloseTradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1554 | return xxx_messageInfo_CloseTradeRequest.Marshal(b, m, deterministic) 1555 | } 1556 | func (m *CloseTradeRequest) XXX_Merge(src proto.Message) { 1557 | xxx_messageInfo_CloseTradeRequest.Merge(m, src) 1558 | } 1559 | func (m *CloseTradeRequest) XXX_Size() int { 1560 | return xxx_messageInfo_CloseTradeRequest.Size(m) 1561 | } 1562 | func (m *CloseTradeRequest) XXX_DiscardUnknown() { 1563 | xxx_messageInfo_CloseTradeRequest.DiscardUnknown(m) 1564 | } 1565 | 1566 | var xxx_messageInfo_CloseTradeRequest proto.InternalMessageInfo 1567 | 1568 | func (m *CloseTradeRequest) GetTicket() int32 { 1569 | if m != nil { 1570 | return m.Ticket 1571 | } 1572 | return 0 1573 | } 1574 | 1575 | func (m *CloseTradeRequest) GetVolume() int32 { 1576 | if m != nil { 1577 | return m.Volume 1578 | } 1579 | return 0 1580 | } 1581 | 1582 | type CloseTradeResponse struct { 1583 | ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` 1584 | Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 1585 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 1586 | XXX_unrecognized []byte `json:"-"` 1587 | XXX_sizecache int32 `json:"-"` 1588 | } 1589 | 1590 | func (m *CloseTradeResponse) Reset() { *m = CloseTradeResponse{} } 1591 | func (m *CloseTradeResponse) String() string { return proto.CompactTextString(m) } 1592 | func (*CloseTradeResponse) ProtoMessage() {} 1593 | func (*CloseTradeResponse) Descriptor() ([]byte, []int) { 1594 | return fileDescriptor_00212fb1f9d3bf1c, []int{23} 1595 | } 1596 | 1597 | func (m *CloseTradeResponse) XXX_Unmarshal(b []byte) error { 1598 | return xxx_messageInfo_CloseTradeResponse.Unmarshal(m, b) 1599 | } 1600 | func (m *CloseTradeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1601 | return xxx_messageInfo_CloseTradeResponse.Marshal(b, m, deterministic) 1602 | } 1603 | func (m *CloseTradeResponse) XXX_Merge(src proto.Message) { 1604 | xxx_messageInfo_CloseTradeResponse.Merge(m, src) 1605 | } 1606 | func (m *CloseTradeResponse) XXX_Size() int { 1607 | return xxx_messageInfo_CloseTradeResponse.Size(m) 1608 | } 1609 | func (m *CloseTradeResponse) XXX_DiscardUnknown() { 1610 | xxx_messageInfo_CloseTradeResponse.DiscardUnknown(m) 1611 | } 1612 | 1613 | var xxx_messageInfo_CloseTradeResponse proto.InternalMessageInfo 1614 | 1615 | func (m *CloseTradeResponse) GetErrorCode() int32 { 1616 | if m != nil { 1617 | return m.ErrorCode 1618 | } 1619 | return 0 1620 | } 1621 | 1622 | func (m *CloseTradeResponse) GetMessage() string { 1623 | if m != nil { 1624 | return m.Message 1625 | } 1626 | return "" 1627 | } 1628 | 1629 | func init() { 1630 | proto.RegisterEnum("api_pb.Cmd", Cmd_name, Cmd_value) 1631 | proto.RegisterType((*UserInfo)(nil), "api_pb.UserInfo") 1632 | proto.RegisterType((*UserInfoRequest)(nil), "api_pb.UserInfoRequest") 1633 | proto.RegisterType((*UserInfoResponse)(nil), "api_pb.UserInfoResponse") 1634 | proto.RegisterType((*AddUserInfo)(nil), "api_pb.AddUserInfo") 1635 | proto.RegisterType((*AddUserRequest)(nil), "api_pb.AddUserRequest") 1636 | proto.RegisterType((*AddUserResponse)(nil), "api_pb.AddUserResponse") 1637 | proto.RegisterType((*UpdateUserInfo)(nil), "api_pb.UpdateUserInfo") 1638 | proto.RegisterType((*UpdateUserRequest)(nil), "api_pb.UpdateUserRequest") 1639 | proto.RegisterType((*UpdateUserResponse)(nil), "api_pb.UpdateUserResponse") 1640 | proto.RegisterType((*DeleteUserRequest)(nil), "api_pb.DeleteUserRequest") 1641 | proto.RegisterType((*DeleteUserResponse)(nil), "api_pb.DeleteUserResponse") 1642 | proto.RegisterType((*ResetPasswordInfo)(nil), "api_pb.ResetPasswordInfo") 1643 | proto.RegisterType((*ResetPasswordRequest)(nil), "api_pb.ResetPasswordRequest") 1644 | proto.RegisterType((*ResetPasswordResponse)(nil), "api_pb.ResetPasswordResponse") 1645 | proto.RegisterType((*FundsInfo)(nil), "api_pb.FundsInfo") 1646 | proto.RegisterType((*FundsRequest)(nil), "api_pb.FundsRequest") 1647 | proto.RegisterType((*FundsResponse)(nil), "api_pb.FundsResponse") 1648 | proto.RegisterType((*TradeInfo)(nil), "api_pb.TradeInfo") 1649 | proto.RegisterType((*OpenTradeRequest)(nil), "api_pb.OpenTradeRequest") 1650 | proto.RegisterType((*OpenTradeResponse)(nil), "api_pb.OpenTradeResponse") 1651 | proto.RegisterType((*UpdateTradeRequest)(nil), "api_pb.UpdateTradeRequest") 1652 | proto.RegisterType((*UpdateTradeResponse)(nil), "api_pb.UpdateTradeResponse") 1653 | proto.RegisterType((*CloseTradeRequest)(nil), "api_pb.CloseTradeRequest") 1654 | proto.RegisterType((*CloseTradeResponse)(nil), "api_pb.CloseTradeResponse") 1655 | } 1656 | 1657 | func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } 1658 | 1659 | var fileDescriptor_00212fb1f9d3bf1c = []byte{ 1660 | // 1374 bytes of a gzipped FileDescriptorProto 1661 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0x1b, 0x45, 1662 | 0x14, 0x67, 0xed, 0x64, 0x6d, 0x3f, 0xe7, 0x8f, 0x3d, 0x4d, 0x9c, 0xad, 0x9b, 0xd0, 0x68, 0x29, 1663 | 0xa2, 0x2a, 0x22, 0x91, 0xcc, 0xad, 0x50, 0x41, 0xe2, 0xb6, 0xa8, 0xa8, 0x85, 0xca, 0x6d, 0x54, 1664 | 0xc1, 0x01, 0x6b, 0xbd, 0x3b, 0x71, 0x47, 0xd9, 0xdd, 0x59, 0x76, 0xc6, 0x29, 0x05, 0x7a, 0x80, 1665 | 0x13, 0x07, 0x4e, 0x70, 0xe1, 0xc4, 0x07, 0xe1, 0x6b, 0x70, 0x40, 0xe2, 0x0a, 0x1f, 0x00, 0x89, 1666 | 0x2f, 0x80, 0xe6, 0xcf, 0xae, 0x67, 0xfd, 0xaf, 0x49, 0xc9, 0x6d, 0xdf, 0x7b, 0x3b, 0xef, 0xcf, 1667 | 0xef, 0xf7, 0x66, 0xde, 0x83, 0x9a, 0x97, 0x90, 0xbd, 0x24, 0xa5, 0x9c, 0x22, 0xdb, 0x4b, 0x48, 1668 | 0x3f, 0x19, 0xb4, 0xb7, 0x87, 0x94, 0x0e, 0x43, 0xbc, 0xef, 0x25, 0x64, 0xdf, 0x8b, 0x63, 0xca, 1669 | 0x3d, 0x4e, 0x68, 0xcc, 0xd4, 0x5f, 0xb9, 0x55, 0x4a, 0x83, 0xd1, 0xf1, 0x3e, 0xe3, 0xe9, 0xc8, 1670 | 0xe7, 0xda, 0x7a, 0xd9, 0x38, 0xfb, 0x94, 0xf3, 0x64, 0x40, 0x83, 0xe7, 0xda, 0x74, 0x65, 0xf2, 1671 | 0x20, 0x8e, 0x12, 0x9e, 0x19, 0xb7, 0x4e, 0xbd, 0x90, 0x04, 0x1e, 0xc7, 0xfb, 0xd9, 0x87, 0x36, 1672 | 0xec, 0x4e, 0x9e, 0x3a, 0x26, 0x38, 0x0c, 0xfa, 0x91, 0xc7, 0x4e, 0xd4, 0x1f, 0xee, 0x1f, 0x16, 1673 | 0x54, 0x8f, 0x18, 0x4e, 0xef, 0xc5, 0xc7, 0x14, 0x6d, 0xc0, 0x72, 0x48, 0x87, 0x24, 0x76, 0xac, 1674 | 0x5d, 0xeb, 0xfa, 0x72, 0x4f, 0x09, 0x42, 0x3b, 0x4c, 0xe9, 0x28, 0x71, 0x4a, 0xbb, 0xd6, 0xf5, 1675 | 0x5a, 0x4f, 0x09, 0x08, 0xc1, 0x52, 0xec, 0x45, 0xd8, 0x29, 0x4b, 0xa5, 0xfc, 0x46, 0x0e, 0x54, 1676 | 0x70, 0xec, 0x0d, 0x42, 0x1c, 0x38, 0x4b, 0xd2, 0x43, 0x26, 0xa2, 0x36, 0x54, 0x43, 0x7c, 0x8a, 1677 | 0x53, 0x6f, 0x88, 0x9d, 0x65, 0x69, 0xca, 0x65, 0x71, 0x6a, 0xe0, 0x85, 0x5e, 0xec, 0x63, 0xc7, 1678 | 0xde, 0xb5, 0xae, 0x5b, 0xbd, 0x4c, 0x44, 0x2d, 0xb0, 0xfd, 0x14, 0x07, 0x84, 0x3b, 0x15, 0x69, 1679 | 0xd0, 0x12, 0x7a, 0x03, 0x56, 0xbd, 0x21, 0x8e, 0x79, 0xdf, 0xf3, 0x7d, 0x3a, 0x8a, 0xb9, 0x53, 1680 | 0x95, 0x2e, 0x57, 0xa4, 0xf2, 0x40, 0xe9, 0xdc, 0x5b, 0xb0, 0x9e, 0x15, 0xd6, 0xc3, 0x5f, 0x8e, 1681 | 0x30, 0xe3, 0xa2, 0x12, 0x4e, 0x4f, 0xb0, 0xaa, 0xaf, 0xd6, 0x53, 0xc2, 0xb8, 0xea, 0x92, 0x51, 1682 | 0xb5, 0x7b, 0x0c, 0x8d, 0xf1, 0x71, 0x96, 0xd0, 0x98, 0x61, 0x74, 0x0d, 0x96, 0x46, 0x0c, 0xa7, 1683 | 0xf2, 0x78, 0xbd, 0xd3, 0xd8, 0x53, 0x94, 0xef, 0xe5, 0xff, 0x49, 0xab, 0x40, 0xc6, 0xa7, 0x01, 1684 | 0xd6, 0xee, 0xe4, 0xb7, 0xa8, 0x31, 0xc2, 0x8c, 0x89, 0xf2, 0x15, 0x60, 0x99, 0xe8, 0xfe, 0x63, 1685 | 0x41, 0xfd, 0x20, 0x08, 0x4c, 0x0e, 0x70, 0xe4, 0x91, 0x30, 0xcb, 0x51, 0x0a, 0x02, 0xbf, 0xc4, 1686 | 0x63, 0xec, 0x19, 0x4d, 0x03, 0x4d, 0x43, 0x2e, 0xa3, 0xb7, 0xa1, 0x99, 0x7d, 0xf7, 0x49, 0x7c, 1687 | 0x8a, 0x19, 0xa7, 0xa9, 0x8e, 0xd2, 0xc8, 0x0c, 0xf7, 0xb4, 0x7e, 0x4c, 0xe6, 0xd2, 0x2c, 0x32, 1688 | 0x97, 0x0d, 0x32, 0x73, 0x58, 0x6c, 0xb3, 0x19, 0x0c, 0x8a, 0x2b, 0x45, 0x8a, 0x45, 0xd9, 0x84, 1689 | 0x3f, 0x97, 0x5c, 0xd4, 0x7a, 0xf2, 0x5b, 0xf8, 0x48, 0x9e, 0xd2, 0x18, 0x3b, 0x35, 0x15, 0x4d, 1690 | 0x0a, 0xee, 0x8f, 0x16, 0xac, 0xe9, 0x92, 0x17, 0x33, 0xf3, 0x96, 0xc6, 0xbb, 0x24, 0xf1, 0xbe, 1691 | 0x94, 0xe1, 0x6d, 0xc0, 0xa5, 0x21, 0x7f, 0x0f, 0xea, 0xa3, 0x44, 0xf4, 0xbd, 0x6c, 0x6d, 0x59, 1692 | 0x7c, 0xbd, 0xd3, 0xde, 0x53, 0xdd, 0xbf, 0x97, 0x75, 0xff, 0xde, 0x5d, 0xd1, 0xfd, 0x0f, 0x3c, 1693 | 0x76, 0xd2, 0x03, 0xf5, 0xbb, 0xf8, 0x76, 0x8f, 0x60, 0x3d, 0xcf, 0x46, 0x13, 0x3d, 0xfb, 0x22, 1694 | 0x9c, 0x8f, 0xd8, 0x7f, 0x2d, 0x58, 0x3b, 0x92, 0x51, 0x5e, 0x7e, 0xbf, 0x14, 0xe3, 0x25, 0x93, 1695 | 0xf1, 0x73, 0xdf, 0xaf, 0xbc, 0x3f, 0x96, 0xcf, 0xd2, 0x1f, 0xf6, 0xfc, 0xfe, 0x50, 0x8c, 0x55, 1696 | 0x0c, 0xc6, 0xe6, 0x71, 0xab, 0x3a, 0xa9, 0x66, 0x74, 0x92, 0xfb, 0x93, 0x05, 0xcd, 0x71, 0xd5, 1697 | 0x8b, 0xe9, 0xbd, 0x51, 0xa0, 0xb7, 0x95, 0x5f, 0xa7, 0x02, 0x68, 0x17, 0xc1, 0xf0, 0x21, 0x20, 1698 | 0x33, 0x27, 0x4d, 0x72, 0x46, 0xa7, 0x35, 0x9b, 0xce, 0x52, 0x91, 0xce, 0x0f, 0xa0, 0x79, 0x1b, 1699 | 0x87, 0xf8, 0x2c, 0x75, 0xcd, 0x7e, 0x50, 0x0e, 0x01, 0x99, 0x0e, 0x5e, 0x29, 0x89, 0x14, 0x9a, 1700 | 0x3d, 0xcc, 0x30, 0x7f, 0x98, 0xd3, 0x36, 0xb7, 0xab, 0x2e, 0xea, 0xc5, 0x70, 0x7f, 0xb1, 0x60, 1701 | 0xa3, 0x10, 0x74, 0x71, 0xf1, 0xef, 0x14, 0x48, 0xbd, 0x9c, 0x91, 0x3a, 0x95, 0xf6, 0x45, 0xf0, 1702 | 0x7a, 0x07, 0x36, 0x27, 0x32, 0x7b, 0x25, 0x54, 0x13, 0xa8, 0xdd, 0x1d, 0xc5, 0x01, 0x5b, 0x80, 1703 | 0x66, 0x0b, 0x6c, 0x2f, 0x92, 0xa3, 0xa6, 0xa4, 0x26, 0x91, 0x92, 0xd0, 0x15, 0xa8, 0x11, 0xd6, 1704 | 0xd7, 0x43, 0xaa, 0xac, 0x06, 0x1b, 0x61, 0x5d, 0x35, 0xa6, 0x1c, 0xa8, 0xf8, 0x34, 0x8a, 0x70, 1705 | 0xcc, 0xf5, 0x6b, 0x9b, 0x89, 0xee, 0x0f, 0x16, 0xac, 0xc8, 0x90, 0x8b, 0xb1, 0x7c, 0xb3, 0x80, 1706 | 0x65, 0x33, 0xc3, 0x32, 0x4f, 0xf6, 0x22, 0x30, 0x3c, 0x80, 0x55, 0x9d, 0x89, 0xc6, 0xce, 0x18, 1707 | 0xc7, 0xd6, 0xbc, 0x71, 0x5c, 0x32, 0xc7, 0xb1, 0xfb, 0x67, 0x19, 0x6a, 0x8f, 0x53, 0x2f, 0xc0, 1708 | 0x12, 0xc0, 0x16, 0xd8, 0x9c, 0xf8, 0x27, 0x98, 0x6b, 0x04, 0xb5, 0x34, 0xfb, 0x56, 0x88, 0xbf, 1709 | 0xd9, 0xf3, 0x68, 0x40, 0x43, 0xdd, 0x7f, 0x5a, 0x12, 0xfa, 0x80, 0x0c, 0x09, 0x67, 0xfa, 0xa5, 1710 | 0xd3, 0x12, 0xda, 0x81, 0xb2, 0x1f, 0xa9, 0x37, 0x6e, 0xad, 0x53, 0xcf, 0x10, 0xe9, 0x46, 0x41, 1711 | 0x4f, 0xe8, 0xc5, 0xb1, 0x53, 0x1a, 0x8e, 0x22, 0xac, 0xa7, 0x96, 0x96, 0x04, 0x4f, 0x34, 0xc1, 1712 | 0x71, 0x9f, 0x93, 0x08, 0xeb, 0xc1, 0x55, 0x15, 0x8a, 0xc7, 0x44, 0x4d, 0x3a, 0xc6, 0x3d, 0x8e, 1713 | 0xf5, 0x1a, 0xa1, 0x04, 0xb4, 0x03, 0x20, 0x8f, 0x24, 0x29, 0xf1, 0xd5, 0x00, 0xb3, 0x7a, 0xd2, 1714 | 0xc9, 0x43, 0xa1, 0x40, 0x6b, 0x50, 0x62, 0xa1, 0x03, 0x52, 0x5d, 0x62, 0xa1, 0x90, 0x79, 0xe2, 1715 | 0xd4, 0x95, 0xcc, 0x13, 0x71, 0xdc, 0x0f, 0x29, 0xc3, 0x2a, 0xe4, 0x8a, 0xf4, 0x5c, 0x93, 0x1a, 1716 | 0x19, 0xf3, 0x75, 0x00, 0xfc, 0x55, 0x42, 0x52, 0xb9, 0x1d, 0x3a, 0xab, 0xd2, 0x6c, 0x68, 0x84, 1717 | 0x5d, 0x34, 0x0b, 0x61, 0x4c, 0xd8, 0xd7, 0xa4, 0x5b, 0x43, 0x83, 0xae, 0x42, 0x5d, 0xb9, 0x57, 1718 | 0xe9, 0xad, 0xeb, 0x1f, 0x84, 0x4a, 0xe5, 0xd7, 0x02, 0x3b, 0x49, 0xe9, 0x31, 0xe1, 0x4e, 0x43, 1719 | 0x91, 0xa5, 0x24, 0x51, 0x6c, 0xe4, 0x0d, 0x89, 0xef, 0x34, 0x55, 0xb1, 0x52, 0x30, 0x5b, 0x15, 1720 | 0x15, 0x5b, 0xf5, 0x2f, 0x0b, 0x1a, 0x9f, 0x0a, 0xa4, 0x04, 0xc1, 0x46, 0xbb, 0xce, 0xbe, 0x24, 1721 | 0x9a, 0xcb, 0x52, 0x81, 0x4b, 0xcd, 0x59, 0x79, 0x0e, 0x67, 0x62, 0xe4, 0xc8, 0x22, 0x96, 0x64, 1722 | 0xa2, 0x4a, 0x10, 0xef, 0x17, 0x0b, 0x49, 0x92, 0x18, 0x1b, 0x63, 0x26, 0x6b, 0xec, 0xed, 0x09, 1723 | 0xec, 0x2b, 0x39, 0xf6, 0xe3, 0x2e, 0xa8, 0x16, 0xba, 0xc0, 0xa8, 0xb2, 0x56, 0xac, 0x32, 0x80, 1724 | 0xa6, 0x51, 0xa4, 0xbe, 0x09, 0xf3, 0x3a, 0x79, 0x07, 0x00, 0xa7, 0x29, 0x4d, 0xfb, 0xc6, 0x36, 1725 | 0x50, 0x93, 0x9a, 0xee, 0xe2, 0x95, 0x60, 0x90, 0xcd, 0xa1, 0x02, 0x98, 0x0b, 0x2e, 0xcc, 0x0c, 1726 | 0x5c, 0x5e, 0x52, 0xbb, 0xfb, 0x09, 0x5c, 0x2a, 0xc4, 0xd0, 0xb5, 0x14, 0x73, 0xb6, 0x16, 0xe4, 1727 | 0x3c, 0xf1, 0x38, 0x76, 0xa1, 0xd9, 0x95, 0x5d, 0x7b, 0x96, 0x94, 0xc7, 0xc0, 0x97, 0x4c, 0xe0, 1728 | 0xdd, 0x07, 0x80, 0x4c, 0x27, 0xff, 0x33, 0xa7, 0x1b, 0xbb, 0x50, 0xee, 0x46, 0x01, 0xaa, 0x43, 1729 | 0xa5, 0xfb, 0xe0, 0x76, 0xff, 0xf0, 0xe8, 0xb3, 0xc6, 0x6b, 0x68, 0x05, 0xaa, 0x42, 0x78, 0x74, 1730 | 0xe7, 0xfe, 0xfd, 0x86, 0xd5, 0xf9, 0xcd, 0x86, 0xba, 0x98, 0xb3, 0x8f, 0x70, 0x7a, 0x2a, 0x50, 1731 | 0x7b, 0x04, 0x95, 0x8f, 0x30, 0x97, 0xef, 0xd3, 0xd6, 0xd4, 0xda, 0xae, 0x8a, 0x6a, 0x3b, 0xd3, 1732 | 0x06, 0x95, 0xa8, 0xbb, 0xf9, 0xfd, 0xef, 0x7f, 0xff, 0x5c, 0x5a, 0x47, 0xab, 0xfb, 0xe2, 0xbd, 1733 | 0xdd, 0xff, 0x46, 0xb6, 0xfb, 0x0b, 0xf4, 0x05, 0xd8, 0x6a, 0xa2, 0xa3, 0x7c, 0xcc, 0x4d, 0xad, 1734 | 0x08, 0xed, 0xf6, 0x2c, 0x93, 0xf6, 0xbb, 0x23, 0xfd, 0x6e, 0xdd, 0xd8, 0xd4, 0x7e, 0xe5, 0xab, 1735 | 0xff, 0x22, 0xf7, 0xff, 0x04, 0xca, 0x07, 0x41, 0x80, 0x5a, 0x13, 0x7b, 0x6f, 0xe6, 0x79, 0x6b, 1736 | 0x4a, 0xaf, 0xdd, 0x5e, 0x95, 0x6e, 0x2f, 0xbb, 0x4d, 0xe5, 0xd6, 0x0b, 0x82, 0xcc, 0xf5, 0x4d, 1737 | 0x35, 0x30, 0xbe, 0xb3, 0xc0, 0x56, 0x4d, 0x32, 0xce, 0x7c, 0x6a, 0x69, 0x1b, 0x67, 0x3e, 0xbd, 1738 | 0x3b, 0xb9, 0x1f, 0xca, 0x10, 0x37, 0xdb, 0x1b, 0x2a, 0x84, 0x9a, 0x27, 0xc5, 0x28, 0x9f, 0x6f, 1739 | 0x77, 0x16, 0x58, 0xd1, 0xb7, 0x50, 0x7d, 0x42, 0xf8, 0xd3, 0x20, 0xf5, 0x9e, 0xa1, 0x8d, 0xc2, 1740 | 0x64, 0xcb, 0xe2, 0x6f, 0x4e, 0x68, 0x75, 0xe8, 0xae, 0x0c, 0x7d, 0xab, 0xdd, 0x52, 0xce, 0x9f, 1741 | 0x69, 0x27, 0x13, 0xc1, 0x77, 0x3a, 0x9b, 0x63, 0xfb, 0x94, 0x19, 0x7d, 0x0d, 0x95, 0xdb, 0x38, 1742 | 0xa1, 0x4c, 0x3c, 0x88, 0xe7, 0x09, 0x7e, 0x28, 0x83, 0xbf, 0xdf, 0xd6, 0xce, 0x03, 0xe5, 0x63, 1743 | 0x5e, 0xec, 0x99, 0x66, 0xf4, 0xab, 0x05, 0xab, 0x85, 0xb5, 0x05, 0x6d, 0xcf, 0xdc, 0x92, 0xb2, 1744 | 0x54, 0x76, 0xe6, 0x58, 0x75, 0x4a, 0x0f, 0x65, 0x4a, 0x1f, 0xb7, 0xb7, 0x55, 0xcc, 0x54, 0xfc, 1745 | 0xd4, 0xcf, 0xb6, 0xb8, 0x89, 0xcc, 0xae, 0x75, 0xce, 0xf0, 0xd7, 0xc0, 0x96, 0x2b, 0xc3, 0xbb, 1746 | 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x7f, 0xd3, 0x08, 0xde, 0x10, 0x00, 0x00, 1747 | } 1748 | 1749 | // Reference imports to suppress errors if they are not otherwise used. 1750 | var _ context.Context 1751 | var _ grpc.ClientConnInterface 1752 | 1753 | // This is a compile-time assertion to ensure that this generated file 1754 | // is compatible with the grpc package it is being compiled against. 1755 | const _ = grpc.SupportPackageIsVersion6 1756 | 1757 | // UserServiceClient is the client API for UserService service. 1758 | // 1759 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 1760 | type UserServiceClient interface { 1761 | GetInfo(ctx context.Context, in *UserInfoRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) 1762 | Delete(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) 1763 | Add(ctx context.Context, in *AddUserRequest, opts ...grpc.CallOption) (*AddUserResponse, error) 1764 | Update(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) 1765 | Withdraw(ctx context.Context, in *FundsRequest, opts ...grpc.CallOption) (*FundsResponse, error) 1766 | Deposit(ctx context.Context, in *FundsRequest, opts ...grpc.CallOption) (*FundsResponse, error) 1767 | ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error) 1768 | } 1769 | 1770 | type userServiceClient struct { 1771 | cc grpc.ClientConnInterface 1772 | } 1773 | 1774 | func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { 1775 | return &userServiceClient{cc} 1776 | } 1777 | 1778 | func (c *userServiceClient) GetInfo(ctx context.Context, in *UserInfoRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) { 1779 | out := new(UserInfoResponse) 1780 | err := c.cc.Invoke(ctx, "/api_pb.UserService/GetInfo", in, out, opts...) 1781 | if err != nil { 1782 | return nil, err 1783 | } 1784 | return out, nil 1785 | } 1786 | 1787 | func (c *userServiceClient) Delete(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) { 1788 | out := new(DeleteUserResponse) 1789 | err := c.cc.Invoke(ctx, "/api_pb.UserService/Delete", in, out, opts...) 1790 | if err != nil { 1791 | return nil, err 1792 | } 1793 | return out, nil 1794 | } 1795 | 1796 | func (c *userServiceClient) Add(ctx context.Context, in *AddUserRequest, opts ...grpc.CallOption) (*AddUserResponse, error) { 1797 | out := new(AddUserResponse) 1798 | err := c.cc.Invoke(ctx, "/api_pb.UserService/Add", in, out, opts...) 1799 | if err != nil { 1800 | return nil, err 1801 | } 1802 | return out, nil 1803 | } 1804 | 1805 | func (c *userServiceClient) Update(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) { 1806 | out := new(UpdateUserResponse) 1807 | err := c.cc.Invoke(ctx, "/api_pb.UserService/Update", in, out, opts...) 1808 | if err != nil { 1809 | return nil, err 1810 | } 1811 | return out, nil 1812 | } 1813 | 1814 | func (c *userServiceClient) Withdraw(ctx context.Context, in *FundsRequest, opts ...grpc.CallOption) (*FundsResponse, error) { 1815 | out := new(FundsResponse) 1816 | err := c.cc.Invoke(ctx, "/api_pb.UserService/Withdraw", in, out, opts...) 1817 | if err != nil { 1818 | return nil, err 1819 | } 1820 | return out, nil 1821 | } 1822 | 1823 | func (c *userServiceClient) Deposit(ctx context.Context, in *FundsRequest, opts ...grpc.CallOption) (*FundsResponse, error) { 1824 | out := new(FundsResponse) 1825 | err := c.cc.Invoke(ctx, "/api_pb.UserService/Deposit", in, out, opts...) 1826 | if err != nil { 1827 | return nil, err 1828 | } 1829 | return out, nil 1830 | } 1831 | 1832 | func (c *userServiceClient) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error) { 1833 | out := new(ResetPasswordResponse) 1834 | err := c.cc.Invoke(ctx, "/api_pb.UserService/ResetPassword", in, out, opts...) 1835 | if err != nil { 1836 | return nil, err 1837 | } 1838 | return out, nil 1839 | } 1840 | 1841 | // UserServiceServer is the server API for UserService service. 1842 | type UserServiceServer interface { 1843 | GetInfo(context.Context, *UserInfoRequest) (*UserInfoResponse, error) 1844 | Delete(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) 1845 | Add(context.Context, *AddUserRequest) (*AddUserResponse, error) 1846 | Update(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) 1847 | Withdraw(context.Context, *FundsRequest) (*FundsResponse, error) 1848 | Deposit(context.Context, *FundsRequest) (*FundsResponse, error) 1849 | ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error) 1850 | } 1851 | 1852 | // UnimplementedUserServiceServer can be embedded to have forward compatible implementations. 1853 | type UnimplementedUserServiceServer struct { 1854 | } 1855 | 1856 | func (*UnimplementedUserServiceServer) GetInfo(ctx context.Context, req *UserInfoRequest) (*UserInfoResponse, error) { 1857 | return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") 1858 | } 1859 | func (*UnimplementedUserServiceServer) Delete(ctx context.Context, req *DeleteUserRequest) (*DeleteUserResponse, error) { 1860 | return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") 1861 | } 1862 | func (*UnimplementedUserServiceServer) Add(ctx context.Context, req *AddUserRequest) (*AddUserResponse, error) { 1863 | return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") 1864 | } 1865 | func (*UnimplementedUserServiceServer) Update(ctx context.Context, req *UpdateUserRequest) (*UpdateUserResponse, error) { 1866 | return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") 1867 | } 1868 | func (*UnimplementedUserServiceServer) Withdraw(ctx context.Context, req *FundsRequest) (*FundsResponse, error) { 1869 | return nil, status.Errorf(codes.Unimplemented, "method Withdraw not implemented") 1870 | } 1871 | func (*UnimplementedUserServiceServer) Deposit(ctx context.Context, req *FundsRequest) (*FundsResponse, error) { 1872 | return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") 1873 | } 1874 | func (*UnimplementedUserServiceServer) ResetPassword(ctx context.Context, req *ResetPasswordRequest) (*ResetPasswordResponse, error) { 1875 | return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented") 1876 | } 1877 | 1878 | func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer) { 1879 | s.RegisterService(&_UserService_serviceDesc, srv) 1880 | } 1881 | 1882 | func _UserService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1883 | in := new(UserInfoRequest) 1884 | if err := dec(in); err != nil { 1885 | return nil, err 1886 | } 1887 | if interceptor == nil { 1888 | return srv.(UserServiceServer).GetInfo(ctx, in) 1889 | } 1890 | info := &grpc.UnaryServerInfo{ 1891 | Server: srv, 1892 | FullMethod: "/api_pb.UserService/GetInfo", 1893 | } 1894 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1895 | return srv.(UserServiceServer).GetInfo(ctx, req.(*UserInfoRequest)) 1896 | } 1897 | return interceptor(ctx, in, info, handler) 1898 | } 1899 | 1900 | func _UserService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1901 | in := new(DeleteUserRequest) 1902 | if err := dec(in); err != nil { 1903 | return nil, err 1904 | } 1905 | if interceptor == nil { 1906 | return srv.(UserServiceServer).Delete(ctx, in) 1907 | } 1908 | info := &grpc.UnaryServerInfo{ 1909 | Server: srv, 1910 | FullMethod: "/api_pb.UserService/Delete", 1911 | } 1912 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1913 | return srv.(UserServiceServer).Delete(ctx, req.(*DeleteUserRequest)) 1914 | } 1915 | return interceptor(ctx, in, info, handler) 1916 | } 1917 | 1918 | func _UserService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1919 | in := new(AddUserRequest) 1920 | if err := dec(in); err != nil { 1921 | return nil, err 1922 | } 1923 | if interceptor == nil { 1924 | return srv.(UserServiceServer).Add(ctx, in) 1925 | } 1926 | info := &grpc.UnaryServerInfo{ 1927 | Server: srv, 1928 | FullMethod: "/api_pb.UserService/Add", 1929 | } 1930 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1931 | return srv.(UserServiceServer).Add(ctx, req.(*AddUserRequest)) 1932 | } 1933 | return interceptor(ctx, in, info, handler) 1934 | } 1935 | 1936 | func _UserService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1937 | in := new(UpdateUserRequest) 1938 | if err := dec(in); err != nil { 1939 | return nil, err 1940 | } 1941 | if interceptor == nil { 1942 | return srv.(UserServiceServer).Update(ctx, in) 1943 | } 1944 | info := &grpc.UnaryServerInfo{ 1945 | Server: srv, 1946 | FullMethod: "/api_pb.UserService/Update", 1947 | } 1948 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1949 | return srv.(UserServiceServer).Update(ctx, req.(*UpdateUserRequest)) 1950 | } 1951 | return interceptor(ctx, in, info, handler) 1952 | } 1953 | 1954 | func _UserService_Withdraw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1955 | in := new(FundsRequest) 1956 | if err := dec(in); err != nil { 1957 | return nil, err 1958 | } 1959 | if interceptor == nil { 1960 | return srv.(UserServiceServer).Withdraw(ctx, in) 1961 | } 1962 | info := &grpc.UnaryServerInfo{ 1963 | Server: srv, 1964 | FullMethod: "/api_pb.UserService/Withdraw", 1965 | } 1966 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1967 | return srv.(UserServiceServer).Withdraw(ctx, req.(*FundsRequest)) 1968 | } 1969 | return interceptor(ctx, in, info, handler) 1970 | } 1971 | 1972 | func _UserService_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1973 | in := new(FundsRequest) 1974 | if err := dec(in); err != nil { 1975 | return nil, err 1976 | } 1977 | if interceptor == nil { 1978 | return srv.(UserServiceServer).Deposit(ctx, in) 1979 | } 1980 | info := &grpc.UnaryServerInfo{ 1981 | Server: srv, 1982 | FullMethod: "/api_pb.UserService/Deposit", 1983 | } 1984 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1985 | return srv.(UserServiceServer).Deposit(ctx, req.(*FundsRequest)) 1986 | } 1987 | return interceptor(ctx, in, info, handler) 1988 | } 1989 | 1990 | func _UserService_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1991 | in := new(ResetPasswordRequest) 1992 | if err := dec(in); err != nil { 1993 | return nil, err 1994 | } 1995 | if interceptor == nil { 1996 | return srv.(UserServiceServer).ResetPassword(ctx, in) 1997 | } 1998 | info := &grpc.UnaryServerInfo{ 1999 | Server: srv, 2000 | FullMethod: "/api_pb.UserService/ResetPassword", 2001 | } 2002 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 2003 | return srv.(UserServiceServer).ResetPassword(ctx, req.(*ResetPasswordRequest)) 2004 | } 2005 | return interceptor(ctx, in, info, handler) 2006 | } 2007 | 2008 | var _UserService_serviceDesc = grpc.ServiceDesc{ 2009 | ServiceName: "api_pb.UserService", 2010 | HandlerType: (*UserServiceServer)(nil), 2011 | Methods: []grpc.MethodDesc{ 2012 | { 2013 | MethodName: "GetInfo", 2014 | Handler: _UserService_GetInfo_Handler, 2015 | }, 2016 | { 2017 | MethodName: "Delete", 2018 | Handler: _UserService_Delete_Handler, 2019 | }, 2020 | { 2021 | MethodName: "Add", 2022 | Handler: _UserService_Add_Handler, 2023 | }, 2024 | { 2025 | MethodName: "Update", 2026 | Handler: _UserService_Update_Handler, 2027 | }, 2028 | { 2029 | MethodName: "Withdraw", 2030 | Handler: _UserService_Withdraw_Handler, 2031 | }, 2032 | { 2033 | MethodName: "Deposit", 2034 | Handler: _UserService_Deposit_Handler, 2035 | }, 2036 | { 2037 | MethodName: "ResetPassword", 2038 | Handler: _UserService_ResetPassword_Handler, 2039 | }, 2040 | }, 2041 | Streams: []grpc.StreamDesc{}, 2042 | Metadata: "api.proto", 2043 | } 2044 | --------------------------------------------------------------------------------