Documentation ¶
Index ¶
- type CategoryRepository
- type CategoryService
- func (s CategoryService) Create(category m.Category) (m.Category, error)
- func (s CategoryService) Delete(categoryID uint) error
- func (s CategoryService) FindAll() ([]m.Category, error)
- func (s CategoryService) FindSingle(categoryID uint) (m.Category, error)
- func (s CategoryService) Update(category m.Category, categoryID uint) (m.Category, error)
- type ImageService
- type IngredientRepository
- type IngredientService
- func (s IngredientService) Create(ingredient m.Ingredient) (m.Ingredient, error)
- func (s IngredientService) Delete(ingredientID uint) error
- func (s IngredientService) FindAll() ([]m.Ingredient, error)
- func (s IngredientService) FindSingle(ingredientID uint) (m.Ingredient, error)
- func (s IngredientService) FindUnits() ([]m.Unit, error)
- func (s IngredientService) Update(ingredient m.Ingredient, ingredientID uint) (m.Ingredient, error)
- type LoggerInterface
- type RecipeRepository
- type RecipeService
- func (s RecipeService) Create(recipe m.Recipe) (m.Recipe, error)
- func (s RecipeService) CreateIngredientLink(link []m.RecipeIngredient, recipeID uint) ([]m.RecipeIngredient, error)
- func (s RecipeService) CreateInstruction(instruction m.Instruction, recipeID uint) (m.Instruction, error)
- func (s RecipeService) Delete(recipeID uint) error
- func (s RecipeService) DeleteIngredientLink(link []m.RecipeIngredient, recipeID uint) error
- func (s RecipeService) DeleteInstruction(recipeID uint) error
- func (s RecipeService) FindAll() ([]m.Recipe, error)
- func (s RecipeService) FindIngredientLink(recipeID uint) ([]m.RecipeIngredient, error)
- func (s RecipeService) FindInstruction(recipeID uint) (m.Instruction, error)
- func (s RecipeService) FindSingle(recipeID uint) (m.Recipe, error)
- func (s RecipeService) Update(recipe m.Recipe, recipeID uint) (m.Recipe, error)
- func (s RecipeService) UpdateIngredientLink(link []m.RecipeIngredient, recipeID uint) ([]m.RecipeIngredient, error)
- func (s RecipeService) UpdateInstruction(instruction m.Instruction, recipeID uint) (m.Instruction, error)
- type S3Repository
- type TagRepository
- type TagService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryRepository ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func NewCategoryService ¶
func NewCategoryService(categoryRepo CategoryRepository) *CategoryService
NewCategoryService creates a new CategoryService instance
func (CategoryService) Delete ¶
func (s CategoryService) Delete(categoryID uint) error
func (CategoryService) FindSingle ¶
func (s CategoryService) FindSingle(categoryID uint) (m.Category, error)
type ImageService ¶
type ImageService struct {
// contains filtered or unexported fields
}
func NewImageService ¶
func NewImageService(repo S3Repository, logger LoggerInterface) *ImageService
func (ImageService) UploadImage ¶
func (s ImageService) UploadImage(file multipart.File, recipeID int) bool
type IngredientRepository ¶
type IngredientRepository interface { FindAll() ([]m.Ingredient, error) FindUnits() ([]m.Unit, error) FindSingle(ingredientID uint) (m.Ingredient, error) Create(ingredient m.Ingredient) (m.Ingredient, error) Update(ingredient m.Ingredient) (m.Ingredient, error) Delete(ingredient m.Ingredient) error }
type IngredientService ¶
type IngredientService struct {
// contains filtered or unexported fields
}
func NewIngredientService ¶
func NewIngredientService(ingredientRepo IngredientRepository) *IngredientService
NewRecipeService creates a new RecipeService instance
func (IngredientService) Create ¶
func (s IngredientService) Create(ingredient m.Ingredient) (m.Ingredient, error)
func (IngredientService) Delete ¶
func (s IngredientService) Delete(ingredientID uint) error
func (IngredientService) FindAll ¶
func (s IngredientService) FindAll() ([]m.Ingredient, error)
func (IngredientService) FindSingle ¶
func (s IngredientService) FindSingle(ingredientID uint) (m.Ingredient, error)
func (IngredientService) Update ¶
func (s IngredientService) Update(ingredient m.Ingredient, ingredientID uint) (m.Ingredient, error)
type LoggerInterface ¶
type LoggerInterface interface {
Errorf(format string, args ...interface{})
}
type RecipeRepository ¶
type RecipeRepository interface { FindAll() ([]m.Recipe, error) FindSingle(recipeID uint) (m.Recipe, error) Create(recipe m.Recipe) (m.Recipe, error) Update(recipe m.Recipe) (m.Recipe, error) Delete(recipe m.Recipe) error FindInstruction(recipeID uint) (m.Instruction, error) CreateInstruction(instruction m.Instruction) (m.Instruction, error) UpdateInstruction(instruction m.Instruction) (m.Instruction, error) DeleteInstruction(instruction m.Instruction) error FindIngredientLink(recipeID uint) ([]m.RecipeIngredient, error) CreateIngredientLink(link []m.RecipeIngredient) ([]m.RecipeIngredient, error) UpdateIngredientLink(link []m.RecipeIngredient) ([]m.RecipeIngredient, error) DeleteIngredientLink(link []m.RecipeIngredient) error }
type RecipeService ¶
type RecipeService struct {
// contains filtered or unexported fields
}
func NewRecipeService ¶
func NewRecipeService(recipeRepo RecipeRepository) *RecipeService
NewRecipeService creates a new RecipeService instance
func (RecipeService) Create ¶
Create handles the business logic for the creation of a recipe and passes the recipe object to the recipe repo for processing
func (RecipeService) CreateIngredientLink ¶
func (s RecipeService) CreateIngredientLink(link []m.RecipeIngredient, recipeID uint) ([]m.RecipeIngredient, error)
func (RecipeService) CreateInstruction ¶
func (s RecipeService) CreateInstruction(instruction m.Instruction, recipeID uint) (m.Instruction, error)
func (RecipeService) Delete ¶
func (s RecipeService) Delete(recipeID uint) error
func (RecipeService) DeleteIngredientLink ¶
func (s RecipeService) DeleteIngredientLink(link []m.RecipeIngredient, recipeID uint) error
func (RecipeService) DeleteInstruction ¶
func (s RecipeService) DeleteInstruction(recipeID uint) error
func (RecipeService) FindAll ¶
func (s RecipeService) FindAll() ([]m.Recipe, error)
Find contains the business logic to get all recipes
func (RecipeService) FindIngredientLink ¶
func (s RecipeService) FindIngredientLink(recipeID uint) ([]m.RecipeIngredient, error)
func (RecipeService) FindInstruction ¶
func (s RecipeService) FindInstruction(recipeID uint) (m.Instruction, error)
func (RecipeService) FindSingle ¶
func (s RecipeService) FindSingle(recipeID uint) (m.Recipe, error)
Find contains the business logic to get a specific recipe
func (RecipeService) UpdateIngredientLink ¶
func (s RecipeService) UpdateIngredientLink(link []m.RecipeIngredient, recipeID uint) ([]m.RecipeIngredient, error)
func (RecipeService) UpdateInstruction ¶
func (s RecipeService) UpdateInstruction(instruction m.Instruction, recipeID uint) (m.Instruction, error)
type S3Repository ¶
type TagRepository ¶
type TagService ¶
type TagService struct {
// contains filtered or unexported fields
}
func NewTagService ¶
func NewTagService(tagRepo TagRepository) *TagService
NewTagService creates a new TagService instance
func (TagService) Delete ¶
func (s TagService) Delete(tagID uint) error
func (TagService) FindSingle ¶
func (s TagService) FindSingle(tagID uint) (m.Tag, error)
Click to show internal directories.
Click to hide internal directories.