Documentation
¶
Index ¶
- type AddAkunBalanceParams
- type Akun
- type CreateAuthorParams
- type CreateEntryParams
- type CreateTransfersParams
- type DBTX
- type Entry
- type ListAuthorsParams
- type Queries
- func (q *Queries) AddAkunBalance(ctx context.Context, arg AddAkunBalanceParams) (Akun, error)
- func (q *Queries) CreateAuthor(ctx context.Context, arg CreateAuthorParams) (Akun, error)
- func (q *Queries) CreateEntry(ctx context.Context, arg CreateEntryParams) (Entry, error)
- func (q *Queries) CreateTransfers(ctx context.Context, arg CreateTransfersParams) (Transfer, error)
- func (q *Queries) DeleteAkun(ctx context.Context, id int64) error
- func (q *Queries) GetAkunForUpdate(ctx context.Context, id int64) (Akun, error)
- func (q *Queries) GetAuthor(ctx context.Context, id int64) (Akun, error)
- func (q *Queries) GetEntry(ctx context.Context, id int64) (Entry, error)
- func (q *Queries) GetTransfer(ctx context.Context, id int64) (Transfer, error)
- func (q *Queries) ListAuthors(ctx context.Context, arg ListAuthorsParams) ([]Akun, error)
- func (q *Queries) UpdateAkun(ctx context.Context, arg UpdateAkunParams) (Akun, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Store
- type Transfer
- type TransferTxParams
- type TransferTxResult
- type UpdateAkunParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddAkunBalanceParams ¶
type CreateAuthorParams ¶
type CreateEntryParams ¶
type CreateTransfersParams ¶
type ListAuthorsParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddAkunBalance ¶
func (*Queries) CreateAuthor ¶
func (*Queries) CreateEntry ¶
func (*Queries) CreateTransfers ¶
func (*Queries) GetAkunForUpdate ¶
func (*Queries) GetTransfer ¶
func (*Queries) ListAuthors ¶
func (*Queries) UpdateAkun ¶
type Store ¶
type Store struct {
*Queries
// contains filtered or unexported fields
}
Store provides all functions to execute db queries and transactions
func (*Store) TransferTx ¶
func (store *Store) TransferTx(ctx context.Context, arg TransferTxParams) (TransferTxResult, error)
TransferTx performs a money transfer from one akun to the other It creates a transfer record, add akun entries, and update akun, balance within a single database transaksi
type TransferTxParams ¶
type TransferTxParams struct {
FromAkun int64 `json:"from_akun"`
ToAkun int64 `json:"to_akun"`
Amount int64 `json:"amount"`
}
TransferTxParams contains the input parameters of the transfer transaction
type TransferTxResult ¶
type TransferTxResult struct {
Transfer Transfer `json:"transfer"`
FromAkun Akun `json:"from_akun"`
ToAkun Akun `json:"To_akun"`
FromEntry Entry `json:"from_entry"`
ToEntry Entry `json:"to_entry"`
}
TransferTxResult is the result of the transfer transaction
type UpdateAkunParams ¶
Click to show internal directories.
Click to hide internal directories.