Documentation ¶
Index ¶
- type Store
- func (s *Store) Close()
- func (s *Store) DeleteAccount(accId int64) error
- func (s *Store) GetAccount(accId int64) (models.Account, error)
- func (s *Store) GetTransactionsHistory(accountId, nLastdays, limit int64) ([]models.Transaction, error)
- func (s *Store) InsertAccount(balance int64) (models.Account, error)
- func (s *Store) TransferMoney(accountToId, accountFromId, amount int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store object holds db instance
func (*Store) DeleteAccount ¶
DeleteAccount removes account from the accounts table
func (*Store) GetAccount ¶
GetAccount returns account model
func (*Store) GetTransactionsHistory ¶
func (s *Store) GetTransactionsHistory(accountId, nLastdays, limit int64) ([]models.Transaction, error)
GetTransactionsHistory retunrs array of transcations for the requested period of time
func (*Store) InsertAccount ¶
InsertAccount inserts new account into the accounts table and returns Account model
func (*Store) TransferMoney ¶
TransferMoney transfers money from one account to another; writes transfer info into the transfers table
Click to show internal directories.
Click to hide internal directories.