Documentation
¶
Index ¶
Constants ¶
View Source
const MockupDB = `` /* 404-byte string literal not displayed */
Mockup database for testing
Variables ¶
This section is empty.
Functions ¶
func AddPurchase ¶
AddPurchase adds a new a purchase to the database.
func DeletePurchase ¶
DeletePurchase removes a purchase from the database.
func ValidatePurchase ¶
ValidatePurchase validates a purchase before database insertion
Types ¶
type Purchase ¶
type Purchase struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Cost float64 `json:"cost"`
TimeBought time.Time `json:"time_bought" db:"time_bought"`
}
Purchase is the primary dal for an item purchased.
func GetPurchase ¶
GetPurchase retrieves a purchase by its ID.
func GetPurchases ¶
GetPurchases lists all purchases from the database.
Click to show internal directories.
Click to hide internal directories.