Documentation
¶
Index ¶
- Constants
- type AccountStore
- func (r *AccountStore) Create(u *model.Account) error
- func (r *AccountStore) Delete(id string) error
- func (r *AccountStore) Find(id string) (*model.Account, error)
- func (r *AccountStore) GetBalance(id string) (float64, error)
- func (r *AccountStore) SetBalance(id string, balance float64) error
- func (r *AccountStore) UpdateBalance(id string, balance float64) error
- type JobStore
- type Store
- type TransactionStore
Constants ¶
View Source
const ( DBPingAttempts = 18 DBPingTimeoutSecs = 10 ExitDBOpen = 101 ExitPing = 102 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStore ¶
type AccountStore struct {
Store *Store
}
AccountStore ...
func (*AccountStore) Create ¶
func (r *AccountStore) Create(u *model.Account) error
Create Account with balance = 0
func (*AccountStore) Find ¶
func (r *AccountStore) Find(id string) (*model.Account, error)
Find Return account by id
func (*AccountStore) GetBalance ¶
func (r *AccountStore) GetBalance(id string) (float64, error)
GetBalance Get the account balance
func (*AccountStore) SetBalance ¶
func (r *AccountStore) SetBalance(id string, balance float64) error
SetBalance account balance by id
func (*AccountStore) UpdateBalance ¶
func (r *AccountStore) UpdateBalance(id string, balance float64) error
UpdateBalance Increase the account balance
type Store ¶
Store ...
func CreateNewAndConnect ¶
CreateNewAndConnect ...
func (*Store) Transaction ¶
func (s *Store) Transaction() store.TransactionStore
Transaction sql store
type TransactionStore ¶
type TransactionStore struct {
// contains filtered or unexported fields
}
func (*TransactionStore) Fetch ¶
func (t *TransactionStore) Fetch(count int) ([]model.Transaction, error)
Fetch list of transaction
func (*TransactionStore) Save ¶
func (t *TransactionStore) Save(request *model.IncomingRequest, status string) error
Save the transaction
func (*TransactionStore) Update ¶
func (t *TransactionStore) Update(id int) error
Update the transaction record to CANCELLED
Click to show internal directories.
Click to hide internal directories.