(assoc-uri-match-end-index request end-index)
(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}.
(conj-maps old-map new-map)
Merge two maps efficiently using conj.
Merge two maps efficiently using conj.
(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.
(match-uri uri begin-index pattern-tokens 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 |
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)
(method-dispatch &form &env method-keyword request expr)
(method-dispatch &form &env 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 ':'.
(reduce-mkv f init m)
Same as clojure.core/reduce-kv for java.util.Map instances.
Same as clojure.core/reduce-kv for java.util.Map instances.
(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