accounts

package
v0.0.0-...-a6a5f53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "AccountsService",
	HandlerType: (*AccountsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Deposit",
			Handler:    _AccountsService_Deposit_Handler,
		},
		{
			MethodName: "Withdrawal",
			Handler:    _AccountsService_Withdrawal_Handler,
		},
		{
			MethodName: "ReserveCreditLimit",
			Handler:    _AccountsService_ReserveCreditLimit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/gateway/grpc/accounts/accounts.proto",
}

AccountsService_ServiceDesc is the grpc.ServiceDesc for AccountsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_pkg_gateway_grpc_accounts_accounts_proto protoreflect.FileDescriptor

Functions

func RegisterAccountsServiceServer

func RegisterAccountsServiceServer(s grpc.ServiceRegistrar, srv AccountsServiceServer)

Types

type AccountsServiceClient

type AccountsServiceClient interface {
	Deposit(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Withdrawal(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	ReserveCreditLimit(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

AccountsServiceClient is the client API for AccountsService service.

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.

type AccountsServiceServer

type AccountsServiceServer interface {
	Deposit(context.Context, *Request) (*Response, error)
	Withdrawal(context.Context, *Request) (*Response, error)
	ReserveCreditLimit(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

AccountsServiceServer is the server API for AccountsService service. All implementations must embed UnimplementedAccountsServiceServer for forward compatibility

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client gRPC of accounts

func NewClient

func NewClient(conn *grpc.ClientConn) *Client

NewClient returns a gRPC client

func (Client) Deposit

func (c Client) Deposit(ctx context.Context, accID vos.AccountID, amount vos.Money) error

Deposit requests a deposit to the accounts server

func (Client) ReserveCreditLimit

func (c Client) ReserveCreditLimit(ctx context.Context, accID vos.AccountID, amount vos.Money) error

ReserveCreditLimit requests a credit limit reserval to the accounts server

func (Client) Withdrawal

func (c Client) Withdrawal(ctx context.Context, accID vos.AccountID, amount vos.Money) error

Withdrawal requests a withdrawal to the accounts server

type Request

type Request struct {
	AccountID string `protobuf:"bytes,1,opt,name=accountID,proto3" json:"accountID,omitempty"`
	Amount    int64  `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetAccountID

func (x *Request) GetAccountID() string

func (*Request) GetAmount

func (x *Request) GetAmount() int64

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Success          bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	ErrorCode        int32  `protobuf:"fixed32,2,opt,name=errorCode,proto3" json:"errorCode,omitempty"`
	ErrorDescription string `protobuf:"bytes,3,opt,name=errorDescription,proto3" json:"errorDescription,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetErrorCode

func (x *Response) GetErrorCode() int32

func (*Response) GetErrorDescription

func (x *Response) GetErrorDescription() string

func (*Response) GetSuccess

func (x *Response) GetSuccess() bool

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedAccountsServiceServer

type UnimplementedAccountsServiceServer struct {
}

UnimplementedAccountsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAccountsServiceServer) Deposit

func (UnimplementedAccountsServiceServer) ReserveCreditLimit

func (UnimplementedAccountsServiceServer) Withdrawal

type UnsafeAccountsServiceServer

type UnsafeAccountsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAccountsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AccountsServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL