Documentation ¶
Index ¶
- Constants
- type DepartmentCategoriesList
- type JSONTime
- type Woolworths
- func (w *Woolworths) GetSharedProductsUpdatedAfter(t time.Time, count int) ([]shared.ProductInfo, error)
- func (w *Woolworths) GetTotalProductCount() (int, error)
- func (w *Woolworths) Init(baseURL string, dbPath string, productMaxAge time.Duration) error
- func (w *Woolworths) Run(cancel chan struct{})
Constants ¶
View Source
const DB_SCHEMA_VERSION = 7
View Source
const DEFAULT_LISTING_PAGE_CHECK_INTERVAL = 1 * time.Minute
View Source
const DEFAULT_PRODUCT_UPDATE_BATCH_SIZE = 10
View Source
const PRODUCTS_PER_PAGE = 36
View Source
const PRODUCT_INFO_WORKER_COUNT = 2
View Source
const WOOLWORTHS_ID_PREFIX = "woolworths_sku_"
Prefix for product IDs when exported outside of woolworths-world
View Source
const WOOLWORTHS_PRODUCT_URL_FORMAT = "%s/api/v3/ui/schemaorg/product/%s"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepartmentCategoriesList ¶
type DepartmentCategoriesList struct {
Categories []departmentInfo `json:"Categories"`
}
type Woolworths ¶
type Woolworths struct {
// contains filtered or unexported fields
}
Woolworths satisfies the ProductInfoGetter interface to provide a stream of product information from Woolworths.
func (*Woolworths) GetSharedProductsUpdatedAfter ¶
func (w *Woolworths) GetSharedProductsUpdatedAfter(t time.Time, count int) ([]shared.ProductInfo, error)
GetSharedProductsUpdatedAfter provides a list of product IDs that have been updated since the given time
func (*Woolworths) GetTotalProductCount ¶
func (w *Woolworths) GetTotalProductCount() (int, error)
GetTotalProductCount returns the total number of products in the database
func (*Woolworths) Run ¶
func (w *Woolworths) Run(cancel chan struct{})
Runs up all the workers and mediates data flowing between them. Currently all sqlite writes happen via this function. This may move off to a separate goroutine in the future.
Click to show internal directories.
Click to hide internal directories.