expense

package
v0.0.0-...-63b04e8 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB() (*sql.DB, error)

func NewApplication

func NewApplication(db *sql.DB) *handler

Types

type Error

type Error struct {
	Message string `json:"message"`
}

type Expense

type Expense struct {
	ID     int      `json:"id"`
	Title  string   `json:"title"`
	Amount float64  `json:"amount"`
	Note   string   `json:"note"`
	Tags   []string `json:"tags"`
}

func CreateExpense

func CreateExpense(db *sql.DB, exp Expense) (Expense, error)

func GetExpenseByID

func GetExpenseByID(db *sql.DB, id int) (Expense, error)

func GetExpenses

func GetExpenses(db *sql.DB) ([]Expense, error)

func UpdateExpense

func UpdateExpense(db *sql.DB, exp Expense) (Expense, error)

Jump to

Keyboard shortcuts

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