Documentation ¶
Index ¶
- type IProductRepository
- type ProductRepository
- func (u *ProductRepository) CreateProduct(product *model.Product) (int64, error)
- func (u *ProductRepository) DeleteProductByID(productID int64) error
- func (u *ProductRepository) FindAll() (productAll []model.Product, err error)
- func (u *ProductRepository) FindProductByID(productID int64) (product *model.Product, err error)
- func (u *ProductRepository) InitTable() error
- func (u *ProductRepository) UpdateProduct(product *model.Product) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IProductRepository ¶
type IProductRepository interface { InitTable() error FindProductByID(int64) (*model.Product, error) CreateProduct(*model.Product) (int64, error) DeleteProductByID(int64) error UpdateProduct(*model.Product) error FindAll() ([]model.Product, error) }
func NewProductRepository ¶
func NewProductRepository(db *gorm.DB) IProductRepository
productRepository
type ProductRepository ¶
type ProductRepository struct {
// contains filtered or unexported fields
}
func (*ProductRepository) CreateProduct ¶
func (u *ProductRepository) CreateProduct(product *model.Product) (int64, error)
func (*ProductRepository) DeleteProductByID ¶
func (u *ProductRepository) DeleteProductByID(productID int64) error
func (*ProductRepository) FindAll ¶
func (u *ProductRepository) FindAll() (productAll []model.Product, err error)
func (*ProductRepository) FindProductByID ¶
func (u *ProductRepository) FindProductByID(productID int64) (product *model.Product, err error)
func (*ProductRepository) InitTable ¶
func (u *ProductRepository) InitTable() error
func (*ProductRepository) UpdateProduct ¶
func (u *ProductRepository) UpdateProduct(product *model.Product) error
Click to show internal directories.
Click to hide internal directories.