Liking cljdoc? Tell your friends :D

blueprint.interceptor

Facilities to build an interceptor chain. This namespace is to be consumed by other blueprint namespaces.

Facilities to build an interceptor chain. This namespace is to
be consumed by other blueprint namespaces.
raw docstring

add-to-chainclj

(add-to-chain chain
              {:blueprint.interceptor/keys [position target] :as interceptor})

Adds an interceptor to the chain, :blueprint.handler/position determines the position in the chain, and can be:

  • :first: Puts the interceptor at the beginning of the chain.
  • :last: Puts the interceptor at the end of the chain.
  • :before: Puts the interceptor before the one whose name is stored at the :blueprint.interceptor/target key in the input map.
  • :after: Puts the interceptor after the one whose name is stored at the :blueprint.interceptor/target key in the input map.

Incorrect parameters will yield to thrown exceptions.

Adds an interceptor to the chain, `:blueprint.handler/position` determines
the position in the chain, and can be:

- `:first`: Puts the interceptor at the beginning of the chain.
- `:last`: Puts the interceptor at the end of the chain.
- `:before`: Puts the interceptor before the one whose name is stored at the
  `:blueprint.interceptor/target` key in the input map.
- `:after`: Puts the interceptor after the one whose name is stored at the
  `:blueprint.interceptor/target` key in the input map.

Incorrect parameters will yield to thrown exceptions.
raw docstring

BlueprintInterceptorChaincljprotocol

interceptor-chainclj

(interceptor-chain this)

Yield a partial interceptor chain

Yield a partial interceptor chain

build-chainclj

(build-chain default-interceptors
             {:blueprint.interceptor/keys [additional disabled] :as config})

Build an interceptor chain in three phases:

  • Start from the default chain
  • Process additional interceptors provided in ::additional
  • Removes interceptors by name based on those provided in ::disabled
  • Call the interceptor build step if any with the provided config
Build an interceptor chain in three phases:

- Start from the default chain
- Process additional interceptors provided in `::additional`
- Removes interceptors by name based on those provided in `::disabled`
- Call the interceptor build step if any with the provided config
raw docstring

build-withclj

(build-with config {:keys [builder spec] :as interceptor})

Interceptor builder, if a :builder key is found in the interceptor, it will be called on itself, with the configuration as a second argument. Validates with spec at :spec key if provided.

This allows providing configuration to the chain

Interceptor builder, if a `:builder` key is found in the
interceptor, it will be called on itself, with the configuration
as a second argument. Validates with spec at `:spec` key if provided.

This allows providing configuration to the chain
raw docstring

expand-chainclj

(expand-chain ixdef)

Resolve element to an interceptor chain. Works against all implementations of BlueprintInterceptorChain, maps containing ::interceptor-chain, vectors are rendered as is, and single interceptors are rendered as a vector of themselves.

Resolve element to an interceptor chain. Works against all
implementations of BlueprintInterceptorChain, maps containing
`::interceptor-chain`, vectors are rendered as is, and single
interceptors are rendered as a vector of themselves.
raw docstring

placeclj

(place interceptor position)
(place interceptor position target)

Helper function to populate an interceptor with position info

Helper function to populate an interceptor with position info
raw docstring

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

× close