Liking cljdoc? Tell your friends :D

reitit.interceptor


*max-compile-depth*

source

chain

(chain interceptors)
(chain interceptors data)
(chain interceptors
       data
       {:reitit.interceptor/keys [transform],
        :or {transform identity},
        :as opts})

Creates a Interceptor chain out of sequence of IntoInterceptor Optionally takes route data and (Router) opts.

Creates a Interceptor chain out of sequence of IntoInterceptor
Optionally takes route data and (Router) opts.
sourceraw docstring

compile-result

(compile-result route opts)
(compile-result [_ {:keys [interceptors handler], :as data}]
                {:reitit.interceptor/keys [queue], :as opts}
                _)
source

Context

source

context

(context request)
source

Endpoint

source

Executorprotocol

enqueue
(enqueue this context interceptors)

enqueues the interceptors into the queue

enqueues the interceptors into the queue

execute
(execute this interceptors request)
(execute this interceptors request respond raise)

executes the interceptor chain with a request

executes the interceptor chain with a request

queue
(queue this interceptors)

takes a sequence of interceptors and compiles them to queue for the executor

takes a sequence of interceptors and compiles them to queue for the executor

source

Interceptor

source

interceptor-handler

(interceptor-handler router)
source

IntoInterceptorprotocol

into-interceptor
(into-interceptor this data opts)
source

router

(router data)
(router data opts)

Creates a reitit.core/Router from raw route data and optionally an options map with support for Interceptors. See documentation on reitit.core/router for available options. In addition, the following options are available:

Options:

keydescription
:reitit.interceptor/transformFunction or vector of functions of type [Interceptor] => [Interceptor] to transform the expanded Interceptors (default: identity).
:reitit.interceptor/registryMap of keyword => IntoInterceptor to replace keyword references into Interceptor

Example:

(router
  ["/api" {:interceptors [format-body oauth2]}
  ["/users" {:interceptors [delete]
               :handler get-user}]])
Creates a [[reitit.core/Router]] from raw route data and optionally an options map with
support for Interceptors. See documentation on [[reitit.core/router]] for available options.
In addition, the following options are available:

Options:

| key                             | description
| --------------------------------|-------------
| `:reitit.interceptor/transform` | Function or vector of functions of type `[Interceptor] => [Interceptor]` to transform the expanded Interceptors (default: identity).
| `:reitit.interceptor/registry`  | Map of `keyword => IntoInterceptor` to replace keyword references into Interceptor

Example:

    (router
      ["/api" {:interceptors [format-body oauth2]}
      ["/users" {:interceptors [delete]
                   :handler get-user}]])
sourceraw docstring

transform-butlast

(transform-butlast f)

Returns a function to that takes a interceptor transformation function and transforms all but last of the interceptors (e.g. the handler)

Returns a function to that takes a interceptor transformation function and
transforms all but last of the interceptors (e.g. the handler)
sourceraw docstring

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

× close