47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package repositories
|
|
|
|
import (
|
|
"database/sql"
|
|
"errors"
|
|
|
|
"git.jamestombleson.com/jtom38/go-cook/internal/domain"
|
|
)
|
|
|
|
type IRecipeTable interface {
|
|
Create(domain.RecipeEntity) error
|
|
List() ([]domain.RecipeEntity, error)
|
|
Get(id int) (domain.RecipeEntity, error)
|
|
Update(id int, entity domain.RecipeEntity) error
|
|
Delete(id int) error
|
|
}
|
|
|
|
type RecipeRepository struct {
|
|
client *sql.DB
|
|
}
|
|
|
|
func NewRecipeRepository(client *sql.DB) RecipeRepository {
|
|
return RecipeRepository{
|
|
client: client,
|
|
}
|
|
}
|
|
|
|
func (rr RecipeRepository) Create(domain.RecipeEntity) error {
|
|
return errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) List() ([]domain.RecipeEntity, error) {
|
|
return []domain.RecipeEntity{}, errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) Get(id int) (domain.RecipeEntity, error) {
|
|
return domain.RecipeEntity{}, errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) Update(id int, entity domain.RecipeEntity) error {
|
|
return errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) Delete(id int) error {
|
|
return errors.New("not implemented")
|
|
}
|