catalogsync

package
v1.801.218 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 13 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 (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

func Mount(app *zip.App, deps cloud.Deps) error

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.

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