repository

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization interface {
	CreateUser(user domain.User) (int64, error)
	GetUser(username, password string) (domain.User, error)
}

type Repository

type Repository struct {
	Authorization
	Tokens
	Wallet
	Transaction
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

type Tokens

type Tokens interface {
	Create(token domain.RefreshToken) error
	Get(token string) (domain.RefreshToken, error)
}

type Transaction

type Transaction interface {
	CreateTransaction(walletId, userId int64, transaction domain.Transaction) (int64, error)
	GetAllTransactions(walletId int64) ([]domain.Transaction, error)
	GetTransactionById(userId, transactionId int64) (domain.Transaction, error)
	UpdateTransaction(userId, walletId, transactionId int64, input domain.UpdateTransactionInput, amount float64) error
	UpdateTransactionBalance(walletId, transactionId int64, amount float64) error
	DeleteTransaction(userId, walletId, transactionId int64, amount float64) error
}

type Wallet

type Wallet interface {
	CreateWallet(userId int64, wallet domain.Wallet) (int64, error)
	GetAllWallets(userId int64) ([]domain.Wallet, error)
	GetWalletById(userId, walletId int64) (domain.Wallet, error)
	UpdateWallet(userId, walletId int64, input domain.UpdateWalletInput) error
	DeleteWallet(userId, walletId int64) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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