A namespace to mimic Ring functionality, namely:
A namespace to mimic Ring functionality, namely: - turn Lambda HTTP events into Ring maps and back; - provide custom Ring middleware.
(->ring event)Turn Lambda event into a Ring map.
Turn Lambda event into a Ring map.
(gzip-response response)Gzip-encode a Ring response in two steps:
Gzip-encode a Ring response in two steps: - assoc a header; - encode the body payload.
(json-request? request)Check if the Ring request was of a JSON type.
Check if the Ring request was of a JSON type.
(process-headers headers)Turn Lambda headers into a Ring headers map.
Turn Lambda headers into a Ring headers map.
(ring-> response)Turn a Ring response map into a Lambda HTTP response.
Turn a Ring response map into a Lambda HTTP response.
(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.
(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).
(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.
(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.
(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.
(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.
(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.
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 |