Documentation ¶
Index ¶
- func GetDefaultFillIngredients() []*models.Ingredient
- func GetDefaultFillMeals(tags []*models.Tag, ingredients []*models.Ingredient) []*models.Meal
- func GetDefaultFillTags() []*models.Tag
- type Handler
- func (dbHandler *Handler) Close()
- func (dbHandler *Handler) CreateIngredient(ingredient models.Ingredient) (models.Ingredient, error)
- func (dbHandler *Handler) CreateMeal(meal models.Meal) (models.Meal, error)
- func (dbHandler *Handler) CreateTag(tag models.Tag) (models.Tag, error)
- func (dbHandler *Handler) DeleteMeal(id int64) error
- func (dbHandler *Handler) FindMealsByTag(tagID *int64) ([]*models.Meal, error)
- func (dbHandler *Handler) GetIngredients() ([]*models.Ingredient, error)
- func (dbHandler *Handler) GetMeal(id int64) (*models.Meal, error)
- func (dbHandler *Handler) GetTags() ([]*models.Tag, error)
- func (dbHandler *Handler) UpdateMeal(m models.Meal) (models.Meal, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultFillIngredients ¶
func GetDefaultFillIngredients() []*models.Ingredient
func GetDefaultFillMeals ¶
func GetDefaultFillTags ¶
Types ¶
type Handler ¶
Handler is a thin layer over Gorm
func (*Handler) CreateIngredient ¶
func (dbHandler *Handler) CreateIngredient(ingredient models.Ingredient) (models.Ingredient, error)
func (*Handler) CreateMeal ¶
func (*Handler) DeleteMeal ¶
func (*Handler) FindMealsByTag ¶
func (*Handler) GetIngredients ¶
func (dbHandler *Handler) GetIngredients() ([]*models.Ingredient, error)
Click to show internal directories.
Click to hide internal directories.