Documentation ¶
Index ¶
- type BudgetPostgres
- type CategoryPostgres
- type DB
- type ExpensePostgres
- func (ep *ExpensePostgres) CreateExpense(ctx context.Context, expense *model.Expense) (*model.Expense, error)
- func (ep *ExpensePostgres) DeleteExpenseByID(ctx context.Context, id int) error
- func (ep *ExpensePostgres) GetAllExpensesByPeriod(ctx context.Context, period times.Period) (int, error)
- func (ep *ExpensePostgres) GetBaseExpensesByPeriod(ctx context.Context, period times.Period) (int, error)
- func (ep *ExpensePostgres) GetLastExpenses(ctx context.Context) ([]*model.Expense, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BudgetPostgres ¶
type BudgetPostgres struct {
// contains filtered or unexported fields
}
BudgetPostgres repository.
func NewBudgetRepository ¶
func NewBudgetRepository(db *DB) *BudgetPostgres
NewBudgetRepository creates a new BudgetPostgres instance.
func (*BudgetPostgres) GetBaseBudget ¶
GetBaseBudget returns base model.Budget.
func (*BudgetPostgres) GetBudgetByCodename ¶
func (bp *BudgetPostgres) GetBudgetByCodename(ctx context.Context, name string) (*model.Budget, error)
GetBudgetByCodename returns model.Budget by codename.
type CategoryPostgres ¶
type CategoryPostgres struct {
// contains filtered or unexported fields
}
CategoryPostgres repository.
func NewCategoryRepository ¶
func NewCategoryRepository(db *DB) *CategoryPostgres
NewCategoryRepository creates a new CategoryPostgres instance.
func (*CategoryPostgres) GetAllCategories ¶
func (c *CategoryPostgres) GetAllCategories(ctx context.Context) ([]*model.DBCategory, error)
GetAllCategories returns all model.DBCategory.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB Postgres.
type ExpensePostgres ¶
type ExpensePostgres struct {
// contains filtered or unexported fields
}
ExpensePostgres repository.
func NewExpenseRepository ¶
func NewExpenseRepository(db *DB) *ExpensePostgres
NewExpenseRepository creates a new ExpensePostgres instance.
func (*ExpensePostgres) CreateExpense ¶
func (ep *ExpensePostgres) CreateExpense(ctx context.Context, expense *model.Expense) (*model.Expense, error)
CreateExpense creates a new model.Expense instance.
func (*ExpensePostgres) DeleteExpenseByID ¶
func (ep *ExpensePostgres) DeleteExpenseByID(ctx context.Context, id int) error
DeleteExpenseByID deletes model.Expense instance by id.
func (*ExpensePostgres) GetAllExpensesByPeriod ¶
func (ep *ExpensePostgres) GetAllExpensesByPeriod(ctx context.Context, period times.Period) (int, error)
GetAllExpensesByPeriod returns all model.Expense instances by period.
func (*ExpensePostgres) GetBaseExpensesByPeriod ¶
func (ep *ExpensePostgres) GetBaseExpensesByPeriod(ctx context.Context, period times.Period) (int, error)
GetBaseExpensesByPeriod returns base model.Expense instances by period.
func (*ExpensePostgres) GetLastExpenses ¶
GetLastExpenses returns last model.Expense instances.