Versions in this module Expand all Collapse all v1 v1.1.0 Aug 23, 2021 Changes in this version + type BudgetPostgres struct + func NewBudgetRepository(db *DB) *BudgetPostgres + func (bp *BudgetPostgres) GetBaseBudget(ctx context.Context) (*model.Budget, error) + func (bp *BudgetPostgres) GetBudgetByCodename(ctx context.Context, name string) (*model.Budget, error) + type CategoryPostgres struct + func NewCategoryRepository(db *DB) *CategoryPostgres + func (c *CategoryPostgres) GetAllCategories(ctx context.Context) ([]*model.DBCategory, error) + type DB struct + func New(ctx context.Context, config *config.DB) (*DB, error) + func (db *DB) Connect() (err error) + func (db *DB) KeepAlive() + type ExpensePostgres struct + func NewExpenseRepository(db *DB) *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)