Documentation ¶
Index ¶
- type Account
- type AccountRepository
- func (r *AccountRepository) CreateAccount(account models.Account) (int, error)
- func (r *AccountRepository) DeleteAccount(id, userId int) error
- func (r *AccountRepository) ExistsAccount(id int) (models.Account, error)
- func (r *AccountRepository) GetAccount(id, userId int) (models.Account, error)
- func (r *AccountRepository) GetAccounts(userId int) ([]models.Account, error)
- func (r *AccountRepository) RestoreAccount(id, userId int) error
- func (r *AccountRepository) UpdateAccount(account models.Account) (models.Account, error)
- type AuthPostgres
- type Authorization
- type Category
- type CategoryRepository
- func (c *CategoryRepository) CreateCategory(cat models.Category) (models.Category, error)
- func (c *CategoryRepository) DeleteCategory(id int) error
- func (c *CategoryRepository) GetCategories() ([]models.Category, error)
- func (c *CategoryRepository) GetCategory(id int) (models.Category, error)
- func (c *CategoryRepository) RestoreCategory(id int) error
- func (c *CategoryRepository) UpdateCategory(category models.Category) (models.Category, error)
- type Report
- type ReportRepository
- type Repository
- type Transaction
- type TransactionRepository
- func (t *TransactionRepository) CreateTransaction(tr models.Transaction) (models.Transaction, error)
- func (t *TransactionRepository) GetTransaction(id, userId int) (models.Transaction, error)
- func (t *TransactionRepository) GetTransactions(userId int) ([]models.Transaction, error)
- func (t *TransactionRepository) UpdateTransaction(tr models.Transaction) (models.Transaction, error)
- type User
- type UserRepository
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 ¶
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)
type Authorization ¶
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 (*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 ¶
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 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 ¶
Click to show internal directories.
Click to hide internal directories.