(build-routes-index context
routes
{:keys [index-key uri-key method-key]
:or {index-key :id uri-key :uri method-key :method}
:as options})
Given a collection of routes, index them returning a map {:id the-route}.
Given a collection of routes, index them returning a map {:id the-route}.
(dispatch-expr-generic routes matcher-syms handler-syms request-sym invoke-sym)
Generic (fallback) match
Generic (fallback) match
(dispatch-expr-methods routes
matcher-syms
handler-syms
request-sym
invoke-sym
{:keys [method-key] :as options})
Bulk methods match
Bulk methods match
(find-prefix-tokens routes-uri-tokens)
Given routes with URI-patterns, find the common (non empty) prefix URI pattern tokens.
Given routes with URI-patterns, find the common (non empty) prefix URI pattern tokens.
(find-prefix-tokens-pair routes-uri-tokens)
Given routes with URI-patterns, find the common (non empty) prefix URI pattern tokens and balance tokens.
Given routes with URI-patterns, find the common (non empty) prefix URI pattern tokens and balance tokens.
(invoke f)
(invoke f x)
(invoke f x y)
(invoke f x y & args)
Invoke first arg as a function on remaing args.
Invoke first arg as a function on remaing args.
(make-dispatcher-expr routes
matcher-syms
handler-syms
request-sym
invoke-sym
options)
Emit code that matches route and invokes handler
Emit code that matches route and invokes handler
(match-uri uri begin-index pattern-tokens attempt-partial-match?)
(match-uri uri begin-index pattern-tokens attempt-partial-match? params-map)
Match given URI string against URI pattern, returning a vector [params-map ^int end-index]
on success,
and nil
on no match.
Argument | Description |
---|---|
uri | the URI string to match |
begin-index | index in the URI string to start matching at |
pattern-tokens | URI pattern tokens to match against |
attempt-partial-match? | flag to indicate whether to attempt partial-match |
Match given URI string against URI pattern, returning a vector `[params-map ^int end-index]` on success, and `nil` on no match. | Argument | Description | |------------------------|---------------------------------------------------| | uri | the URI string to match | | begin-index | index in the URI string to start matching at | | pattern-tokens | URI pattern tokens to match against | | attempt-partial-match? | flag to indicate whether to attempt partial-match |
(method-dispatch method-keyword request expr)
(method-dispatch method-keyword request expr default-expr)
(parse-uri-template marker-char pattern)
Given a URI pattern string, e.g. '/user/:id/profile/:descriptor/' parse it and return a vector of alternating string and keyword tokens, e.g. ['/user/' :id '/profile/' :descriptor '/']. The marker char is typically ':'.
Given a URI pattern string, e.g. '/user/:id/profile/:descriptor/' parse it and return a vector of alternating string and keyword tokens, e.g. ['/user/' :id '/profile/' :descriptor '/']. The marker char is typically ':'.
(split-routes-having-uri routes uri-key)
Given mixed routes (vector), split into those having distinct routes and those that don't.
Given mixed routes (vector), split into those having distinct routes and those that don't.
(tokenize-routes-uris routes-with-uri uri-key)
Given routes with URI patterns, tokenize them as vectors.
Given routes with URI patterns, tokenize them as vectors.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close