Liking cljdoc? Tell your friends :D

ataraxy.core

The core Ataraxy namespace. Includes functions for compiling and matching routes, and for building a Ring handler function.

The core Ataraxy namespace. Includes functions for compiling and matching
routes, and for building a Ring handler function.
raw docstring

compileclj

(compile routes)
(compile routes coercers)

Compile a data structure of routes into an object for performance.

Compile a data structure of routes into an object for performance.
sourceraw docstring

handlerclj

(handler {:keys [routes handlers middleware coercers]})

Create a handler from a data structure of routes and a map of result keys to handler functions. If no handler matches, the :default handler is used. If no default handler is set, the ataraxy.handler/default function is used.

Optionally, maps of middleware and coercer functions can also be supplied. Middleware is applied to any result with metadata matching the key in the middleware map. Coercers are applied to any symbol in the result that are tagged with the corresponding key in the coercers map.

By default coercers for int and uuid are included.

Create a handler from a data structure of routes and a map of result keys to
handler functions. If no handler matches, the :default handler is used. If no
default handler is set, the ataraxy.handler/default function is used.

Optionally, maps of middleware and coercer functions can also be supplied.
Middleware is applied to any result with metadata matching the key in the
middleware map. Coercers are applied to any symbol in the result that are
tagged with the corresponding key in the coercers map.

By default coercers for int and uuid are included.
sourceraw docstring

matchesclj

(matches routes request)

Check if any route matches the supplied request. If a route does match, the associated result vector is returned.

Check if any route matches the supplied request. If a route does match, the
associated result vector is returned.
sourceraw docstring

parseclj

(parse routes)

Parse the routes into an ordered sequence of maps that's more covenient to work with. Each map represents a route. Nested routes are flattened.

Parse the routes into an ordered sequence of maps that's more covenient to
work with. Each map represents a route. Nested routes are flattened.
sourceraw docstring

result-keysclj

(result-keys routes)
source

result-speccljmultimethod

Return the spec for a result vector. Dispatches off the first element of the vector (the 'key'). Used to spec out :ataraxy/result.

Return the spec for a result vector. Dispatches off the first element of the
vector (the 'key'). Used to spec out :ataraxy/result.
sourceraw docstring

valid?clj

(valid? routes)

Return true if the routes data structure is valid.

Return true if the routes data structure is valid.
sourceraw docstring

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

× close