repository

package
v0.0.0-...-85337ad Latest Latest
Warning

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

Go to latest
Published: Jun 24, 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 Account

type Account interface {
	ExistsAccount(id int) (models.Account, error)
	GetAccounts(userId int) ([]models.Account, error)
	GetAccount(id, userId int) (models.Account, error)
	CreateAccount(account models.Account) (int, error)
	UpdateAccount(account models.Account) (models.Account, error)
	DeleteAccount(id, userId int) error
	RestoreAccount(id, userId int) error
}

type AccountRepository

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

func NewAccountRepository

func NewAccountRepository(db *gorm.DB) *AccountRepository

func (*AccountRepository) CreateAccount

func (r *AccountRepository) CreateAccount(account models.Account) (int, error)

func (*AccountRepository) DeleteAccount

func (r *AccountRepository) DeleteAccount(id, userId int) error

func (*AccountRepository) ExistsAccount

func (r *AccountRepository) ExistsAccount(id int) (models.Account, error)

func (*AccountRepository) GetAccount

func (r *AccountRepository) GetAccount(id, userId int) (models.Account, error)

func (*AccountRepository) GetAccounts

func (r *AccountRepository) GetAccounts(userId int) ([]models.Account, error)

func (*AccountRepository) RestoreAccount

func (r *AccountRepository) RestoreAccount(id, userId int) error

func (*AccountRepository) UpdateAccount

func (r *AccountRepository) UpdateAccount(account models.Account) (models.Account, error)

type AuthPostgres

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

func NewAuthPostgres

func NewAuthPostgres(db *gorm.DB) *AuthPostgres

func (*AuthPostgres) CreateUser

func (p *AuthPostgres) CreateUser(user models.User) (int, error)

func (*AuthPostgres) GetUser

func (p *AuthPostgres) GetUser(email, username string) (models.User, error)

type Authorization

type Authorization interface {
	CreateUser(user models.User) (int, error)
	GetUser(email, username string) (models.User, error)
}

type Category

type Category interface {
	CreateCategory(cat models.Category) (models.Category, error)
	GetCategories() ([]models.Category, error)
	GetCategory(id int) (models.Category, error)
	UpdateCategory(category models.Category) (models.Category, error)
	DeleteCategory(id int) error
	RestoreCategory(id int) error
}

type CategoryRepository

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

func NewCategoryRepository

func NewCategoryRepository(db *gorm.DB) *CategoryRepository

func (*CategoryRepository) CreateCategory

func (c *CategoryRepository) CreateCategory(cat models.Category) (models.Category, error)

func (*CategoryRepository) DeleteCategory

func (c *CategoryRepository) DeleteCategory(id int) error

func (*CategoryRepository) GetCategories

func (c *CategoryRepository) GetCategories() ([]models.Category, error)

func (*CategoryRepository) GetCategory

func (c *CategoryRepository) GetCategory(id int) (models.Category, error)

func (*CategoryRepository) RestoreCategory

func (c *CategoryRepository) RestoreCategory(id int) error

func (*CategoryRepository) UpdateCategory

func (c *CategoryRepository) UpdateCategory(category models.Category) (models.Category, error)

type Report

type Report interface {
	GetReport(rep models.Report) ([]models.Transaction, error)
}

type ReportRepository

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

func NewReportRepository

func NewReportRepository(db *gorm.DB) *ReportRepository

func (*ReportRepository) GetReport

func (r *ReportRepository) GetReport(rep models.Report) ([]models.Transaction, error)

type Repository

type Repository struct {
	Authorization
	User
	Account
	Category
	Transaction
	Report
}

func NewRepository

func NewRepository(db *gorm.DB) *Repository

type Transaction

type Transaction interface {
	CreateTransaction(transaction models.Transaction) (models.Transaction, error)
	GetTransaction(id, userId int) (models.Transaction, error)
	UpdateTransaction(transaction models.Transaction) (models.Transaction, error)
	GetTransactions(userId int) ([]models.Transaction, error)
}

type TransactionRepository

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

func NewTransactionRepository

func NewTransactionRepository(db *gorm.DB) *TransactionRepository

func (*TransactionRepository) CreateTransaction

func (t *TransactionRepository) CreateTransaction(tr models.Transaction) (models.Transaction, error)

func (*TransactionRepository) GetTransaction

func (t *TransactionRepository) GetTransaction(id, userId int) (models.Transaction, error)

func (*TransactionRepository) GetTransactions

func (t *TransactionRepository) GetTransactions(userId int) ([]models.Transaction, error)

func (*TransactionRepository) UpdateTransaction

func (t *TransactionRepository) UpdateTransaction(tr models.Transaction) (models.Transaction, error)

type User

type User interface {
	GetUserById(id int) (models.User, error)
	UpdateUser(user models.User) (models.User, error)
	DeleteUserById(id int) error
	RestoreUserById(id int) error
}

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *gorm.DB) *UserRepository

func (*UserRepository) DeleteUserById

func (u *UserRepository) DeleteUserById(id int) error

func (*UserRepository) GetUserById

func (u *UserRepository) GetUserById(id int) (models.User, error)

func (*UserRepository) RestoreUserById

func (u *UserRepository) RestoreUserById(id int) error

func (*UserRepository) UpdateUser

func (u *UserRepository) UpdateUser(user models.User) (models.User, error)

Jump to

Keyboard shortcuts

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