Liking cljdoc? Tell your friends :D

com.cognitect.vase.actions

Functions to construct interceptors dynamically.

The functions with names that end in '-action' compile Pedestal interceptors. These are the main public entry points, and are used by the literals namespace when loading Vase descriptors.

Take care to avoid code generation during request processing. It is time-consuming, so it should be done at application startup time instead.

Actions are created by emitting code (in the functions named -exprs) which gets evaluated to build an interceptor. Arguments to the -exprs functions are interpolated into the emitted code. These arguments can contain literals or one s-expression each.

For example, respond-action-exprs has an argument body that will be used as the HTTP response body. It may be a string or an s-expression.

When s-expression arguments are evaluated, they have some bindings available in scope:

  • request - contains the Pedestal request map
  • context - contains the Pedestal context map
  • request parameters captured from path-params or parsed body parameters and named in the params seq

E.g., if params holds ['userid] and the request matched a route with "/users/:userid", then the s-expression will have the symbol 'userid bound to the value of that request parameter.

Functions to construct interceptors dynamically.

The functions with names that end in '-action' compile Pedestal
interceptors. These are the main public entry points, and are used
by the `literals` namespace when loading Vase descriptors.

Take care to avoid code generation during request processing. It is
time-consuming, so it should be done at application startup time
instead.

Actions are created by emitting code (in the functions named
`-exprs`) which gets evaluated to build an interceptor. Arguments to
the `-exprs` functions are interpolated into the emitted code. These
arguments can contain literals or one s-expression each.

For example, `respond-action-exprs` has an argument `body` that will
be used as the HTTP response body. It may be a string or an
s-expression.

When s-expression arguments are evaluated, they have some bindings
available in scope:

- `request` - contains the Pedestal request map
- `context` - contains the Pedestal context map
- request parameters captured from path-params or parsed body
  parameters _and_ named in the `params` seq

E.g., if `params` holds `['userid]` and the request matched a route
with "/users/:userid", then the s-expression will have the symbol
`'userid` bound to the value of that request parameter.
raw docstring

com.cognitect.vase.spec

Contains the clojure.spec definitions for the Vase application specification.

Contains the clojure.spec definitions for the Vase
application specification.
raw docstring

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

× close