controllers

package
v0.0.0-...-ae9f1f3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CategoryController categoryController

CategoryController for /categories endpoint.

View Source
var CategoryStatsController categoryStatsController

CategoryStatsController for /stats/category endpoint.

View Source
var ExpenditureController expenditureController

ExpenditureController Contains the actions for the 'expenditures' endpoint.

View Source
var ExportController exportController

ExportController for /exports endpoint.

Functions

This section is empty.

Types

type CategoryResponse

type CategoryResponse struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

CategoryResponse holds the response data for a category.

func TransformCategory

func TransformCategory(categories ...*models.Category) (result []*CategoryResponse)

TransformCategory transforms one or more categories.

type CategoryStatsResponse

type CategoryStatsResponse struct {
	ID    uint              `json:"id"`
	Name  models.NullString `json:"name"`
	Total float64           `json:"total"`
}

CategoryStatsResponse contains statistics for a category.

type ExpenditureResponse

type ExpenditureResponse struct {
	ID       uint              `json:"id"`
	Amount   float64           `json:"amount"`
	Date     time.Time         `json:"date"`
	Category *CategoryResponse `json:"category"`
}

ExpenditureResponse holds the response data for an expenditure.

func TransformExpenditure

func TransformExpenditure(expenditures ...*models.Expenditure) (result []*ExpenditureResponse)

TransformExpenditure transforms one or more expenditures.

Jump to

Keyboard shortcuts

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