Documentation ¶
Index ¶
- Constants
- type ProductStats
- type Repository
- func (r *Repository) CreateProductStats(productId int64, price, minimum, maximum, count int, ...) error
- func (r *Repository) FindByProductId(productId int64, tx *sql.Tx) (*ProductStats, error)
- func (r *Repository) HasProductStats(productId int64, tx *sql.Tx) (bool, error)
- func (r *Repository) UpdateProductStats(productId int64, price, minimum, maximum, count int, ...) error
Constants ¶
View Source
const ProductStatsTableName = "product_stats"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductStats ¶
type ProductStats struct { ProductId int64 `db:"product_id" json:"productId"` Price int `db:"price" json:"price"` Difference int `db:"difference" json:"difference"` DiscountPercent decimal.Decimal `db:"discount_percent" json:"discount_percent"` Average decimal.Decimal `db:"average" json:"average"` Minimum int `db:"minimum" json:"minimum"` Maximum int `db:"maximum" json:"maximum"` MetricEntryCount int `db:"entries" json:"entries"` }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
func (*Repository) CreateProductStats ¶
func (*Repository) FindByProductId ¶
func (r *Repository) FindByProductId(productId int64, tx *sql.Tx) (*ProductStats, error)
func (*Repository) HasProductStats ¶
func (*Repository) UpdateProductStats ¶
Click to show internal directories.
Click to hide internal directories.