Documentation ¶
Overview ¶
Package transferrepo manages repository layer of transfers.
Index ¶
- type RepoPGS
- func (r *RepoPGS) Create(ctx context.Context, arg domain.CreateTransferParams) (domain.Transfer, error)
- func (r *RepoPGS) Get(ctx context.Context, id int64) (domain.Transfer, error)
- func (r *RepoPGS) List(ctx context.Context, arg domain.ListTransfersParams) ([]domain.Transfer, error)
- func (r *RepoPGS) Transfer(ctx context.Context, arg domain.CreateTransferParams) (domain.TransferTxResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RepoPGS ¶
type RepoPGS struct {
// contains filtered or unexported fields
}
RepoPGS facilitates transfer repository layer logic.
func NewRepoPGS ¶
NewRepoPGS returns account RepoPGS with connection to start transactions.
func NewTxRepoPGS ¶
func NewTxRepoPGS(db dbpkg.SQLInterface) *RepoPGS
NewTxRepoPGS returns account RepoPGS.
func (*RepoPGS) Create ¶
func (r *RepoPGS) Create(ctx context.Context, arg domain.CreateTransferParams) (domain.Transfer, error)
Create creates the transfer and then returns it.
func (*RepoPGS) List ¶
func (r *RepoPGS) List(ctx context.Context, arg domain.ListTransfersParams) ([]domain.Transfer, error)
List returns the transfers betweem the specified accounts.
func (*RepoPGS) Transfer ¶
func (r *RepoPGS) Transfer(ctx context.Context, arg domain.CreateTransferParams) (domain.TransferTxResult, error)
Transfer performs a money transfer between two accounts.
It creates a transfer record, add account entries, and update accounts' balance within a single dbpkg transaction.
Click to show internal directories.
Click to hide internal directories.