Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotEnoughFunds is used when user does not have enough funds for transfer to another account ErrNotEnoughFunds = errors.New("not enough funds") // ErrMixedCurrencies is used when user tries to transfer funds to account with different currency ErrMixedCurrencies = errors.New("cannot process account with the different currencies") )
Functions ¶
This section is empty.
Types ¶
type AccountRepository ¶
type AccountRepository interface { Update(Transaction, *Account) error FindAll() ([]*Account, error) FindForUpdate(Transaction, AccountID) (*Account, error) }
AccountRepository provides accounts store
type PaymentDirection ¶
type PaymentDirection int
PaymentDirection describes payment direction between accounts
const ( Inbound PaymentDirection = iota Outbound )
Valid payment directions
func (PaymentDirection) String ¶
func (p PaymentDirection) String() string
Valid handling of payment directions
type PaymentRepository ¶
type PaymentRepository interface { Insert(Transaction, *Payment) error FindAll() ([]*Payment, error) }
PaymentRepository provides payments store
type Transaction ¶
Transaction is a transaction
type TxStarter ¶
type TxStarter interface {
Begin() (Transaction, error)
}
TxStarter provides transaction opener
Directories ¶
Path | Synopsis |
---|---|
Package account provides the use-case of manipulating with user's account.
|
Package account provides the use-case of manipulating with user's account. |
Package accountfinder provides the use-case of searching for user's accounts.
|
Package accountfinder provides the use-case of searching for user's accounts. |
cmd
|
|
Package inmem provides in-memory repository, used for testing purposes Package inmem provides in-memory repository, used for testing purposes Package inmem provides in-memory repository, used for testing purposes
|
Package inmem provides in-memory repository, used for testing purposes Package inmem provides in-memory repository, used for testing purposes Package inmem provides in-memory repository, used for testing purposes |
Package paymentfinder provides the use-case of searching for user's payments.
|
Package paymentfinder provides the use-case of searching for user's payments. |
Package postgres provides PostgreSQL repository Package postgres provides PostgreSQL repository
|
Package postgres provides PostgreSQL repository Package postgres provides PostgreSQL repository |
Click to show internal directories.
Click to hide internal directories.