accountrepo

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: 7 Imported by: 0

Documentation

Overview

Package accountrepo manages repository layer of accounts.

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 account repository layer logic.

func NewRepoPGS

func NewRepoPGS(db dbpkg.SQLInterface) *RepoPGS

NewRepoPGS returns account RepoPGS.

func (*RepoPGS) AddBalance

func (r *RepoPGS) AddBalance(ctx context.Context, amount string, id int32) (domain.Account, error)

AddBalance changes the account's balance and returns the changed account.

func (*RepoPGS) Create

func (r *RepoPGS) Create(ctx context.Context, owner, balance, currency string) (domain.Account, error)

Create creates the account and then returns it.

func (*RepoPGS) Delete

func (r *RepoPGS) Delete(ctx context.Context, id int32) error

Delete removes the account with the given id.

func (*RepoPGS) Get

func (r *RepoPGS) Get(ctx context.Context, id int32) (domain.Account, error)

Get returns the account with the given id.

func (*RepoPGS) List

func (r *RepoPGS) List(ctx context.Context, owner string, limit, offset int32) ([]domain.Account, error)

List returns the specified number of accounts for the given user.

Jump to

Keyboard shortcuts

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