Documentation ¶
Index ¶
- func PgSQLInit() (err error)
- type PgSqlAccount
- func (pg *PgSqlAccount) Balance() float64
- func (pg *PgSqlAccount) Create(name string) error
- func (pg *PgSqlAccount) Currency() string
- func (pg *PgSqlAccount) Delete() error
- func (pg *PgSqlAccount) Deposit(amount float64) (int64, error)
- func (pg *PgSqlAccount) Find(name string) error
- func (pg *PgSqlAccount) Get(id int64) error
- func (pg *PgSqlAccount) ID() int64
- func (pg *PgSqlAccount) List(offset, limit int64) ([]int64, error)
- func (pg *PgSqlAccount) Name() string
- func (pg *PgSqlAccount) Transfer(toID int64, amount float64) (int64, error)
- type PgSqlPayment
- func (pg PgSqlPayment) Amount() float64
- func (pg PgSqlPayment) Date() time.Time
- func (pg PgSqlPayment) From() int64
- func (pg PgSqlPayment) Get(id int64) error
- func (pg PgSqlPayment) ID() int64
- func (pg PgSqlPayment) List(accountID, offset, limit int64) ([]interface{}, error)
- func (pg PgSqlPayment) ListAll(offset, limit int64) ([]interface{}, error)
- func (pg PgSqlPayment) To() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PgSqlAccount ¶
type PgSqlAccount struct {
// contains filtered or unexported fields
}
func (*PgSqlAccount) Balance ¶
func (pg *PgSqlAccount) Balance() float64
func (*PgSqlAccount) Create ¶
func (pg *PgSqlAccount) Create(name string) error
Create - create a new account with name and load one in object this function not validate name Important! When any fields will be added into table, then need to add one in to INSERT query
func (*PgSqlAccount) Currency ¶
func (pg *PgSqlAccount) Currency() string
func (*PgSqlAccount) Deposit ¶
func (pg *PgSqlAccount) Deposit(amount float64) (int64, error)
Deposit - add amount to account balance
func (*PgSqlAccount) Find ¶
func (pg *PgSqlAccount) Find(name string) error
Find - find wallet with name and load in object
func (*PgSqlAccount) Get ¶
func (pg *PgSqlAccount) Get(id int64) error
Get - get wallet by ID and load in object Important! When any fields will be added into table, then need to add one in to SELECT query
func (*PgSqlAccount) ID ¶
func (pg *PgSqlAccount) ID() int64
func (*PgSqlAccount) List ¶
func (pg *PgSqlAccount) List(offset, limit int64) ([]int64, error)
List - return list of all wallets account names Wallets listed ordering by id offset and limit are using for set slice bound of list if limit = -1, then no limit Important! When any fields will be added into table, then need to add one in to SELECT query
func (*PgSqlAccount) Name ¶
func (pg *PgSqlAccount) Name() string
type PgSqlPayment ¶
type PgSqlPayment struct {
// contains filtered or unexported fields
}
func (PgSqlPayment) Amount ¶
func (pg PgSqlPayment) Amount() float64
func (PgSqlPayment) Date ¶
func (pg PgSqlPayment) Date() time.Time
func (PgSqlPayment) From ¶
func (pg PgSqlPayment) From() int64
func (PgSqlPayment) Get ¶
func (pg PgSqlPayment) Get(id int64) error
Get - get payment by ID and load in object Important! When any fields will be added into table, then need to add one in to SELECT query
func (PgSqlPayment) ID ¶
func (pg PgSqlPayment) ID() int64
func (PgSqlPayment) List ¶
func (pg PgSqlPayment) List(accountID, offset, limit int64) ([]interface{}, error)
List - return list of payments for account with accountID payments listed ordering by id offset and limit are using for set slice bound of list if limit = -1, then no limit Important! When any fields will be added into table, then need to add one in to SELECT query
func (PgSqlPayment) ListAll ¶
func (pg PgSqlPayment) ListAll(offset, limit int64) ([]interface{}, error)
ListAll - return list of payments payments listed ordering by id offset and limit are using for set slice bound of list if limit = -1, then no limit Important! When any fields will be added into table, then need to add one in to SELECT query
func (PgSqlPayment) To ¶
func (pg PgSqlPayment) To() int64