repo

package
v0.0.0-...-7af1892 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldID = "id"

	CollectionNameCategory = "category"
	CollectionNameProduct  = "product"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryRepo

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

func NewCategoryRepo

func NewCategoryRepo(db *db.Database) *CategoryRepo

func (*CategoryRepo) Delete

func (c *CategoryRepo) Delete(ctx context.Context, category entity.Category) error

func (*CategoryRepo) DeleteSoft

func (c *CategoryRepo) DeleteSoft(ctx context.Context, category entity.Category) error

func (*CategoryRepo) FindByID

func (c *CategoryRepo) FindByID(ctx context.Context, id string) (entity.Category, error)

func (*CategoryRepo) Insert

func (c *CategoryRepo) Insert(ctx context.Context, category entity.Category) error

type ProductRepo

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

func NewProductRepo

func NewProductRepo(db *db.Database) *ProductRepo

func (*ProductRepo) BatchInsert

func (ph *ProductRepo) BatchInsert(ctx context.Context, products []entity.Product) error

func (*ProductRepo) Delete

func (ph *ProductRepo) Delete(ctx context.Context, product entity.Product) error

func (*ProductRepo) DeleteSoft

func (ph *ProductRepo) DeleteSoft(ctx context.Context, product entity.Product) error

func (*ProductRepo) FindById

func (ph *ProductRepo) FindById(ctx context.Context, id string) (entity.Product, error)

func (*ProductRepo) Insert

func (ph *ProductRepo) Insert(ctx context.Context, product entity.Product) error

func (*ProductRepo) Update

func (ph *ProductRepo) Update(ctx context.Context, product entity.Product) error

Jump to

Keyboard shortcuts

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