Documentation ¶
Index ¶
- Constants
- func NewProductRepository(db *sqlx.DB) business.ProductRepository
- type ProductRepositoryImpl
- func (p ProductRepositoryImpl) Delete(value string) error
- func (p ProductRepositoryImpl) FindById(value string) (models.Product, error)
- func (p ProductRepositoryImpl) ListAllProducts() []models.Product
- func (p ProductRepositoryImpl) Save(product models.Product) error
- func (p ProductRepositoryImpl) Update(product models.Product) error
Constants ¶
View Source
const ( INSERT = "INSERT INTO products (product_id, name, price) VALUES ($1, $2, $3)" UPDATE = "UPDATE products SET name = $1, price = $2 WHERE product_id = $3" DELETE = "DELETE FROM products WHERE product_id = $1" FIND_ID = "SELECT * FROM products WHERE product_id = $1" LIST_ALL = "SELECT * FROM products" )
Variables ¶
This section is empty.
Functions ¶
func NewProductRepository ¶
func NewProductRepository(db *sqlx.DB) business.ProductRepository
Types ¶
type ProductRepositoryImpl ¶
type ProductRepositoryImpl struct {
// contains filtered or unexported fields
}
func (ProductRepositoryImpl) Delete ¶
func (p ProductRepositoryImpl) Delete(value string) error
func (ProductRepositoryImpl) FindById ¶
func (p ProductRepositoryImpl) FindById(value string) (models.Product, error)
func (ProductRepositoryImpl) ListAllProducts ¶
func (p ProductRepositoryImpl) ListAllProducts() []models.Product
Click to show internal directories.
Click to hide internal directories.