woolworths

package
v0.0.0-...-a309d64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 JSONTime

type JSONTime struct {
	time.Time
}

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) Init

func (w *Woolworths) Init(baseURL string, dbPath string, productMaxAge time.Duration) error

Init sets up the Woolworths struct with the given parameters

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL