handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

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

func NewHandlers

func NewHandlers(ws WalletService, ts TransferService) *Handlers

func (*Handlers) CreateTransfer

func (h *Handlers) CreateTransfer(c echo.Context) error

func (*Handlers) CreateWallet

func (h *Handlers) CreateWallet(c echo.Context) error

func (*Handlers) GetWallet

func (h *Handlers) GetWallet(c echo.Context) error

func (*Handlers) GetWalletTransfers

func (h *Handlers) GetWalletTransfers(c echo.Context) error

type TransferDTO

type TransferDTO struct {
	Time       string          `json:"time"`
	FromWallet string          `json:"from" param:"walletId"`
	ToWallet   string          `json:"to"`
	Amount     decimal.Decimal `json:"amount"`
}

type TransferService

type TransferService interface {
	Create(ctx context.Context, transfer *TransferDTO) (*TransferDTO, error)
	GetWalletTransfers(ctx context.Context, walletID string) ([]TransferDTO, error)
}

type WalletDTO

type WalletDTO struct {
	WalletID string          `json:"id" param:"walletId"`
	Balance  decimal.Decimal `json:"balance"`
}

type WalletService

type WalletService interface {
	Create(ctx context.Context) (*WalletDTO, error)
	Get(ctx context.Context, walletID string) (*WalletDTO, error)
}

Jump to

Keyboard shortcuts

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