port

package
v0.0.0-...-5cbbb65 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transactor

type Transactor interface {
	// WithinTransaction runs a function within a database transaction.
	//
	// Transaction is propagated in the context,
	// so it is important to propagate it to underlying repositories.
	// Function commits if error is nil, and rollbacks if not.
	// It returns the same error.
	WithinTransaction(context.Context, func(ctx context.Context) error) error
}

Transactor runs logic inside a single database transaction

type WalletRepo

type WalletRepo interface {
	Transactor
	CreateWallet(ctx context.Context, balance int64) (wallet domain.Wallet, err error)
	GetWalletByID(ctx context.Context, id int64) (wallet domain.Wallet, err error)
}

type WalletUseCase

type WalletUseCase interface {
	CreateWallet(ctx context.Context, balance int64) (wallet domain.Wallet, err error)
	GetBalanceByID(ctx context.Context, id int64) (balance int64, err error)
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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