Liking cljdoc? Tell your friends :D

lambda.ring

A namespace to mimic Ring functionality, namely:

  • turn Lambda HTTP events into Ring maps and back;
  • provide custom Ring middleware.
A namespace to mimic Ring functionality, namely:
- turn Lambda HTTP events into Ring maps and back;
- provide custom Ring middleware.
raw docstring

->ringclj

(->ring event)

Turn Lambda event into a Ring map.

Turn Lambda event into a Ring map.
sourceraw docstring

accept-gzip?clj

(accept-gzip? request)
source

assoc-json-paramsclj

(assoc-json-params request json)
source

CONTENT-TYPE-JSONclj

source

encoded-gzip?clj

(encoded-gzip? request)
source

gzip-responseclj

(gzip-response response)

Gzip-encode a Ring response in two steps:

  • assoc a header;
  • encode the body payload.
Gzip-encode a Ring response in two steps:
- assoc a header;
- encode the body payload.
sourceraw docstring

IBodycljprotocol

->bodyclj

(->body this)
source

IGzipcljprotocol

-gzip-encodeclj

(-gzip-encode this)
source

json-request?clj

(json-request? request)

Check if the Ring request was of a JSON type.

Check if the Ring request was of a JSON type.
sourceraw docstring

process-headersclj

(process-headers headers)

Turn Lambda headers into a Ring headers map.

Turn Lambda headers into a Ring headers map.
sourceraw docstring

response-internal-errorclj

source

response-json-malformedclj

source

ring->clj

(ring-> response)

Turn a Ring response map into a Lambda HTTP response.

Turn a Ring response map into a Lambda HTTP response.
sourceraw docstring

TYPE_ARR_BYTEclj

source

ungzip-requestclj

(ungzip-request request)

Wrap the request's :body field with a class that decodes gzip payload on the fly.

Wrap the request's :body field with a class
that decodes gzip payload on the fly.
sourceraw docstring

wrap-gzipclj

(wrap-gzip handler)

Wrap a given handler with in/out gzip logic.

If a client sends a header Content-Encoding: gzip, then the :body of the request is wrapped into an instance of GzipInputStream.

If a client sends a header Accept-Encoding: gzip, then the :body of the response is encoded into a Gzipped byte array. In addition, the response gets a header Content-Encoding: gzip. Supported body types are: nil, String, native byte-array, ISeq(of String), and InputStream.

Gzip output encoding might be forced with a global configuration (see the lambda.config namespace).

Wrap a given handler with in/out gzip logic.

If a client sends a header Content-Encoding: gzip,
then the :body of the request is wrapped into an
instance of GzipInputStream.

If a client sends a header Accept-Encoding: gzip,
then the :body of the response is encoded into
a Gzipped byte array. In addition, the response
gets a header Content-Encoding: gzip. Supported
body types are: nil, String, native byte-array,
ISeq(of String), and InputStream.

Gzip output encoding might be forced with a global
configuration (see the lambda.config namespace).
sourceraw docstring

wrap-json-bodyclj

(wrap-json-body handler)
(wrap-json-body handler opt)

A middleware that, if the request was JSON, replaces the :body field with the parsed JSON data. Takes an optional map of Jsam settings.

A middleware that, if the request was JSON,
replaces the :body field with the parsed JSON
data. Takes an optional map of Jsam settings.
sourceraw docstring

wrap-json-paramsclj

(wrap-json-params handler)
(wrap-json-params handler opt)

A middleware that, if the request was JSON, adds the :json-params field to the request, and also merged then with :params, if the data was a map. Takes an optional map of Jsam settings.

A middleware that, if the request was JSON,
adds the :json-params field to the request,
and also merged then with :params, if the
data was a map. Takes an optional map of
Jsam settings.
sourceraw docstring

wrap-json-responseclj

(wrap-json-response handler)
(wrap-json-response handler opt)

A middleware that, if the body of the response was a collection, transforms the body into a JSON string and adds a Content-Type header with JSON mime-type. Takes an optional map of Jsam settings.

A middleware that, if the body of the response
was a collection, transforms the body into
a JSON string and adds a Content-Type header
with JSON mime-type. Takes an optional map of
Jsam settings.
sourceraw docstring

wrap-ring-eventclj

(wrap-ring-event handler)

A ring middleware that transforms an HTTP Lambda event into a Ring request, processes it with a Ring handler, and turns the result into a Lambda HTTP response.

A ring middleware that transforms an HTTP Lambda
event into a Ring request, processes it with a
Ring handler, and turns the result into a Lambda
HTTP response.
sourceraw docstring

wrap-ring-exceptionclj

(wrap-ring-exception handler)

A middleware what captures any Ring exceptions, logs them and returns a negative HTTP response.

A middleware what captures any Ring exceptions,
logs them and returns a negative HTTP response.
sourceraw docstring

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

× close