Documentation
¶
Index ¶
- type CategoryRepository
- func (r *CategoryRepository) Create(category m.Category) (m.Category, error)
- func (r *CategoryRepository) Delete(category m.Category) error
- func (r *CategoryRepository) FindAll() ([]m.Category, error)
- func (r *CategoryRepository) FindSingle(categoryID uint) (m.Category, error)
- func (r *CategoryRepository) Update(category m.Category) (m.Category, error)
- type IngredientRepository
- func (r IngredientRepository) Create(ingredient m.Ingredient) (m.Ingredient, error)
- func (r IngredientRepository) Delete(ingredient m.Ingredient) error
- func (r IngredientRepository) FindAll() ([]m.Ingredient, error)
- func (r IngredientRepository) FindSingle(ingredientID uint) (m.Ingredient, error)
- func (r IngredientRepository) FindUnits() ([]m.Unit, error)
- func (r IngredientRepository) Update(ingredient m.Ingredient) (m.Ingredient, error)
- type LoggerInterface
- type RecipeRepository
- func (r RecipeRepository) Create(recipe m.Recipe) (m.Recipe, error)
- func (r RecipeRepository) CreateIngredientLink(link []m.RecipeIngredient) ([]m.RecipeIngredient, error)
- func (r RecipeRepository) CreateInstruction(instruction m.Instruction) (m.Instruction, error)
- func (r RecipeRepository) Delete(recipe m.Recipe) error
- func (r RecipeRepository) DeleteIngredientLink(link []m.RecipeIngredient) error
- func (r RecipeRepository) DeleteInstruction(instruction m.Instruction) error
- func (r RecipeRepository) FindAll() ([]m.Recipe, error)
- func (r RecipeRepository) FindIngredientLink(recipeID uint) ([]m.RecipeIngredient, error)
- func (r RecipeRepository) FindInstruction(recipeID uint) (m.Instruction, error)
- func (r RecipeRepository) FindSingle(recipeID uint) (m.Recipe, error)
- func (r RecipeRepository) Update(recipe m.Recipe) (m.Recipe, error)
- func (r RecipeRepository) UpdateIngredientLink(link []m.RecipeIngredient) ([]m.RecipeIngredient, error)
- func (r RecipeRepository) UpdateInstruction(instruction m.Instruction) (m.Instruction, error)
- type S3Interface
- type S3Repository
- type TagRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryRepository ¶
type CategoryRepository struct {
// contains filtered or unexported fields
}
func NewCategoryRepository ¶
func NewCategoryRepository(db *gorm.DB) *CategoryRepository
func (*CategoryRepository) FindSingle ¶
func (r *CategoryRepository) FindSingle(categoryID uint) (m.Category, error)
type IngredientRepository ¶
type IngredientRepository struct {
// contains filtered or unexported fields
}
func NewIngredientRepository ¶
func NewIngredientRepository(db *gorm.DB) *IngredientRepository
func (IngredientRepository) Create ¶
func (r IngredientRepository) Create(ingredient m.Ingredient) (m.Ingredient, error)
func (IngredientRepository) Delete ¶
func (r IngredientRepository) Delete(ingredient m.Ingredient) error
func (IngredientRepository) FindAll ¶
func (r IngredientRepository) FindAll() ([]m.Ingredient, error)
func (IngredientRepository) FindSingle ¶
func (r IngredientRepository) FindSingle(ingredientID uint) (m.Ingredient, error)
func (IngredientRepository) Update ¶
func (r IngredientRepository) Update(ingredient m.Ingredient) (m.Ingredient, error)
type LoggerInterface ¶
type LoggerInterface interface {
Error(args ...interface{})
}
type RecipeRepository ¶
type RecipeRepository struct {
// contains filtered or unexported fields
}
func NewRecipeRepository ¶
func NewRecipeRepository(db *gorm.DB) *RecipeRepository
func (RecipeRepository) Create ¶
Create handles the creation of a recipe and stores the relevant information in the database
func (RecipeRepository) CreateIngredientLink ¶
func (r RecipeRepository) CreateIngredientLink(link []m.RecipeIngredient) ([]m.RecipeIngredient, error)
func (RecipeRepository) CreateInstruction ¶
func (r RecipeRepository) CreateInstruction(instruction m.Instruction) (m.Instruction, error)
func (RecipeRepository) DeleteIngredientLink ¶
func (r RecipeRepository) DeleteIngredientLink(link []m.RecipeIngredient) error
func (RecipeRepository) DeleteInstruction ¶
func (r RecipeRepository) DeleteInstruction(instruction m.Instruction) error
func (RecipeRepository) FindAll ¶
func (r RecipeRepository) FindAll() ([]m.Recipe, error)
FindAll retrieves all recipes from the database and returns them in a slice
func (RecipeRepository) FindIngredientLink ¶
func (r RecipeRepository) FindIngredientLink(recipeID uint) ([]m.RecipeIngredient, error)
FindRecipeIngredients finds all ingredients associated to a recipe and returns them in a slice
func (RecipeRepository) FindInstruction ¶
func (r RecipeRepository) FindInstruction(recipeID uint) (m.Instruction, error)
func (RecipeRepository) FindSingle ¶
func (r RecipeRepository) FindSingle(recipeID uint) (m.Recipe, error)
Find searches for a specific recipe in the database and returns it when found.
func (RecipeRepository) UpdateIngredientLink ¶
func (r RecipeRepository) UpdateIngredientLink(link []m.RecipeIngredient) ([]m.RecipeIngredient, error)
func (RecipeRepository) UpdateInstruction ¶
func (r RecipeRepository) UpdateInstruction(instruction m.Instruction) (m.Instruction, error)
type S3Interface ¶
type S3Interface interface {
PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)
}
type S3Repository ¶
type S3Repository struct {
// contains filtered or unexported fields
}
func NewS3Repository ¶
func NewS3Repository(db *gorm.DB, s3Config m.S3Config, s3Client S3Interface, logger LoggerInterface) *S3Repository
func (S3Repository) UploadImage ¶
type TagRepository ¶
type TagRepository struct {
// contains filtered or unexported fields
}
func NewTagRepository ¶
func NewTagRepository(db *gorm.DB) *TagRepository
func (*TagRepository) FindSingle ¶
func (r *TagRepository) FindSingle(tagID uint) (m.Tag, error)
Click to show internal directories.
Click to hide internal directories.