Documentation ¶
Index ¶
- type DB
- func (db *DB) Close() error
- func (db DB) DeleteExpense(id int) error
- func (db *DB) GetBudgetWithYearMonth(date string) string
- func (db *DB) GetDefaultBudget() string
- func (db *DB) GetExpensesWithYearMonth(yearMonth string) []domain.Expense
- func (db DB) InsertBudget(amount, date string) error
- func (db DB) InsertExpense(expense domain.Expense) error
- func (db DB) UpdateDefaultBudget(amount string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func CreateDB ¶
func CreateDB() *DB
CreateDB opens sqlite database connection and returns pointer to DB struct.
func (DB) DeleteExpense ¶
DeleteExpense deletes an expense from expenses table by its Id.
func (*DB) GetBudgetWithYearMonth ¶
GetBudgetWithYearMonth returns budget amount of a specific month and year (YYYY-MM).
func (*DB) GetDefaultBudget ¶
GetDefaultBudget returns the default monthly budget amount.
func (*DB) GetExpensesWithYearMonth ¶
GetWithMonthYear returns expenses of a specific month and year (YYYY-MM).
func (DB) InsertBudget ¶
InsertBudget inserts budget amount for a specific month and year (YYYY-MM).
func (DB) InsertExpense ¶
InsertExpense inserts a given expense into expenses table.
func (DB) UpdateDefaultBudget ¶
UpdateDefaultBudget updates the default monthly budget amount.
Click to show internal directories.
Click to hide internal directories.