Documentation
¶
Overview ¶
Package catalogsync is the REVERSE half of the storefront loop: it consumes the commerce COMMERCE stream and turns each `commerce.product.created` into ONE content.EnsureCatalogAsset call, so a newly-created catalog product gets its ecom asset rendered (design == slug) — the mirror of the forward edge (clients/content storefront.go) that publishes a rendered asset back onto the product image.
It is a thin, in-process consumer subsystem: the mapping/idempotency/skip logic lives in the content lane (content.EnsureCatalogAsset); this package owns ONLY "read the product event off NATS and dispatch it". Decomplected from commerce and content — the COMMERCE stream is the seam, so neither imports the other; catalogsync imports both.
INERT BY DEFAULT. Commerce publishes catalog events only when its NATS publisher is wired, and this consumer runs only when CLOUD_COMMERCE_NATS_URL names the NATS that carries them (the same server cloud's embedded pubsub binds). Unset ⇒ the subsystem is a no-op and connects nothing, exactly like the publisher degrades to no-op when NATS is absent — the loop is off end-to-end until an operator wires both halves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mount ¶
Mount starts the catalog-event consumer when CLOUD_COMMERCE_NATS_URL is set, else is a no-op (the loop stays off until an operator wires NATS). It never blocks: the connect + consume loop runs in the background, and a connect failure degrades to inert (a warning, never a crash) — the same fail-soft contract as the forward storefront edge.
Types ¶
This section is empty.