Documentation
¶
Overview ¶
Package handler provides the functionality of HTTP/2 gRPC handler. It receives request and returns response.
Index ¶
- type Health
- type WalletCommand
- func (wc *WalletCommand) CreateWallet(ctx context.Context, request *apiv1.CreateWalletRequest) (*apiv1.CreateWalletResponse, error)
- func (wc *WalletCommand) TopupWallet(ctx context.Context, request *apiv1.TopupWalletRequest) (*apiv1.TopupWalletResponse, error)
- func (wc *WalletCommand) TransferBalance(ctx context.Context, request *apiv1.TransferBalanceRequest) (*apiv1.TransferBalanceResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Health ¶
type Health struct {
grpc_health_v1.UnimplementedHealthServer
}
Health handles HTTP/2 gRPC request for health checking.
func (*Health) Check ¶
func (hh *Health) Check(_ context.Context, request *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
Check checks the entire system health.
type WalletCommand ¶
type WalletCommand struct { apiv1.UnimplementedWalletCommandServiceServer // contains filtered or unexported fields }
WalletCommand handles HTTP/2 gRPC request for state-changing wallet.
func NewWalletCommand ¶
func NewWalletCommand(c service.CreateWallet, t service.TopupWallet, tf service.TransferWallet) *WalletCommand
NewWalletCommand creates an instance of WalletCommand.
func (*WalletCommand) CreateWallet ¶
func (wc *WalletCommand) CreateWallet(ctx context.Context, request *apiv1.CreateWalletRequest) (*apiv1.CreateWalletResponse, error)
CreateWallet handles HTTP/2 gRPC request similar to POST in HTTP/1.1.
func (*WalletCommand) TopupWallet ¶
func (wc *WalletCommand) TopupWallet(ctx context.Context, request *apiv1.TopupWalletRequest) (*apiv1.TopupWalletResponse, error)
TopupWallet handles HTTP/2 gRPC request similar to POST in HTTP/1.1.
func (*WalletCommand) TransferBalance ¶
func (wc *WalletCommand) TransferBalance(ctx context.Context, request *apiv1.TransferBalanceRequest) (*apiv1.TransferBalanceResponse, error)
TransferBalance handles HTTP/2 gRPC request similar to POST in HTTP/1.1.
Click to show internal directories.
Click to hide internal directories.