models

package
v0.0.0-...-3db17e8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidId = errors.New("invalid id")
View Source
var ErrNilInstance = errors.New("nil instance")

Functions

This section is empty.

Types

type IngredientMongo

type IngredientMongo struct {
	Id              primitive.ObjectID    `bson:"_id,omitempty"`
	Name            string                `bson:"name"`
	MacrosForWeight *MacrosForWeightMongo `bson:"macros_for_weight"`
}

func (*IngredientMongo) Proto

func (instance *IngredientMongo) Proto() (*Ingredient, error)

type MacrosForWeightMongo

type MacrosForWeightMongo struct {
	Macros *MacrosMongo `bson:"macros"`
	Gramms float32      `bson:"gramms"`
}

func (*MacrosForWeightMongo) Proto

func (instance *MacrosForWeightMongo) Proto() (*MacrosForWeight, error)

type MacrosMongo

type MacrosMongo struct {
	Proteins float32 `bson:"proteins"`
	Carbs    float32 `bson:"carbs"`
	Fats     float32 `bson:"fats"`
	Calories float32 `bson:"calories"`
}

func (*MacrosMongo) Proto

func (instance *MacrosMongo) Proto() (*Macros, error)

type MealMongo

type MealMongo struct {
	Id                  primitive.ObjectID         `bson:"_id,omitempty"`
	Username            string                     `bson:"username"`
	RecipeId            primitive.ObjectID         `bson:"recipe_id,omitempty"`
	WeightedIngredients []*WeightedIngredientMongo `bson:"weighted_ingredients"`
	Timestamp           int64                      `bson:"timestamp"`
	MealStatus          uint8                      `bson:"meal_status"`
}

func (*MealMongo) Proto

func (instance *MealMongo) Proto() (*Meal, error)

type RecipeMongo

type RecipeMongo struct {
	Id                            primitive.ObjectID         `bson:"_id,omitempty"`
	Name                          string                     `bson:"name"`
	RecipeSteps                   string                     `bson:"recipe_steps"`
	ExampleIngredientsProportions []*WeightedIngredientMongo `bson:"example_ingredients_proportions"`
}

func (*RecipeMongo) Proto

func (instance *RecipeMongo) Proto() (*Recipe, error)

type WeightedIngredientMongo

type WeightedIngredientMongo struct {
	Ingredient *IngredientMongo `bson:"ingredient"`
	Gramms     float32          `bson:"gramms"`
}

func (*WeightedIngredientMongo) Proto

func (instance *WeightedIngredientMongo) Proto() (*WeightedIngredient, error)

Jump to

Keyboard shortcuts

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