coles

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const BROWSE_HOMEPAGE_URL_FORMAT = "%s/browse"
View Source
const BROWSE_JSON_URL_FORMAT = "%s/_next/data/%s/en/browse.json"
View Source
const CATEGORY_URL_FORMAT = "%s/_next/data/%s/en/browse/%s.json"
View Source
const COLES_ID_PREFIX = "coles_id_"
View Source
const DB_SCHEMA_VERSION = 1
View Source
const DEFAULT_API_VERSION = "20240827.02_v4.7.7"
View Source
const DEFAULT_LISTING_PAGE_CHECK_INTERVAL = 1 * time.Minute
View Source
const PRODUCTS_PER_PAGE = 48
View Source
const SCRAPE_TRAP_STRING = "Pardon Our Interruption"

Variables

View Source
var ErrHitScrapeTrap = errors.New("caught in a scrape trap")

Functions

This section is empty.

Types

type Coles

type Coles struct {
	// contains filtered or unexported fields
}

Coles satisfies the ProductInfoGetter interface.

func (*Coles) GetSharedProductsUpdatedAfter

func (c *Coles) 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 (*Coles) GetTotalProductCount

func (c *Coles) GetTotalProductCount() (int, error)

GetTotalProductCount returns the total number of products in the database.

func (*Coles) Init

func (c *Coles) Init(baseURL string, dbPath string, productMaxAge time.Duration) error

Init initialises the Coles struct.

func (*Coles) Run

func (c *Coles) 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