Process composition: read the environment, wire the rails, serve.
The only namespace that knows what a deployment is. Adapters that need a
vendor SDK are resolved at runtime — a build without the :stripe alias
simply has no Stripe gateway, and says so in the log instead of failing to
start.
A host application embeds this store by calling start! with its own
fulfilment, identity, and catalog; everything else comes from the
environment.
Process composition: read the environment, wire the rails, serve. The only namespace that knows what a deployment is. Adapters that need a vendor SDK are resolved at runtime — a build without the `:stripe` alias simply has no Stripe gateway, and says so in the log instead of failing to start. A host application embeds this store by calling `start!` with its own fulfilment, identity, and catalog; everything else comes from the environment.
(analytics-of {:keys [backend] :as config} client)The IAnalytics a deployment asked for.
The IAnalytics a deployment asked for.
(card-gateway {:keys [backend api-key] :as config})The ICardGateway a deployment asked for, or nil.
The ICardGateway a deployment asked for, or nil.
(chain-wallet {:keys [backend moneropay-url wallet-rpc]} client)The IChainWallet a deployment asked for, or nil when it wants no chain rail.
The IChainWallet a deployment asked for, or nil when it wants no chain rail.
(config)The deployment, read from the environment.
The deployment, read from the environment.
(endpoints {:keys [chain cards store analytics]})The services this deployment must be able to reach, read off the same config the builders above are wired from.
A rail that is not configured is not probed.
The services this deployment must be able to reach, read off the same config the builders above are wired from. A rail that is not configured is not probed.
(fulfilment-of kind order-store)The IFulfilment a deployment asked for.
The IFulfilment a deployment asked for.
(identify-fn-of kind)The identity seam a deployment asked for.
:header trusts a request header outright, so it is only ever a demo or a
deployment sitting behind a gateway that has already authenticated the
caller. Anything real supplies its own :identify-fn to start!.
The identity seam a deployment asked for. `:header` trusts a request header outright, so it is only ever a demo or a deployment sitting behind a gateway that has already authenticated the caller. Anything real supplies its own `:identify-fn` to `start!`.
(load-catalog! {:keys [catalog-file]})Register the catalog: the file :catalog-file names, or the sample.
Register the catalog: the file `:catalog-file` names, or the sample.
(load-experiments {:keys [tokens-file]})The experiments declared in the token file, or none.
Read through design-forge, resolved LAZILY: the design pipeline is a BUILD dependency, and a deployment that ships the generated CSS without it still runs — with no experiments, which is what a store with no design pipeline should have. A missing or malformed token file is not fatal either: refusing to boot a payment system over a design artifact would be the wrong trade.
The experiments declared in the token file, or none. Read through design-forge, resolved LAZILY: the design pipeline is a BUILD dependency, and a deployment that ships the generated CSS without it still runs — with no experiments, which is what a store with no design pipeline should have. A missing or malformed token file is not fatal either: refusing to boot a payment system over a design artifact would be the wrong trade.
(order-store {:keys [backend] :as config})The IOrderStore a deployment asked for.
:jdbc needs the :jdbc alias; without it the store falls back to memory
and says so, because a template that refuses to boot teaches nothing.
The IOrderStore a deployment asked for. `:jdbc` needs the `:jdbc` alias; without it the store falls back to memory and says so, because a template that refuses to boot teaches nothing.
(rails {:keys [chain cards manual?]} {:keys [client]})The rail registry for config.
A rail that cannot settle is never advertised: a chain rail needs a wallet to watch, and a card rail needs the credentials it opens and re-reads sessions with. A configured Stripe with no webhook secret still registers and still refuses every notice — the signed fast path is off, the polled path carries it.
The rail registry for `config`. A rail that cannot settle is never advertised: a chain rail needs a wallet to watch, and a card rail needs the credentials it opens and re-reads sessions with. A configured Stripe with no webhook secret still registers and still refuses every notice — the signed fast path is off, the polled path carries it.
(rates-feed {:keys [ttl-ms]} client)A cached round over the public tickers, as a 0-arity function.
A cached round over the public tickers, as a 0-arity function.
(report-reachability!)Print what a telnet to each configured service would have told you, and
return the summary. Reads the same environment start! does.
Print what a telnet to each configured service would have told you, and return the summary. Reads the same environment `start!` does.
(start!)(start! overrides)Boot the store. Returns {:server :deps :stop-reconcile :config}.
overrides is how a host application embeds this store: :fulfilment to
hand something over, :identify-fn to say who is asking, :catalog to sell
its own things, :rails to register a rail this template has never heard of,
:store to persist somewhere it already runs, :rates-fn to price from a
feed it already has, :analytics to measure with its own sink,
:experiments to run arms declared somewhere other than the token file,
:endpoints to name services this store does not configure but the host
needs reachable, and :probe to reach them some way other than a TCP
connect. Anything else is a config key and overrides the environment.
Boot the store. Returns {:server :deps :stop-reconcile :config}.
`overrides` is how a host application embeds this store: `:fulfilment` to
hand something over, `:identify-fn` to say who is asking, `:catalog` to sell
its own things, `:rails` to register a rail this template has never heard of,
`:store` to persist somewhere it already runs, `:rates-fn` to price from a
feed it already has, `:analytics` to measure with its own sink,
`:experiments` to run arms declared somewhere other than the token file,
`:endpoints` to name services this store does not configure but the host
needs reachable, and `:probe` to reach them some way other than a TCP
connect. Anything else is a config key and overrides the environment.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |