catalogsync

package
v1.801.388 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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 (apps/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.

ALWAYS ON, against the ONE bus. It consumes the COMMERCE stream on pubsub.URL — the same embedded server every other app in this process reads, which always serves and fails boot closed. It used to require a knob of its own (CLOUD_COMMERCE_NATS_URL) that no manifest set, so the reverse edge was permanently inert while the bus it needed was running the whole time: an opt-in for a state that does not exist. A commerce publisher that is not wired simply produces no events, which this consumer already handles by waiting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(app cloud.Router, deps cloud.Deps) error

Mount starts the catalog-event consumer against the platform bus. It never blocks: the connect + consume loop runs in the background, and a connect failure is a warning and a retry, never a crash — the same fail-soft contract as the forward storefront edge.

func Shutdown

func Shutdown(_ context.Context) error

Shutdown stops the consumer on graceful cloud shutdown. Idempotent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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