(build-fx-context req opts)Constructs the execution context map for an effect run. Merges resolved provider/services from request and opts with {request-key req}.
Constructs the execution context map for an effect run.
Merges resolved provider/services from request and opts with {request-key req}.(resolve-failure-to-response failure req)(resolve-failure-to-response failure req {:keys [failure-map default-handler]})Converts an IFailure into an HTTP Ring response map using a hybrid resolution strategy:
Converts an IFailure into an HTTP Ring response map using a hybrid resolution strategy: 1. Check :failure-map for explicit tag match. 2. Check if error-data contains :status key. 3. Fallback to :default-handler (or default 500 response).
(wrap-fx handler)(wrap-fx handler opts)Converts an effect handler function (fn [req] -> effect) into a standard Ring HTTP handler with automatic failure-to-response translation. Supports 1-arity synchronous (fn [req]) and 3-arity asynchronous (fn [req respond raise]). If the handler returns a non-effect value (e.g. standard Ring response map), it passes through unchanged.
Options: :provider - Map or (fn [req]) providing external dependencies / services :context - Alias for :provider :services - Alias for :provider :failure-map - Map of failure tags to handler functions (fn [error-data req]) :default-handler - Fallback failure handler function (fn [failure req])
Converts an effect handler function (fn [req] -> effect) into a standard Ring HTTP handler with automatic failure-to-response translation. Supports 1-arity synchronous (fn [req]) and 3-arity asynchronous (fn [req respond raise]). If the handler returns a non-effect value (e.g. standard Ring response map), it passes through unchanged. Options: :provider - Map or (fn [req]) providing external dependencies / services :context - Alias for :provider :services - Alias for :provider :failure-map - Map of failure tags to handler functions (fn [error-data req]) :default-handler - Fallback failure handler function (fn [failure req])
(wrap-fx-all handler)(wrap-fx-all handler opts)(wrap-fx-all handler context opts)Composite Ring middleware combining wrap-fx-context, wrap-fx-failures, and wrap-fx-runner.
Options: :context - Base context map or (fn [req]) provider :provider - Alias for :context :services - Alias for :context :failure-map - Map of failure tags to handler functions :default-handler - Fallback failure handler function
Composite Ring middleware combining `wrap-fx-context`, `wrap-fx-failures`, and `wrap-fx-runner`. Options: :context - Base context map or (fn [req]) provider :provider - Alias for :context :services - Alias for :context :failure-map - Map of failure tags to handler functions :default-handler - Fallback failure handler function
(wrap-fx-context handler context-or-provider)Ring middleware that injects an fx context map or provider function into the request map under :fx/context.
Can be used at the root or route level of a Ring application to provide ambient services (e.g. database,
configuration) to all downstream wrap-fx endpoints.
Ring middleware that injects an fx context map or provider function into the request map under `:fx/context`. Can be used at the root or route level of a Ring application to provide ambient services (e.g. database, configuration) to all downstream `wrap-fx` endpoints.
(wrap-fx-failures handler)(wrap-fx-failures handler opts)Converts IFailure instances returned by a Ring handler to Ring HTTP responses. Options: :failure-map - Map of tag -> (fn [error-data req]) or (fn [error-data]) or response-map :default-handler - Fallback (fn [failure req]) returning a response map
Converts IFailure instances returned by a Ring handler to Ring HTTP responses. Options: :failure-map - Map of tag -> (fn [error-data req]) or (fn [error-data]) or response-map :default-handler - Fallback (fn [failure req]) returning a response map
(wrap-fx-runner handler)(wrap-fx-runner handler opts)Evaluates effect handler functions (fn [req] -> effect) into Ring values (maps or IFailure). Supports 1-arity synchronous (fn [req]) and 3-arity asynchronous (fn [req respond raise]). If the handler returns a non-effect value (e.g. standard Ring response map), it passes through unchanged.
Evaluates effect handler functions (fn [req] -> effect) into Ring values (maps or IFailure). Supports 1-arity synchronous (fn [req]) and 3-arity asynchronous (fn [req respond raise]). If the handler returns a non-effect value (e.g. standard Ring response map), it passes through unchanged.
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 |