Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRepository ¶
type AccountRepository interface {
tx.Transactional // Embed interface inside of a repo or inject it separately through NewAccountService constructor
ByID(context.Context, int64) (*Account, error)
Save(context.Context, *Account) error
}
AccountRepository represents account repository interface
type AccountService ¶
type AccountService struct {
tx.Transactional // A convenience so we can use .RunTx directly on a service (mimick @Transactional)
// contains filtered or unexported fields
}
AccountService represents account application service
func NewAccountService ¶
func NewAccountService(accRepo AccountRepository) *AccountService
NewAccountService creates new account application service instance
func (*AccountService) TransferMoney ¶
func (svc *AccountService) TransferMoney(ctx context.Context, req *TransferReq) error
TransferMoney transfers the amount from source account to destination account
Click to show internal directories.
Click to hide internal directories.