transferrepo

package
v0.0.0-...-e6e2e8d Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package transferrepo manages repository layer of transfers.

Index

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

func NewRepoPGS(db *sql.DB) *RepoPGS

NewRepoPGS returns account RepoPGS with connection to start transactions.

func NewTxRepoPGS

func NewTxRepoPGS(db dbpkg.SQLInterface) *RepoPGS

NewTxRepoPGS returns account RepoPGS.

func (*RepoPGS) Create

Create creates the transfer and then returns it.

func (*RepoPGS) Get

func (r *RepoPGS) Get(ctx context.Context, id int64) (domain.Transfer, error)

Get returns the transfer with the given id.

func (*RepoPGS) List

List returns the transfers betweem the specified accounts.

func (*RepoPGS) Transfer

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.

Jump to

Keyboard shortcuts

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