repositories

package
v0.0.0-...-966343e Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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) Create

func (r *CategoryRepository) Create(category m.Category) (m.Category, error)

func (*CategoryRepository) Delete

func (r *CategoryRepository) Delete(category m.Category) error

func (*CategoryRepository) FindAll

func (r *CategoryRepository) FindAll() ([]m.Category, error)

func (*CategoryRepository) FindSingle

func (r *CategoryRepository) FindSingle(categoryID uint) (m.Category, error)

func (*CategoryRepository) Update

func (r *CategoryRepository) Update(category m.Category) (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) FindUnits

func (r IngredientRepository) FindUnits() ([]m.Unit, 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

func (r RecipeRepository) Create(recipe m.Recipe) (m.Recipe, error)

Create handles the creation of a recipe and stores the relevant information in the database

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) Delete

func (r RecipeRepository) Delete(recipe m.Recipe) error
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 (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) Update

func (r RecipeRepository) Update(recipe m.Recipe) (m.Recipe, error)
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

func (r S3Repository) UploadImage(file multipart.File, filename string, recipeID int) bool

type TagRepository

type TagRepository struct {
	// contains filtered or unexported fields
}

func NewTagRepository

func NewTagRepository(db *gorm.DB) *TagRepository

func (*TagRepository) Create

func (r *TagRepository) Create(tag m.Tag) (m.Tag, error)

func (*TagRepository) Delete

func (r *TagRepository) Delete(tag m.Tag) error

func (*TagRepository) FindAll

func (r *TagRepository) FindAll() ([]m.Tag, error)

func (*TagRepository) FindSingle

func (r *TagRepository) FindSingle(tagID uint) (m.Tag, error)

func (*TagRepository) Update

func (r *TagRepository) Update(tag m.Tag) (m.Tag, error)

Jump to

Keyboard shortcuts

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