Documentation ¶
Index ¶
- type AccountRepository
- func (mAccRepo AccountRepository) Create(ctx context.Context, account *model.Account) error
- func (mAccRepo AccountRepository) ExistsByCPF(ctx context.Context, cpf model.CPF) (bool, error)
- func (mAccRepo AccountRepository) Fetch(ctx context.Context) ([]model.Account, error)
- func (mAccRepo AccountRepository) GetBalance(ctx context.Context, id model.AccountID) (*model.Account, error)
- func (mAccRepo AccountRepository) GetByCPF(ctx context.Context, cpf model.CPF) (*model.Account, error)
- func (mAccRepo AccountRepository) UpdateBalance(ctx context.Context, id model.AccountID, balance model.Money) error
- type TransferRepository
- func (mTrfRepo TransferRepository) Create(ctx context.Context, transfer *model.Transfer) error
- func (mTrfRepo TransferRepository) Fetch(ctx context.Context, accountID model.AccountID) ([]model.Transfer, error)
- func (mTrfRepo TransferRepository) WithinTransaction(ctx context.Context, txFunc func(context.Context) (interface{}, error)) (data interface{}, err error)
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) ExistsByCPF ¶
ExistsByCPF executes OnExistsByCPF.
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) 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.
Click to show internal directories.
Click to hide internal directories.