Liking cljdoc? Tell your friends :D

blueprint.handler

Facilities to build an asynchronous handler, compatible with aleph, out of an interceptor chain.

This builds an opinionated chain with sane defaults, and a way to adapt the chain to the consumer's liking.

Processing of the chain is done by interceptor.

Facilities to build an asynchronous handler, compatible with
aleph, out of an interceptor chain.

This builds an opinionated chain with sane defaults, and a way
to adapt the chain to the consumer's liking.

Processing of the chain is done by
[interceptor](https://github.com/exoscale/interceptor).
raw docstring

add-to-chainclj

(add-to-chain chain {:blueprint.handler/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.handler/target key in the input map.
  • :after: Puts the interceptor after the one whose name is stored at the :blueprint.handler/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.handler/target` key in the input map.
- `:after`: Puts the interceptor after the one whose name is stored at the
  `:blueprint.handler/target` key in the input map.

Incorrect parameters will yield to thrown exceptions.
raw docstring

build-chainclj

(build-chain {:blueprint.handler/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

default-interceptor-chainclj


default-interceptorsclj

The default interceptor chain. doc/interceptor.md should be updated when this changes.

The default interceptor chain. doc/interceptor.md
should be updated when this changes.
raw docstring

generate-ring-handlerclj


interceptor-mapclj


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

ring-handlerclj

(ring-handler config)
(ring-handler definition handler)
(ring-handler definition handler config)

Build a ring handler from a configuration map, optionally takes the two required arguments: the API definition and handler function as arguments.

Yields a function of a single request argument which processes the chain and yields a final deferred ring response

Build a ring handler from a configuration map, optionally
takes the two required arguments: the API definition and
handler function as arguments.

Yields a function of a single request argument which
processes the chain and yields a final deferred ring
response
raw docstring

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

× close