Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { GetMonth(ctx context.Context, id uint) (db.Month, error) GetMonthID(ctx context.Context, year, month int) (uint, error) GetMonths(ctx context.Context, years ...int) ([]db.Month, error) GetSpendTypes(ctx context.Context) ([]db.SpendType, error) SearchSpends(ctx context.Context, args db.SearchSpendsArgs) ([]db.Spend, error) }
type FooterTemplateData ¶
type FooterTemplateData struct {}
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func NewHandlers ¶
func (Handlers) IndexPage ¶
func (h Handlers) IndexPage(w http.ResponseWriter, r *http.Request)
GET / - redirects to the current month page
func (Handlers) MonthPage ¶
func (h Handlers) MonthPage(w http.ResponseWriter, r *http.Request)
GET /{year:[0-9]+}-{month:[0-9]+}
func (Handlers) MonthsPage ¶ added in v0.7.0
func (h Handlers) MonthsPage(w http.ResponseWriter, r *http.Request)
GET /months?offset=0
func (Handlers) SearchSpendsPage ¶
func (h Handlers) SearchSpendsPage(w http.ResponseWriter, r *http.Request)
GET /search/spends
Query Params:
- title - spend title
- notes - spend notes
- min_cost - minimal const
- max_cost - maximal cost
- after - date in format 'yyyy-mm-dd'
- before - date in format 'yyyy-mm-dd'
- type_id - Spend Type id to search (can be passed multiple times: ?type_id=56&type_id=58). Use id '0' to search for Spends without type
- sort - sort type: 'title', 'date' or 'cost'
- order - sort order: 'asc' or 'desc'
Click to show internal directories.
Click to hide internal directories.