Liking cljdoc? Tell your friends :D

xiana.interceptor

Collection of useful interceptors

Collection of useful interceptors
raw docstring

-user-roleclj

(-user-role state role)

Update the user role.

Update the user role.
sourceraw docstring

logclj

Log interceptor. Enter: Print 'Enter:' followed by the complete state map. Leave: Print 'Leave:' followed by the complete state map.

Log interceptor.
Enter: Print 'Enter:' followed by the complete state map.
Leave: Print 'Leave:' followed by the complete state map.
sourceraw docstring

messageclj

(message msg)

This interceptor creates a function that prints predefined message. Enter: Print an arbitrary message. Leave: Print an arbitrary message.

This interceptor creates a function that prints predefined message.
Enter: Print an arbitrary message.
Leave: Print an arbitrary message.
sourceraw docstring

muuntajaclj

(muuntaja)
(muuntaja interceptor)

Muuntaja encoder/decoder interceptor.

Muuntaja encoder/decoder interceptor.
sourceraw docstring

paramsclj

Update the request map with parsed url-encoded parameters. Adds the following keys to the request map:

:query-params - a map of parameters from the query string :form-params - a map of parameters from the body :params - a merged map of all types of parameter

Enter: TODO. Leave: nil.

Update the request map with parsed url-encoded parameters.
Adds the following keys to the request map:

:query-params - a map of parameters from the query string
:form-params  - a map of parameters from the body
:params       - a merged map of all types of parameter

Enter: TODO.
Leave: nil.
sourceraw docstring

session-user-idclj

(session-user-id)

This interceptor handles the session user id management. Enter: Get the session id from the request header, if that operation doesn't succeeds a new session is created an associated to the current state, otherwise the cached session data is used. Leave: Verify if the state has a session id, if so add it to the session instance and remove the new session property of the current state. The final step is the association of the session id to the response header.

This interceptor handles the session user id management.
Enter: Get the session id from the request header, if
that operation doesn't succeeds a new session is created an associated to the
current state, otherwise the cached session data is used.
Leave: Verify if the state has a session id, if so add it to
the session instance and remove the new session property of the current state.
The final step is the association of the session id to the response header.
sourceraw docstring

session-user-roleclj

(session-user-role)
(session-user-role f role)

This interceptor updates session data user role:authorization from the given request header. Enter: Fetch the authorization from its request/state if succeeds update the current state with that information, also update the user role with a custom value or the default :guest. Leave: nil.

This interceptor updates session data user role:authorization
from the given request header.
Enter: Fetch the authorization from its request/state
if succeeds update the current state with that information,
also update the user role with a custom value or the default :guest.
Leave: nil.
sourceraw docstring

side-effectclj

Side-effect interceptor. Enter: nil. Leave: apply :side-effect state key to state if it exists.

Side-effect interceptor.
Enter: nil.
Leave: apply `:side-effect` state key to state if it exists.
sourceraw docstring

viewclj

View interceptor. Enter: nil. Leave: apply :view state key to state if it exists and :response is absent.

View interceptor.
Enter: nil. Leave: apply `:view` state key to state if it exists and
`:response` is absent.
sourceraw docstring

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

× close