Liking cljdoc? Tell your friends :D

bff.http-client


->resultclj

(->result {:keys [status body]} step-id)

Map a raw HTTP response ({:status int :body string}) to a tagged result. Public so implementations of BffHttp can reuse the same status-code error mapping.

Map a raw HTTP response ({:status int :body string}) to a tagged result.
Public so implementations of `BffHttp` can reuse the same status-code
error mapping.
sourceraw docstring

BffHttpcljprotocol

A single-request HTTP transport. Extended below to plain fns (the natural Clojure implementation), the Java BffHttpClient interface, and BFF's own hato-backed default. Implementations return either a raw {:status int :body str} that BFF maps through ->result, or a fully tagged {:status :ok/:error ...} map that is passed through untouched.

A single-request HTTP transport. Extended below to plain fns (the natural
Clojure implementation), the Java BffHttpClient interface, and BFF's own
hato-backed default. Implementations return either a raw
{:status int :body str} that BFF maps through `->result`, or a fully tagged
{:status :ok/:error ...} map that is passed through untouched.

do-callclj

(do-call this req)
sourceraw docstring

callclj

(call client {:keys [url step-id] :as req})

Route an HTTP step through client (any BffHttp — hato default, plain fn, or Java BffHttpClient). Errors are captured as tagged results — this never throws.

Route an HTTP step through `client` (any BffHttp — hato default, plain fn,
or Java BffHttpClient). Errors are captured as tagged results — this never
throws.
sourceraw docstring

default-clientclj

(default-client)
(default-client hato-opts)

The built-in hato-backed BffHttp implementation. hato-opts is merged into hato's build-http-client options; pass nil for the shared defaults.

The built-in hato-backed BffHttp implementation. `hato-opts` is merged into
hato's `build-http-client` options; pass nil for the shared defaults.
sourceraw docstring

errclj

(err code msg)
(err code msg detail)
(err code msg detail http-status)

Build a tagged error result. Optional detail (map) attaches free-form context; optional http-status (int) records the upstream HTTP status code when the failure originated from an HTTP response, so a step's spec-level errors: mapping can remap by status.

Build a tagged error result. Optional `detail` (map) attaches free-form
context; optional `http-status` (int) records the upstream HTTP status
code when the failure originated from an HTTP response, so a step's
spec-level `errors:` mapping can remap by status.
sourceraw docstring

error?clj

(error? result)
source

okclj

(ok data)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close