entstorage

package
v0.0.0-...-a7e2c84 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, client *ent.Client) error

Types

type Config

type Config struct {
	StorageDriver string
	StorageDSN    string
	LogQueries    bool
	Migrate       bool
}

type EntStorage

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

func NewEntStorage

func NewEntStorage(
	cfg Config,
	logger logger.Logger,
) (*EntStorage, error)

func (*EntStorage) Close

func (s *EntStorage) Close() error

func (*EntStorage) CountRecipes

func (s *EntStorage) CountRecipes(ctx context.Context, filter recipe.Filter) (int, error)

func (*EntStorage) GetEquipment

func (s *EntStorage) GetEquipment(ctx context.Context, loc string) ([]*recipe.Equipment, error)

func (*EntStorage) GetEquipmentBySlug

func (s *EntStorage) GetEquipmentBySlug(ctx context.Context, slug string) (*recipe.Equipment, error)

func (*EntStorage) GetIngredientBySlug

func (s *EntStorage) GetIngredientBySlug(ctx context.Context, slug string) (*recipe.Ingredient, error)

func (*EntStorage) GetIngredients

func (s *EntStorage) GetIngredients(ctx context.Context, loc string) ([]*recipe.Ingredient, error)

func (*EntStorage) GetRecipe

func (s *EntStorage) GetRecipe(ctx context.Context, id uuid.UUID) (*recipe.Recipe, error)

func (*EntStorage) GetRecipeBySlug

func (s *EntStorage) GetRecipeBySlug(ctx context.Context, slug string) (*recipe.Recipe, error)

func (*EntStorage) GetRecipes

func (s *EntStorage) GetRecipes(ctx context.Context, filter recipe.Filter) ([]*recipe.Recipe, error)

func (*EntStorage) GetTagBySlug

func (s *EntStorage) GetTagBySlug(ctx context.Context, slug string) (*recipe.Tag, error)

func (*EntStorage) GetTags

func (s *EntStorage) GetTags(ctx context.Context, loc string) ([]*recipe.Tag, error)

func (*EntStorage) SaveRecipe

func (s *EntStorage) SaveRecipe(ctx context.Context, rec *recipe.Recipe) error

func (*EntStorage) UpdateCache

func (s *EntStorage) UpdateCache(ctx context.Context) error

Jump to

Keyboard shortcuts

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