Liking cljdoc? Tell your friends :D

cartridge.core


b64-decodeclj

(b64-decode string)

b64 decodes a utf8 string.

b64 decodes a utf8 string.
sourceraw docstring

b64-encodeclj

(b64-encode bytes)

b64 encodes a collection of bytes as utf8.

b64 encodes a collection of bytes as utf8.
sourceraw docstring

cartridge-playback-fixtureclj

(cartridge-playback-fixture output-path)
(cartridge-playback-fixture output-path key-fn)

Meant to be used as a once fixture, this function wraps our recording middlewares around subsequent clj-http requests, writing the responses to output-path

Meant to be used as a once fixture, this function wraps our recording
middlewares around subsequent clj-http requests, writing the responses to
output-path
sourceraw docstring

deserialize-bodyclj

(deserialize-body resp)

Reads and reconstitutes the body

Reads and reconstitutes the body
sourceraw docstring

read-responses-from-diskclj

(read-responses-from-disk path)

reads responses from a path via edn/read-string

reads responses from a path via edn/read-string
sourceraw docstring

save-responses-to-diskclj

(save-responses-to-disk path responses)

Encodes the body of the responses and saves them at the given path interpreted as a file.

Encodes the body of the responses and saves them at the given
path interpreted as a file.
sourceraw docstring

saved-request-keyclj

(saved-request-key req)

Keys a request for storage. Default key-fn

Keys a request for storage. Default `key-fn`
sourceraw docstring

serialize-bodyclj

(serialize-body {:keys [body] :as resp})

Preps the body for writing to disk. Strings and nil pass through untouched, everything else is base64 encoded.

Preps the body for writing to disk.  Strings and nil pass through
untouched, everything else is base64 encoded.
sourceraw docstring

stash-stream-bodyclj

(stash-stream-body {:keys [body] :as resp})

If the response body is an InputStream, it is fully read into a byte array and stashed at ::body-content in the response map

If the response body is an InputStream, it is fully read into a byte array
and stashed at ::body-content in the response map
sourceraw docstring

transform-responsesclj

(transform-responses responses transform-fn)

Takes a map of responses, applying transform-fn to each response

Takes a map of responses, applying transform-fn to each response
sourceraw docstring

with-cartridgecljmacro

(with-cartridge [saved-responses-atom & [key-fn]] & body)

Accepts an atom, optional key-fn and body. Records clj-http request/response pairs into the atom. If a key-fn is passed, that is used to key the request for storage. Your atom should be a map.

Accepts an atom, optional `key-fn` and body. Records clj-http
request/response pairs into the atom. If a key-fn is passed, that
is used to key the request for storage. Your atom should be a map.
sourceraw docstring

wrap-playback-requestclj

(wrap-playback-request saved-responses-atom key-fn client)

clj-http middleware to record http responses or playback extant recordings

clj-http middleware to record http responses or playback extant recordings
sourceraw docstring

wrap-save-raw-requestclj

(wrap-save-raw-request client)

clj-http middleware that preserves the raw request

clj-http middleware that preserves the raw request
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close