Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Product ¶
type Product struct { ID int `json:"_" gorm:"autoIncrement,primaryKey"` Sku string `json:"sku"` Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` MerchantID string `json:"merchantId"` Brand string `json:"brand"` Price float64 `json:"price"` ImageURL string `json:"imageUrl"` TimeAdded time.Time `json:"timeAdded"` }
type ProductRepo ¶
type ProductRepo struct {
// contains filtered or unexported fields
}
ProductRepo is the default implementation for Repository inteface.
func NewRepository ¶
func NewRepository(db *gorm.DB, tracer opentracing.Tracer) *ProductRepo
NewRepository returns a new product repository object.
func (*ProductRepo) GetProductBySKU ¶
func (*ProductRepo) SaveProduct ¶
func (r *ProductRepo) SaveProduct(ctx context.Context, product *Product) error
SaveProduct saves a new product to the database.
Click to show internal directories.
Click to hide internal directories.