mock

package
v0.0.0-...-c53624e Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 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 AccountRepository

type AccountRepository struct {
	OnCreate        func(ctx context.Context, account *model.Account) error
	OnExistsByCPF   func(ctx context.Context, cpf model.CPF) (bool, error)
	OnGetByCPF      func(ctx context.Context, cpf model.CPF) (*model.Account, error)
	OnFetch         func(ctx context.Context) ([]model.Account, error)
	OnGetBalance    func(ctx context.Context, id model.AccountID) (*model.Account, error)
	OnUpdateBalance func(ctx context.Context, id model.AccountID, balance model.Money) error
}

AccountRepository mocks an AccountRepository.

func (AccountRepository) Create

func (mAccRepo AccountRepository) Create(ctx context.Context, account *model.Account) error

Create executes OnCreate.

func (AccountRepository) ExistsByCPF

func (mAccRepo AccountRepository) ExistsByCPF(ctx context.Context, cpf model.CPF) (bool, error)

ExistsByCPF executes OnExistsByCPF.

func (AccountRepository) Fetch

func (mAccRepo AccountRepository) Fetch(ctx context.Context) ([]model.Account, error)

Fetch executes OnFetch.

func (AccountRepository) GetBalance

func (mAccRepo AccountRepository) GetBalance(ctx context.Context, id model.AccountID) (*model.Account, error)

GetBalance executes OnGetBalance.

func (AccountRepository) GetByCPF

func (mAccRepo AccountRepository) GetByCPF(ctx context.Context, cpf model.CPF) (*model.Account, error)

GetByCPF executes OnGetByCPF.

func (AccountRepository) UpdateBalance

func (mAccRepo AccountRepository) UpdateBalance(ctx context.Context, id model.AccountID, balance model.Money) error

UpdateBalance executes OnUpdateBalance.

type TransferRepository

type TransferRepository struct {
	OnCreate            func(ctx context.Context, transfer *model.Transfer) error
	OnFetch             func(ctx context.Context, accountID model.AccountID) ([]model.Transfer, error)
	OnWithinTransaction func(ctx context.Context, txFunc func(context.Context) (interface{}, error)) (data interface{}, err error)
}

TransferRepository mocks an TransferRepository.

func (TransferRepository) Create

func (mTrfRepo TransferRepository) Create(ctx context.Context, transfer *model.Transfer) error

Create executes OnCreate.

func (TransferRepository) Fetch

func (mTrfRepo TransferRepository) Fetch(ctx context.Context, accountID model.AccountID) ([]model.Transfer, error)

Fetch executes OnFetch.

func (TransferRepository) WithinTransaction

func (mTrfRepo TransferRepository) WithinTransaction(ctx context.Context, txFunc func(context.Context) (interface{}, error)) (data interface{}, err error)

WithinTransaction executes OnWithinTransaction.

Jump to

Keyboard shortcuts

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