Documentation ¶
Index ¶
- Constants
- func AskConfirmation(s string, r io.Reader) (bool, error)
- func CalculateAgeInYears(birthday time.Time) int
- func CalculateHarrisBenedict(age, height, weight, activity float64, gender string) (float64, float64)
- func GetBeginningOfWeek(date time.Time) time.Time
- func HeightUnit(unitSystem string, value float64) string
- func ToCm(height float64) float64
- func ToInches(height float64) float64
- func ToKg(weight float64) float64
- func ToPounds(weight float64) float64
- func WeightUnit(unitSystem string, value float64) string
Constants ¶
const DateFormat = "02.01.2006"
DateFormat is the date format we are using
const Imperial = "imperial"
Imperial depicts the identifier for the imperial unit system
const Metric = "metric"
Metric depicts the identifier for the metric unit system
Variables ¶
This section is empty.
Functions ¶
func AskConfirmation ¶
AskConfirmation asks the user for confirmation on a given question and returns the user's answer
func CalculateAgeInYears ¶
CalculateAgeInYears calculates the age in years given a date by comparing the year, month and day of now and the given date
func CalculateHarrisBenedict ¶
func CalculateHarrisBenedict(age, height, weight, activity float64, gender string) (float64, float64)
CalculateHarrisBenedict calculates Harris-Benedict (https://en.wikipedia.org/wiki/Harris%E2%80%93Benedict_equation) for calculating the basic metabolic rate
func GetBeginningOfWeek ¶
GetBeginningOfWeek calculates the first day of the week (Monday) given a date
func HeightUnit ¶
HeightUnit returns the height unit for the given unit system
func WeightUnit ¶
WeightUnit returns the weight unit for the given unit system
Types ¶
This section is empty.