Documentation ¶
Index ¶
Constants ¶
View Source
const ( FoundationFoodZippedCSV = "./FoodData_Central_Foundation_Food_csv_2021-04-28.zip" SupportingDataZippedCSV = "./FoodData_Central_Supporting_Data_csv_2021-04-28.zip" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Category ¶
type Category struct { ID string Code string // Food group code. Description string // Description of the food group. }
Foods of defined similarity.
type Food ¶
type Food struct { FDCID string // Unique permanent identifier of the food. Description string // Description of the food. CategoryID string // ID of the food category the food belongs to. ScientificName string // The scientific name for the food. FoodKey string // A string of characters used to identify both the current and all historical records for a specific food. CategoryCode string // See `Category.Code`. CategoryDesc string // See `Category.Description`. Nutrients []*FoodNutrient // Nutrient values this food. }
Any substance consumed by humans for nutrition, taste and/or aroma.
type FoodDB ¶
type FoodDB struct { Rows int Foods map[string]*Food Nutrients map[string]*Nutrient // All nutrients in the database. Categories map[string]*Category // All food categories in the database. }
func (*FoodDB) NewDBWithUniqueFoodNamesAndAverageNutritionalValues ¶
func (*FoodDB) NutrientTopList ¶
type FoodNutrient ¶
type FoodNutrient struct { ID string FDCID string // ID of the food this food nutrient pertains to. NutrientID string // ID of the nutrient to which the food nutrient pertains. Amount float64 // Amount of the nutrient per 100g of food. Specified in unit defined in the nutrient table. Name string // Name of the nutrient. UnitName string // The standard unit of measure for the nutrient (per 100g of food). }
A nutrient value for a food.
type Nutrient ¶
type Nutrient struct { ID string Name string // Name of the nutrient. UnitName string // The standard unit of measure for the nutrient (per 100g of food). NutrientNbr int64 // A unique code identifying a nutrient or food constituent. }
The chemical constituent of a food (e.g. calcium, vitamin E) officially recognized as essential to human health.
Click to show internal directories.
Click to hide internal directories.