Documentation ¶
Index ¶
- func CalculateAge(age float64, unit string) float64
- func CalculateAlcoholConsumption(value float64, frequency string) float64
- func CalculateCholMMOLValue(value float64, unit string) float64
- func CalculateDietConsumption(value int, frequency string) int
- func CalculateExercise(value int, unit, frequency, intensity string) int
- func CalculateLength(value float64, unit, toUnit string) float64
- func CalculateMMOLValue(value float64, unit string) float64
- func ConvertAge(age float64) int
- func ConvertCholesterol(cholesterol float64, unit string) float64
- func ConvertLength(length float64, unit string) float64
- func ConvertSbp(sbp int) int
- func ConvertWeight(weight float64, unit string) float64
- func Float64InBetween(num, from, to float64) bool
- func GetCurrentDirectory() string
- func GetFullGenderText(g string) string
- func GetMD5Hash(text string) string
- func IntInBetween(num, from, to int) bool
- func JoinStrings(elem ...string) string
- func JoinStringsSep(sep string, elem ...string) string
- func ParseGuidesFiles(c echo.Context) (map[string][]byte, error)
- func SliceContainsAnyString(s, matches []string) bool
- func SliceContainsString(s []string, a string) (int, bool)
- func SliceStringEqual(a, b []string) bool
- func SliceStringUnique(original []string, caseSensitive bool) []string
- func StrAfterSubstr(str, substr string) string
- func StrBeforeSubstr(str, substr string) string
- func StrWithSubstrMaxLen(str, substr string, maxLen, addLen int) string
- func StrWithSubstrMaxLenIdx(str, substr string, idx, maxLen, addLen int) string
- func StringBetweenDelimiters(s, leftDelimiter, rightDelimiter string) string
- type Country
- type CountryCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateAlcoholConsumption ¶
CalculateAlcoholConsumption in servings weekly
func CalculateCholMMOLValue ¶
CalculateCholMMOLValue to convert value into mmol/L
func CalculateDietConsumption ¶
CalculateDietConsumption in servings weekly
func CalculateExercise ¶
CalculateExercise to minutes and moderate type weekly
func CalculateLength ¶
CalculateLength to convert units
func CalculateMMOLValue ¶
CalculateMMOLValue to convert value into mmol/L
func ConvertCholesterol ¶
ConvertCholesterol function
func Float64InBetween ¶ added in v1.5.0
Float64InBetween function
func GetFullGenderText ¶
GetFullGenderText returns full gender text
func JoinStrings ¶
JoinStrings returns a string composed from a given set of args.
func JoinStringsSep ¶
JoinStringsSep returns a string composed from the second and other args, separated by the separator as first arg.
func ParseGuidesFiles ¶
ParseGuidesFiles function
func SliceContainsAnyString ¶
SliceContainsAnyString returns true if any string of the given list is found
func SliceContainsString ¶
SliceContainsString returns idx and true if a found in s. Otherwise -1 and false.
func SliceStringEqual ¶
SliceStringEqual performs a simple check for equality for slices of strings.
func SliceStringUnique ¶
SliceStringUnique returns a slice of unique strings by discarding duplicates from the original.
func StrAfterSubstr ¶
StrAfterSubstr returns a string following after a given substr.
func StrBeforeSubstr ¶
StrBeforeSubstr returns a string preceding a given substr.
func StrWithSubstrMaxLen ¶
StrWithSubstrMaxLen returns a string containing a given substr. The returned string is no longer than maxLen.
If the original str is longer than maxLen, the returned string is: - if str starts with substr => result is str up to maxLen - if str ends with substr => result is str from len-maxLen up to the end - if str contains substr in the middle => substr gets surrounded by addLen such that maxLen = addLen + len(substr) addLen
func StrWithSubstrMaxLenIdx ¶
StrWithSubstrMaxLenIdx returns a string containing a given substr.
func StringBetweenDelimiters ¶
StringBetweenDelimiters will return the text between the given delimiters
Types ¶
type CountryCode ¶
CountryCode map
func Countries ¶
func Countries(countriesPath string) CountryCode
Countries returns list of countries