relationaldb

package
v0.0.0-...-3d48b77 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEntry

func DeleteEntry(ctx context.Context, id string) error

func GetAccount

func GetAccount(
	ctx context.Context,
	accountId string,
) (*model.Account, error)

func GetAllAccountsAndMostRecentBalances

func GetAllAccountsAndMostRecentBalances(
	ctx context.Context,
	userId string,
) ([]*model.AccountBalance, error)

func InsertAccountBalance

func InsertAccountBalance(
	ctx context.Context,
	account *model.QldbAccount,
) error

func InsertEntry

func InsertEntry(ctx context.Context, a, b *model.Entry) error

func InsertTransaction

func InsertTransaction(
	ctx context.Context,
	t *model.Transaction,
	sender, receiver *model.Account,
) error

func NewRepo

func NewRepo(a *config.AppConfig, l *log.Entry)

func UpsertHold

func UpsertHold(ctx context.Context, hold *model.Hold) error

Types

type DbManager

type DbManager interface {
	Query(ctx context.Context, dest interface{}, query string, args ...interface{}) error
	Insert(ctx context.Context, sql string, args ...interface{}) error
}

type Repository

type Repository struct {
	Pool *pgxpool.Pool
}
var Repo *Repository

func (*Repository) Batch

func (r *Repository) Batch(ctx context.Context, entries []*model.Entry) error

func (*Repository) Insert

func (r *Repository) Insert(
	ctx context.Context,
	sql string,
	args ...interface{},
) error

func (*Repository) Query

func (r *Repository) Query(
	ctx context.Context,
	dest interface{},
	query string,
	args ...interface{},
) error

Jump to

Keyboard shortcuts

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