wallet_grpc.pb.go534 lines, 21 KB
| 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| 2 | // versions: |
| 3 | // - protoc-gen-go-grpc v1.6.2 |
| 4 | // - protoc (unknown) |
| 5 | // source: wallet/v1/wallet.proto |
| 6 | |
| 7 | // Version 1 of the wallet's API. A breaking change means a new package, |
| 8 | // wallet.v2, served next to this one until every client has moved. |
| 9 | |
| 10 | package walletv1 |
| 11 | |
| 12 | import ( |
| 13 | context "context" |
| 14 | grpc "google.golang.org/grpc" |
| 15 | codes "google.golang.org/grpc/codes" |
| 16 | status "google.golang.org/grpc/status" |
| 17 | ) |
| 18 | |
| 19 | // This is a compile-time assertion to ensure that this generated file |
| 20 | // is compatible with the grpc package it is being compiled against. |
| 21 | // Requires gRPC-Go v1.64.0 or later. |
| 22 | const _ = grpc.SupportPackageIsVersion9 |
| 23 | |
| 24 | const ( |
| 25 | WalletService_CreateWallet_FullMethodName = "/wallet.v1.WalletService/CreateWallet" |
| 26 | WalletService_GetWallet_FullMethodName = "/wallet.v1.WalletService/GetWallet" |
| 27 | WalletService_GetBalance_FullMethodName = "/wallet.v1.WalletService/GetBalance" |
| 28 | WalletService_Deposit_FullMethodName = "/wallet.v1.WalletService/Deposit" |
| 29 | WalletService_Transfer_FullMethodName = "/wallet.v1.WalletService/Transfer" |
| 30 | ) |
| 31 | |
| 32 | // WalletServiceClient is the client API for WalletService service. |
| 33 | // |
| 34 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| 35 | // |
| 36 | // WalletService is the wallet's API for our other services. Clients outside |
| 37 | // the cluster use the REST API, through the gateway. |
| 38 | type WalletServiceClient interface { |
| 39 | // CreateWallet opens a wallet for the caller, in one currency. A user has at |
| 40 | // most one wallet per currency. |
| 41 | CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) |
| 42 | // GetWallet returns a wallet. |
| 43 | GetWallet(ctx context.Context, in *GetWalletRequest, opts ...grpc.CallOption) (*GetWalletResponse, error) |
| 44 | // GetBalance returns a wallet's balance, derived from its ledger entries. |
| 45 | GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) |
| 46 | // Deposit adds money from outside to one of the caller's wallets, once per |
| 47 | // idempotency key, like Transfer. |
| 48 | Deposit(ctx context.Context, in *DepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) |
| 49 | // Transfer moves money between two wallets in the same currency. It runs |
| 50 | // once per idempotency key: a retry with the same key returns the first |
| 51 | // response, and moves nothing. |
| 52 | Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error) |
| 53 | } |
| 54 | |
| 55 | type walletServiceClient struct { |
| 56 | cc grpc.ClientConnInterface |
| 57 | } |
| 58 | |
| 59 | func NewWalletServiceClient(cc grpc.ClientConnInterface) WalletServiceClient { |
| 60 | return &walletServiceClient{cc} |
| 61 | } |
| 62 | |
| 63 | func (c *walletServiceClient) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) { |
| 64 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 65 | out := new(CreateWalletResponse) |
| 66 | err := c.cc.Invoke(ctx, WalletService_CreateWallet_FullMethodName, in, out, cOpts...) |
| 67 | if err != nil { |
| 68 | return nil, err |
| 69 | } |
| 70 | return out, nil |
| 71 | } |
| 72 | |
| 73 | func (c *walletServiceClient) GetWallet(ctx context.Context, in *GetWalletRequest, opts ...grpc.CallOption) (*GetWalletResponse, error) { |
| 74 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 75 | out := new(GetWalletResponse) |
| 76 | err := c.cc.Invoke(ctx, WalletService_GetWallet_FullMethodName, in, out, cOpts...) |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | return out, nil |
| 81 | } |
| 82 | |
| 83 | func (c *walletServiceClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { |
| 84 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 85 | out := new(GetBalanceResponse) |
| 86 | err := c.cc.Invoke(ctx, WalletService_GetBalance_FullMethodName, in, out, cOpts...) |
| 87 | if err != nil { |
| 88 | return nil, err |
| 89 | } |
| 90 | return out, nil |
| 91 | } |
| 92 | |
| 93 | func (c *walletServiceClient) Deposit(ctx context.Context, in *DepositRequest, opts ...grpc.CallOption) (*DepositResponse, error) { |
| 94 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 95 | out := new(DepositResponse) |
| 96 | err := c.cc.Invoke(ctx, WalletService_Deposit_FullMethodName, in, out, cOpts...) |
| 97 | if err != nil { |
| 98 | return nil, err |
| 99 | } |
| 100 | return out, nil |
| 101 | } |
| 102 | |
| 103 | func (c *walletServiceClient) Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error) { |
| 104 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 105 | out := new(TransferResponse) |
| 106 | err := c.cc.Invoke(ctx, WalletService_Transfer_FullMethodName, in, out, cOpts...) |
| 107 | if err != nil { |
| 108 | return nil, err |
| 109 | } |
| 110 | return out, nil |
| 111 | } |
| 112 | |
| 113 | // WalletServiceServer is the server API for WalletService service. |
| 114 | // All implementations must embed UnimplementedWalletServiceServer |
| 115 | // for forward compatibility. |
| 116 | // |
| 117 | // WalletService is the wallet's API for our other services. Clients outside |
| 118 | // the cluster use the REST API, through the gateway. |
| 119 | type WalletServiceServer interface { |
| 120 | // CreateWallet opens a wallet for the caller, in one currency. A user has at |
| 121 | // most one wallet per currency. |
| 122 | CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) |
| 123 | // GetWallet returns a wallet. |
| 124 | GetWallet(context.Context, *GetWalletRequest) (*GetWalletResponse, error) |
| 125 | // GetBalance returns a wallet's balance, derived from its ledger entries. |
| 126 | GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) |
| 127 | // Deposit adds money from outside to one of the caller's wallets, once per |
| 128 | // idempotency key, like Transfer. |
| 129 | Deposit(context.Context, *DepositRequest) (*DepositResponse, error) |
| 130 | // Transfer moves money between two wallets in the same currency. It runs |
| 131 | // once per idempotency key: a retry with the same key returns the first |
| 132 | // response, and moves nothing. |
| 133 | Transfer(context.Context, *TransferRequest) (*TransferResponse, error) |
| 134 | mustEmbedUnimplementedWalletServiceServer() |
| 135 | } |
| 136 | |
| 137 | // UnimplementedWalletServiceServer must be embedded to have |
| 138 | // forward compatible implementations. |
| 139 | // |
| 140 | // NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 141 | // pointer dereference when methods are called. |
| 142 | type UnimplementedWalletServiceServer struct{} |
| 143 | |
| 144 | func (UnimplementedWalletServiceServer) CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) { |
| 145 | return nil, status.Error(codes.Unimplemented, "method CreateWallet not implemented") |
| 146 | } |
| 147 | func (UnimplementedWalletServiceServer) GetWallet(context.Context, *GetWalletRequest) (*GetWalletResponse, error) { |
| 148 | return nil, status.Error(codes.Unimplemented, "method GetWallet not implemented") |
| 149 | } |
| 150 | func (UnimplementedWalletServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) { |
| 151 | return nil, status.Error(codes.Unimplemented, "method GetBalance not implemented") |
| 152 | } |
| 153 | func (UnimplementedWalletServiceServer) Deposit(context.Context, *DepositRequest) (*DepositResponse, error) { |
| 154 | return nil, status.Error(codes.Unimplemented, "method Deposit not implemented") |
| 155 | } |
| 156 | func (UnimplementedWalletServiceServer) Transfer(context.Context, *TransferRequest) (*TransferResponse, error) { |
| 157 | return nil, status.Error(codes.Unimplemented, "method Transfer not implemented") |
| 158 | } |
| 159 | func (UnimplementedWalletServiceServer) mustEmbedUnimplementedWalletServiceServer() {} |
| 160 | func (UnimplementedWalletServiceServer) testEmbeddedByValue() {} |
| 161 | |
| 162 | // UnsafeWalletServiceServer may be embedded to opt out of forward compatibility for this service. |
| 163 | // Use of this interface is not recommended, as added methods to WalletServiceServer will |
| 164 | // result in compilation errors. |
| 165 | type UnsafeWalletServiceServer interface { |
| 166 | mustEmbedUnimplementedWalletServiceServer() |
| 167 | } |
| 168 | |
| 169 | func RegisterWalletServiceServer(s grpc.ServiceRegistrar, srv WalletServiceServer) { |
| 170 | // If the following call panics, it indicates UnimplementedWalletServiceServer was |
| 171 | // embedded by pointer and is nil. This will cause panics if an |
| 172 | // unimplemented method is ever invoked, so we test this at initialization |
| 173 | // time to prevent it from happening at runtime later due to I/O. |
| 174 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 175 | t.testEmbeddedByValue() |
| 176 | } |
| 177 | s.RegisterService(&WalletService_ServiceDesc, srv) |
| 178 | } |
| 179 | |
| 180 | func _WalletService_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 181 | in := new(CreateWalletRequest) |
| 182 | if err := dec(in); err != nil { |
| 183 | return nil, err |
| 184 | } |
| 185 | if interceptor == nil { |
| 186 | return srv.(WalletServiceServer).CreateWallet(ctx, in) |
| 187 | } |
| 188 | info := &grpc.UnaryServerInfo{ |
| 189 | Server: srv, |
| 190 | FullMethod: WalletService_CreateWallet_FullMethodName, |
| 191 | } |
| 192 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 193 | return srv.(WalletServiceServer).CreateWallet(ctx, req.(*CreateWalletRequest)) |
| 194 | } |
| 195 | return interceptor(ctx, in, info, handler) |
| 196 | } |
| 197 | |
| 198 | func _WalletService_GetWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 199 | in := new(GetWalletRequest) |
| 200 | if err := dec(in); err != nil { |
| 201 | return nil, err |
| 202 | } |
| 203 | if interceptor == nil { |
| 204 | return srv.(WalletServiceServer).GetWallet(ctx, in) |
| 205 | } |
| 206 | info := &grpc.UnaryServerInfo{ |
| 207 | Server: srv, |
| 208 | FullMethod: WalletService_GetWallet_FullMethodName, |
| 209 | } |
| 210 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 211 | return srv.(WalletServiceServer).GetWallet(ctx, req.(*GetWalletRequest)) |
| 212 | } |
| 213 | return interceptor(ctx, in, info, handler) |
| 214 | } |
| 215 | |
| 216 | func _WalletService_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 217 | in := new(GetBalanceRequest) |
| 218 | if err := dec(in); err != nil { |
| 219 | return nil, err |
| 220 | } |
| 221 | if interceptor == nil { |
| 222 | return srv.(WalletServiceServer).GetBalance(ctx, in) |
| 223 | } |
| 224 | info := &grpc.UnaryServerInfo{ |
| 225 | Server: srv, |
| 226 | FullMethod: WalletService_GetBalance_FullMethodName, |
| 227 | } |
| 228 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 229 | return srv.(WalletServiceServer).GetBalance(ctx, req.(*GetBalanceRequest)) |
| 230 | } |
| 231 | return interceptor(ctx, in, info, handler) |
| 232 | } |
| 233 | |
| 234 | func _WalletService_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 235 | in := new(DepositRequest) |
| 236 | if err := dec(in); err != nil { |
| 237 | return nil, err |
| 238 | } |
| 239 | if interceptor == nil { |
| 240 | return srv.(WalletServiceServer).Deposit(ctx, in) |
| 241 | } |
| 242 | info := &grpc.UnaryServerInfo{ |
| 243 | Server: srv, |
| 244 | FullMethod: WalletService_Deposit_FullMethodName, |
| 245 | } |
| 246 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 247 | return srv.(WalletServiceServer).Deposit(ctx, req.(*DepositRequest)) |
| 248 | } |
| 249 | return interceptor(ctx, in, info, handler) |
| 250 | } |
| 251 | |
| 252 | func _WalletService_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 253 | in := new(TransferRequest) |
| 254 | if err := dec(in); err != nil { |
| 255 | return nil, err |
| 256 | } |
| 257 | if interceptor == nil { |
| 258 | return srv.(WalletServiceServer).Transfer(ctx, in) |
| 259 | } |
| 260 | info := &grpc.UnaryServerInfo{ |
| 261 | Server: srv, |
| 262 | FullMethod: WalletService_Transfer_FullMethodName, |
| 263 | } |
| 264 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 265 | return srv.(WalletServiceServer).Transfer(ctx, req.(*TransferRequest)) |
| 266 | } |
| 267 | return interceptor(ctx, in, info, handler) |
| 268 | } |
| 269 | |
| 270 | // WalletService_ServiceDesc is the grpc.ServiceDesc for WalletService service. |
| 271 | // It's only intended for direct use with grpc.RegisterService, |
| 272 | // and not to be introspected or modified (even as a copy) |
| 273 | var WalletService_ServiceDesc = grpc.ServiceDesc{ |
| 274 | ServiceName: "wallet.v1.WalletService", |
| 275 | HandlerType: (*WalletServiceServer)(nil), |
| 276 | Methods: []grpc.MethodDesc{ |
| 277 | { |
| 278 | MethodName: "CreateWallet", |
| 279 | Handler: _WalletService_CreateWallet_Handler, |
| 280 | }, |
| 281 | { |
| 282 | MethodName: "GetWallet", |
| 283 | Handler: _WalletService_GetWallet_Handler, |
| 284 | }, |
| 285 | { |
| 286 | MethodName: "GetBalance", |
| 287 | Handler: _WalletService_GetBalance_Handler, |
| 288 | }, |
| 289 | { |
| 290 | MethodName: "Deposit", |
| 291 | Handler: _WalletService_Deposit_Handler, |
| 292 | }, |
| 293 | { |
| 294 | MethodName: "Transfer", |
| 295 | Handler: _WalletService_Transfer_Handler, |
| 296 | }, |
| 297 | }, |
| 298 | Streams: []grpc.StreamDesc{}, |
| 299 | Metadata: "wallet/v1/wallet.proto", |
| 300 | } |
| 301 | |
| 302 | const ( |
| 303 | HoldService_Hold_FullMethodName = "/wallet.v1.HoldService/Hold" |
| 304 | HoldService_Capture_FullMethodName = "/wallet.v1.HoldService/Capture" |
| 305 | HoldService_Release_FullMethodName = "/wallet.v1.HoldService/Release" |
| 306 | HoldService_DescribeWallet_FullMethodName = "/wallet.v1.HoldService/DescribeWallet" |
| 307 | ) |
| 308 | |
| 309 | // HoldServiceClient is the client API for HoldService service. |
| 310 | // |
| 311 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| 312 | // |
| 313 | // HoldService sets money aside for operations that take several steps, like |
| 314 | // a transfer saga. Its callers are our services, so requests name the user |
| 315 | // they act for. Every call is safe to repeat: the hold ID is the key. |
| 316 | type HoldServiceClient interface { |
| 317 | // Hold moves money out of a wallet into a hold, if the wallet can cover it. |
| 318 | Hold(ctx context.Context, in *HoldRequest, opts ...grpc.CallOption) (*HoldResponse, error) |
| 319 | // Capture pays a hold into another wallet. |
| 320 | Capture(ctx context.Context, in *CaptureRequest, opts ...grpc.CallOption) (*CaptureResponse, error) |
| 321 | // Release gives a hold back to its wallet. |
| 322 | Release(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error) |
| 323 | // DescribeWallet returns anyone's wallet, and its status: what a transfer |
| 324 | // checks before it holds money. |
| 325 | DescribeWallet(ctx context.Context, in *DescribeWalletRequest, opts ...grpc.CallOption) (*DescribeWalletResponse, error) |
| 326 | } |
| 327 | |
| 328 | type holdServiceClient struct { |
| 329 | cc grpc.ClientConnInterface |
| 330 | } |
| 331 | |
| 332 | func NewHoldServiceClient(cc grpc.ClientConnInterface) HoldServiceClient { |
| 333 | return &holdServiceClient{cc} |
| 334 | } |
| 335 | |
| 336 | func (c *holdServiceClient) Hold(ctx context.Context, in *HoldRequest, opts ...grpc.CallOption) (*HoldResponse, error) { |
| 337 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 338 | out := new(HoldResponse) |
| 339 | err := c.cc.Invoke(ctx, HoldService_Hold_FullMethodName, in, out, cOpts...) |
| 340 | if err != nil { |
| 341 | return nil, err |
| 342 | } |
| 343 | return out, nil |
| 344 | } |
| 345 | |
| 346 | func (c *holdServiceClient) Capture(ctx context.Context, in *CaptureRequest, opts ...grpc.CallOption) (*CaptureResponse, error) { |
| 347 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 348 | out := new(CaptureResponse) |
| 349 | err := c.cc.Invoke(ctx, HoldService_Capture_FullMethodName, in, out, cOpts...) |
| 350 | if err != nil { |
| 351 | return nil, err |
| 352 | } |
| 353 | return out, nil |
| 354 | } |
| 355 | |
| 356 | func (c *holdServiceClient) Release(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error) { |
| 357 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 358 | out := new(ReleaseResponse) |
| 359 | err := c.cc.Invoke(ctx, HoldService_Release_FullMethodName, in, out, cOpts...) |
| 360 | if err != nil { |
| 361 | return nil, err |
| 362 | } |
| 363 | return out, nil |
| 364 | } |
| 365 | |
| 366 | func (c *holdServiceClient) DescribeWallet(ctx context.Context, in *DescribeWalletRequest, opts ...grpc.CallOption) (*DescribeWalletResponse, error) { |
| 367 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 368 | out := new(DescribeWalletResponse) |
| 369 | err := c.cc.Invoke(ctx, HoldService_DescribeWallet_FullMethodName, in, out, cOpts...) |
| 370 | if err != nil { |
| 371 | return nil, err |
| 372 | } |
| 373 | return out, nil |
| 374 | } |
| 375 | |
| 376 | // HoldServiceServer is the server API for HoldService service. |
| 377 | // All implementations must embed UnimplementedHoldServiceServer |
| 378 | // for forward compatibility. |
| 379 | // |
| 380 | // HoldService sets money aside for operations that take several steps, like |
| 381 | // a transfer saga. Its callers are our services, so requests name the user |
| 382 | // they act for. Every call is safe to repeat: the hold ID is the key. |
| 383 | type HoldServiceServer interface { |
| 384 | // Hold moves money out of a wallet into a hold, if the wallet can cover it. |
| 385 | Hold(context.Context, *HoldRequest) (*HoldResponse, error) |
| 386 | // Capture pays a hold into another wallet. |
| 387 | Capture(context.Context, *CaptureRequest) (*CaptureResponse, error) |
| 388 | // Release gives a hold back to its wallet. |
| 389 | Release(context.Context, *ReleaseRequest) (*ReleaseResponse, error) |
| 390 | // DescribeWallet returns anyone's wallet, and its status: what a transfer |
| 391 | // checks before it holds money. |
| 392 | DescribeWallet(context.Context, *DescribeWalletRequest) (*DescribeWalletResponse, error) |
| 393 | mustEmbedUnimplementedHoldServiceServer() |
| 394 | } |
| 395 | |
| 396 | // UnimplementedHoldServiceServer must be embedded to have |
| 397 | // forward compatible implementations. |
| 398 | // |
| 399 | // NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 400 | // pointer dereference when methods are called. |
| 401 | type UnimplementedHoldServiceServer struct{} |
| 402 | |
| 403 | func (UnimplementedHoldServiceServer) Hold(context.Context, *HoldRequest) (*HoldResponse, error) { |
| 404 | return nil, status.Error(codes.Unimplemented, "method Hold not implemented") |
| 405 | } |
| 406 | func (UnimplementedHoldServiceServer) Capture(context.Context, *CaptureRequest) (*CaptureResponse, error) { |
| 407 | return nil, status.Error(codes.Unimplemented, "method Capture not implemented") |
| 408 | } |
| 409 | func (UnimplementedHoldServiceServer) Release(context.Context, *ReleaseRequest) (*ReleaseResponse, error) { |
| 410 | return nil, status.Error(codes.Unimplemented, "method Release not implemented") |
| 411 | } |
| 412 | func (UnimplementedHoldServiceServer) DescribeWallet(context.Context, *DescribeWalletRequest) (*DescribeWalletResponse, error) { |
| 413 | return nil, status.Error(codes.Unimplemented, "method DescribeWallet not implemented") |
| 414 | } |
| 415 | func (UnimplementedHoldServiceServer) mustEmbedUnimplementedHoldServiceServer() {} |
| 416 | func (UnimplementedHoldServiceServer) testEmbeddedByValue() {} |
| 417 | |
| 418 | // UnsafeHoldServiceServer may be embedded to opt out of forward compatibility for this service. |
| 419 | // Use of this interface is not recommended, as added methods to HoldServiceServer will |
| 420 | // result in compilation errors. |
| 421 | type UnsafeHoldServiceServer interface { |
| 422 | mustEmbedUnimplementedHoldServiceServer() |
| 423 | } |
| 424 | |
| 425 | func RegisterHoldServiceServer(s grpc.ServiceRegistrar, srv HoldServiceServer) { |
| 426 | // If the following call panics, it indicates UnimplementedHoldServiceServer was |
| 427 | // embedded by pointer and is nil. This will cause panics if an |
| 428 | // unimplemented method is ever invoked, so we test this at initialization |
| 429 | // time to prevent it from happening at runtime later due to I/O. |
| 430 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 431 | t.testEmbeddedByValue() |
| 432 | } |
| 433 | s.RegisterService(&HoldService_ServiceDesc, srv) |
| 434 | } |
| 435 | |
| 436 | func _HoldService_Hold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 437 | in := new(HoldRequest) |
| 438 | if err := dec(in); err != nil { |
| 439 | return nil, err |
| 440 | } |
| 441 | if interceptor == nil { |
| 442 | return srv.(HoldServiceServer).Hold(ctx, in) |
| 443 | } |
| 444 | info := &grpc.UnaryServerInfo{ |
| 445 | Server: srv, |
| 446 | FullMethod: HoldService_Hold_FullMethodName, |
| 447 | } |
| 448 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 449 | return srv.(HoldServiceServer).Hold(ctx, req.(*HoldRequest)) |
| 450 | } |
| 451 | return interceptor(ctx, in, info, handler) |
| 452 | } |
| 453 | |
| 454 | func _HoldService_Capture_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 455 | in := new(CaptureRequest) |
| 456 | if err := dec(in); err != nil { |
| 457 | return nil, err |
| 458 | } |
| 459 | if interceptor == nil { |
| 460 | return srv.(HoldServiceServer).Capture(ctx, in) |
| 461 | } |
| 462 | info := &grpc.UnaryServerInfo{ |
| 463 | Server: srv, |
| 464 | FullMethod: HoldService_Capture_FullMethodName, |
| 465 | } |
| 466 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 467 | return srv.(HoldServiceServer).Capture(ctx, req.(*CaptureRequest)) |
| 468 | } |
| 469 | return interceptor(ctx, in, info, handler) |
| 470 | } |
| 471 | |
| 472 | func _HoldService_Release_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 473 | in := new(ReleaseRequest) |
| 474 | if err := dec(in); err != nil { |
| 475 | return nil, err |
| 476 | } |
| 477 | if interceptor == nil { |
| 478 | return srv.(HoldServiceServer).Release(ctx, in) |
| 479 | } |
| 480 | info := &grpc.UnaryServerInfo{ |
| 481 | Server: srv, |
| 482 | FullMethod: HoldService_Release_FullMethodName, |
| 483 | } |
| 484 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 485 | return srv.(HoldServiceServer).Release(ctx, req.(*ReleaseRequest)) |
| 486 | } |
| 487 | return interceptor(ctx, in, info, handler) |
| 488 | } |
| 489 | |
| 490 | func _HoldService_DescribeWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 491 | in := new(DescribeWalletRequest) |
| 492 | if err := dec(in); err != nil { |
| 493 | return nil, err |
| 494 | } |
| 495 | if interceptor == nil { |
| 496 | return srv.(HoldServiceServer).DescribeWallet(ctx, in) |
| 497 | } |
| 498 | info := &grpc.UnaryServerInfo{ |
| 499 | Server: srv, |
| 500 | FullMethod: HoldService_DescribeWallet_FullMethodName, |
| 501 | } |
| 502 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 503 | return srv.(HoldServiceServer).DescribeWallet(ctx, req.(*DescribeWalletRequest)) |
| 504 | } |
| 505 | return interceptor(ctx, in, info, handler) |
| 506 | } |
| 507 | |
| 508 | // HoldService_ServiceDesc is the grpc.ServiceDesc for HoldService service. |
| 509 | // It's only intended for direct use with grpc.RegisterService, |
| 510 | // and not to be introspected or modified (even as a copy) |
| 511 | var HoldService_ServiceDesc = grpc.ServiceDesc{ |
| 512 | ServiceName: "wallet.v1.HoldService", |
| 513 | HandlerType: (*HoldServiceServer)(nil), |
| 514 | Methods: []grpc.MethodDesc{ |
| 515 | { |
| 516 | MethodName: "Hold", |
| 517 | Handler: _HoldService_Hold_Handler, |
| 518 | }, |
| 519 | { |
| 520 | MethodName: "Capture", |
| 521 | Handler: _HoldService_Capture_Handler, |
| 522 | }, |
| 523 | { |
| 524 | MethodName: "Release", |
| 525 | Handler: _HoldService_Release_Handler, |
| 526 | }, |
| 527 | { |
| 528 | MethodName: "DescribeWallet", |
| 529 | Handler: _HoldService_DescribeWallet_Handler, |
| 530 | }, |
| 531 | }, |
| 532 | Streams: []grpc.StreamDesc{}, |
| 533 | Metadata: "wallet/v1/wallet.proto", |
| 534 | } |