Documentation ¶
Index ¶
- func MustNewDevelopmentDB(ddlConnStr, migrationDir string) (*sqlx.DB, func())
- func RandString(n int) string
- type Storage
- func (s *Storage) Commit(ctx context.Context) error
- func (s *Storage) CreateBrand(ctx context.Context, req storage.Brand) (string, error)
- func (s *Storage) CreateBrandValidation(ctx context.Context, req storage.Brand) error
- func (s *Storage) CreateCategory(ctx context.Context, req storage.Category) (string, error)
- func (s *Storage) CreateCategoryValidation(ctx context.Context, req storage.Category) error
- func (s *Storage) CreateRecipe(ctx context.Context, req storage.Recipe) (string, error)
- func (s *Storage) CreateRecipeValidation(ctx context.Context, req storage.Recipe) error
- func (s Storage) DeleteAllRecipePermanently(ctx context.Context) error
- func (s *Storage) DeleteBrand(ctx context.Context, id, deletedBy string) error
- func (s Storage) DeleteBrandsPermanently(ctx context.Context) error
- func (s *Storage) DeleteCategory(ctx context.Context, id, deletedBy string) error
- func (s *Storage) DeleteRecipe(ctx context.Context, id, deletedBy string) error
- func (s *Storage) GetBrandByID(ctx context.Context, id string) (*storage.Brand, error)
- func (s *Storage) GetCategoryByID(ctx context.Context, id string) (*storage.Category, error)
- func (s *Storage) GetRecipeByID(ctx context.Context, id string) (*storage.Recipe, error)
- func (s *Storage) ListBrand(ctx context.Context, req storage.ListBrandFilter) ([]storage.Brand, error)
- func (s *Storage) ListCategories(ctx context.Context, req storage.ListCategoryFilter) ([]storage.Category, error)
- func (s *Storage) ListRecipe(ctx context.Context, req storage.ListRecipeFilter) ([]storage.Recipe, error)
- func (s *Storage) NewTransacton(ctx context.Context) (context.Context, error)
- func (s *Storage) Rollback(ctx context.Context) error
- func (s *Storage) RunMigration(dir string) error
- func (s *Storage) UpdateBrand(ctx context.Context, sc storage.Brand) (*storage.Brand, error)
- func (s *Storage) UpdateCategory(ctx context.Context, sc storage.Category) (*storage.Category, error)
- func (s *Storage) UpdateRecipe(ctx context.Context, sc storage.Recipe) (*storage.Recipe, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustNewDevelopmentDB ¶
MustNewDevelopmentDB creates a new isolated database for the use of a package test The checking of dbconn is expected to be done in the package test using this
func RandString ¶
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
NewStorage returns a new Storage from the provides psql databse string
func NewStorageDB ¶
func NewTestStorage ¶
NewTestStorage returns a Storage that uses an isolated database for testing purposes and a teardown function
func (*Storage) CreateBrand ¶
func (*Storage) CreateBrandValidation ¶
func (*Storage) CreateCategory ¶
func (*Storage) CreateCategoryValidation ¶
func (*Storage) CreateRecipe ¶
func (*Storage) CreateRecipeValidation ¶
func (Storage) DeleteAllRecipePermanently ¶
func (*Storage) DeleteBrand ¶
func (Storage) DeleteBrandsPermanently ¶
func (*Storage) DeleteCategory ¶
func (*Storage) DeleteRecipe ¶
func (*Storage) GetBrandByID ¶
func (*Storage) GetCategoryByID ¶
func (*Storage) GetRecipeByID ¶
func (*Storage) ListCategories ¶
func (*Storage) ListRecipe ¶
func (*Storage) NewTransacton ¶
func (*Storage) RunMigration ¶
RunMigration runs the migrations in the dir using the goose package
func (*Storage) UpdateBrand ¶
func (*Storage) UpdateCategory ¶
Click to show internal directories.
Click to hide internal directories.