model

package
v0.0.0-...-1b63e00 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID         int       `storm:"id,increment" json:"id"`
	Height     float64   `json:"height"`
	Activity   float64   `json:"activity"`
	Birthday   time.Time `json:"birthday"`
	Gender     string    `json:"gender"`
	UnitSystem string    `json:"unitSystem"`
}

Config represents the configuration and is unique and holds data relevant for calculating the metabolic rate of the user

type Day

type Day struct {
	Entries Entries   `json:"entries"`
	Used    int       `json:"used"`
	Date    time.Time `json:"date"`
}

Day is an actual day with all it's entries and the calories which have been used for the day

type Days

type Days []*Day

Days is Custom slice type for a list of days

func (Days) Len

func (days Days) Len() int

func (Days) Less

func (days Days) Less(i, j int) bool

func (Days) Swap

func (days Days) Swap(i, j int)

type Entries

type Entries []Entry

Entries is a custom slice type for a list of entries

type Entry

type Entry struct {
	ID        int       `storm:"id,increment" json:"id"`
	Created   time.Time `json:"created"`
	EntryDate string    `json:"entryDate"`
	Calories  int       `json:"calories"`
	Food      string    `json:"food"`
	BMR       float64   `json:"bmr"`
	AMR       float64   `json:"amr"`
}

Entry can be added and removes and hold the date they have been added, the date they have been added to, the used calories and the food which has been consumed. Also, for each entry, the metabolic rates are calculated, for later bookkeeping

type ImpEx

type ImpEx struct {
	Config  *Config  `json:"config"`
	Entries Entries  `json:"entries"`
	Weights []Weight `json:"weights"`
}

ImpEx is the data structure for importing and exporting data to a and from the application

type Weight

type Weight struct {
	ID      int       `storm:"id,increment" json:"id"`
	Created time.Time `json:"created"`
	Weight  float64   `json:"weight"`
}

Weight represents the user's weight at a given time

Jump to

Keyboard shortcuts

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