postgres

package
v0.0.0-...-405484a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthPostgres

type AuthPostgres struct {
	// contains filtered or unexported fields
}

func NewAuthPostgres

func NewAuthPostgres(db *sqlx.DB) *AuthPostgres

func (*AuthPostgres) CreateUser

func (r *AuthPostgres) CreateUser(user domain.User) (int64, error)

func (*AuthPostgres) GetUser

func (r *AuthPostgres) GetUser(email, password string) (domain.User, error)

type Tokens

type Tokens struct {
	// contains filtered or unexported fields
}

func NewTokens

func NewTokens(db *sqlx.DB) *Tokens

func (*Tokens) Create

func (r *Tokens) Create(token domain.RefreshToken) error

func (*Tokens) Get

func (r *Tokens) Get(token string) (domain.RefreshToken, error)

type TransactionPostgres

type TransactionPostgres struct {
	// contains filtered or unexported fields
}

func NewTransactionPostgres

func NewTransactionPostgres(db *sqlx.DB) *TransactionPostgres

func (*TransactionPostgres) CreateTransaction

func (r *TransactionPostgres) CreateTransaction(walletId, userId int64, transaction domain.Transaction) (int64, error)

func (*TransactionPostgres) DeleteTransaction

func (r *TransactionPostgres) DeleteTransaction(userId, walletId, transactionId int64, amount float64) error

func (*TransactionPostgres) GetAllTransactions

func (r *TransactionPostgres) GetAllTransactions(walletId int64) ([]domain.Transaction, error)

func (*TransactionPostgres) GetTransactionById

func (r *TransactionPostgres) GetTransactionById(walletId, transactionId int64) (domain.Transaction, error)

func (*TransactionPostgres) UpdateTransaction

func (r *TransactionPostgres) UpdateTransaction(userId, walletId, transactionId int64, input domain.UpdateTransactionInput, amount float64) error

func (*TransactionPostgres) UpdateTransactionBalance

func (r *TransactionPostgres) UpdateTransactionBalance(walletId, transactionId int64, amount float64) error

type WalletPostgres

type WalletPostgres struct {
	// contains filtered or unexported fields
}

func NewWalletPostgres

func NewWalletPostgres(db *sqlx.DB) *WalletPostgres

func (*WalletPostgres) CreateWallet

func (r *WalletPostgres) CreateWallet(userId int64, wallet domain.Wallet) (int64, error)

func (*WalletPostgres) DeleteWallet

func (r *WalletPostgres) DeleteWallet(userId, walletId int64) error

func (*WalletPostgres) GetAllWallets

func (r *WalletPostgres) GetAllWallets(userId int64) ([]domain.Wallet, error)

func (*WalletPostgres) GetWalletById

func (r *WalletPostgres) GetWalletById(userId, walletId int64) (domain.Wallet, error)

func (*WalletPostgres) UpdateWallet

func (r *WalletPostgres) UpdateWallet(userId, walletId int64, input domain.UpdateWalletInput) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL