repositories

package
v0.0.0-...-8b35975 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Executor

func Executor(ctx context.Context) *util.TxLogger

Types

type AccountRepository

type AccountRepository interface {
	GetAccount(ctx context.Context, ID int) (*models.Account, error)
	CreateAccount(ctx context.Context, accountReq *models.CreateAccountReq) (*models.Account, error)
}

type Repository

type Repository struct {
	AccountRepository     AccountRepository
	UserRepository        UserRepository
	TransactionRepository TransactionRepository
}

func InitRepositoryFactory

func InitRepositoryFactory(db *sqlx.DB) *Repository

InitRepositoryFactory init repositories factory

type TransactionRepository

type TransactionRepository interface {
	GetUserTransactions(ctx context.Context, req *models.GetUserTransactionsReq) ([]models.UserTransactionResp, error)
	CreateUserTransaction(ctx context.Context, req *models.CreateUserTransactionReq) (int, error)
	GetUserTransaction(ctx context.Context, transactionID int) (*models.UserTransactionResp, error)
	UpdateUserTransactions(ctx context.Context, req *models.UpdateUserTransactionsReq) error
	UpdateUserAccountTransactions(ctx context.Context, req *models.UpdateUserAccountTransactionsReq) error
	DeleteUserTransactions(ctx context.Context, userID int) error
	DeleteUserAccountTransactions(ctx context.Context, userID, accountID int) error
	DeleteTransactionByID(ctx context.Context, transactionID int) error
}

type UserRepository

type UserRepository interface {
	CreateUser(ctx context.Context, userReq *models.CreateUserReq) error
	GetByUsername(ctx context.Context, username string) (*models.User, error)
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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