Liking cljdoc? Tell your friends :D

puppetlabs.comidi


add-regex-symbolsclj

(add-regex-symbols s)

Wrap a regex pattern with forward slashes to make it easier to recognize as a regex

Wrap a regex pattern with forward slashes to make it easier to recognize as a regex
sourceraw docstring

add-route-nameclj

(add-route-name route-info)

Inputs: [route-info :- RouteInfo] Returns: RouteInfoWithId

Given a RouteInfo, compute a route-id and return a RouteInfoWithId.

Inputs: [route-info :- RouteInfo]
Returns: RouteInfoWithId

Given a RouteInfo, compute a route-id and return a RouteInfoWithId.
sourceraw docstring

ANYcljmacro

(ANY pattern bindings & body)
source

breadth-route-metadata*clj

(breadth-route-metadata* route-meta route-info loc)

Inputs: [route-meta :- RouteMetadata route-info :- RouteInfo loc :- Zipper] Returns: RouteMetadata

Helper function used to traverse branches of the Bidi route tree, breadth-first.

Inputs: [route-meta :- RouteMetadata route-info :- RouteInfo loc :- Zipper]
Returns: RouteMetadata

Helper function used to traverse branches of the Bidi route tree, breadth-first.
sourceraw docstring

collapse-consecutive-underscoresclj

(collapse-consecutive-underscores s)
source

contextclj

(context url-prefix & routes)

Inputs: [url-prefix :- bidi-schema/Pattern & routes :- [bidi-schema/RoutePair]] Returns: bidi-schema/RoutePair

Combines multiple bidi routes together into a single data structure, but nests them all under the given url-prefix. This is similar to compojure's context macro, but does not accept a binding form. You can still destructure variables by passing a bidi pattern for url-prefix, and the variables will be available to all nested routes.

Inputs: [url-prefix :- bidi-schema/Pattern & routes :- [bidi-schema/RoutePair]]
Returns: bidi-schema/RoutePair

Combines multiple bidi routes together into a single data structure, but nests
them all under the given url-prefix.  This is similar to compojure's `context`
macro, but does not accept a binding form.  You can still destructure variables
by passing a bidi pattern for `url-prefix`, and the variables will be available
to all nested routes.
sourceraw docstring

DELETEcljmacro

(DELETE pattern bindings & body)
source

depth-route-metadata*clj

(depth-route-metadata* route-meta route-info loc)

Inputs: [route-meta :- RouteMetadata route-info :- RouteInfo loc :- Zipper] Returns: RouteMetadata

Helper function used to traverse branches of the Bidi route tree, depth-first.

Inputs: [route-meta :- RouteMetadata route-info :- RouteInfo loc :- Zipper]
Returns: RouteMetadata

Helper function used to traverse branches of the Bidi route tree, depth-first.
sourceraw docstring

GETcljmacro

(GET pattern bindings & body)
source

Handlerclj

source

handler-fn*cljmacro

(handler-fn* bindings body)

Helper macro, used by the compojure-like macros (GET/POST/etc.) to generate a function that provides compojure's destructuring and rendering support.

Helper macro, used by the compojure-like macros (GET/POST/etc.) to generate
a function that provides compojure's destructuring and rendering support.
sourceraw docstring

(HEAD pattern bindings & body)
source

http-methodsclj

source

make-handlerclj

(make-handler route)

Create a Ring handler from the route definition data structure. Matches a handler from the uri in the request, and invokes it with the request as a parameter. (This code is largely copied from the bidi upstream, but we add support for inserting the match-context via middleware.)

Create a Ring handler from the route definition data
structure. Matches a handler from the uri in the request, and invokes
it with the request as a parameter. (This code is largely copied from the
bidi upstream, but we add support for inserting the match-context via
middleware.)
sourceraw docstring

memoized-route-metadata*clj

source

not-foundclj

(not-found body)
source

PATCHcljmacro

(PATCH pattern bindings & body)
source

path-element->route-id-elementclj

(path-element->route-id-element path-element)

Inputs: [path-element :- schema/Str] Returns: schema/Str

Given a String path element from comidi route metadata, convert it into a string suitable for use in building a route id string.

Inputs: [path-element :- schema/Str]
Returns: schema/Str

Given a String path element from comidi route metadata, convert it into a string
suitable for use in building a route id string.
sourceraw docstring

pattern?clj

(pattern? x)
source

POSTcljmacro

(POST pattern bindings & body)
source

PUTcljmacro

(PUT pattern bindings & body)
source

regex-path-element->route-id-elementclj

(regex-path-element->route-id-element path-element)

Inputs: [path-element :- RegexPatternSegment] Returns: schema/Str

Given a Regex path element from comidi route metadata, convert it into a string suitable for use in building a route id string.

Inputs: [path-element :- RegexPatternSegment]
Returns: schema/Str

Given a Regex path element from comidi route metadata, convert it into a string
suitable for use in building a route id string.
sourceraw docstring

RegexPatternSegmentclj

source

remove-leading-and-trailing-dashesclj

(remove-leading-and-trailing-dashes s)
source

remove-leading-and-trailing-underscoresclj

(remove-leading-and-trailing-underscores s)
source

RequestMethodclj

source

resourcesclj

(resources path & [options])

A route for serving resources on the classpath. Accepts the following keys: :root - the root prefix path of the resources, defaults to 'public' :mime-types - an optional map of file extensions to mime types

A route for serving resources on the classpath. Accepts the following
keys:
  :root       - the root prefix path of the resources, defaults to 'public'
  :mime-types - an optional map of file extensions to mime types
sourceraw docstring

route-metadataclj

(route-metadata routes)

Inputs: [routes :- bidi-schema/RoutePair] Returns: RouteMetadata

Build up a map of metadata describing the routes. This metadata map can be used for introspecting the routes after building the handler, and can also be used with the wrap-with-route-metadata middleware.

Inputs: [routes :- bidi-schema/RoutePair]
Returns: RouteMetadata

Build up a map of metadata describing the routes.  This metadata map can be
used for introspecting the routes after building the handler, and can also
be used with the `wrap-with-route-metadata` middleware.
sourceraw docstring

route-metadata*clj

(route-metadata* routes)

Inputs: [routes :- bidi-schema/RoutePair] Returns: RouteMetadata

Traverses a Bidi route tree and returns route metadata, which includes a list of RouteInfo objects (one per route), plus a mechanism to look up the RouteInfo for a given handler.

Inputs: [routes :- bidi-schema/RoutePair]
Returns: RouteMetadata

Traverses a Bidi route tree and returns route metadata, which includes a list
of RouteInfo objects (one per route), plus a mechanism to look up the
RouteInfo for a given handler.
sourceraw docstring

route-path->route-idclj

(route-path->route-id route-path)

Inputs: [route-path :- [bidi-schema/PatternSegment]] Returns: schema/Str

Given a route path (from comidi route-metadata), build a route-id string for the route. This route-id can be used as a unique identifier for a route.

Inputs: [route-path :- [bidi-schema/PatternSegment]]
Returns: schema/Str

Given a route path (from comidi route-metadata), build a route-id string for
the route.  This route-id can be used as a unique identifier for a route.
sourceraw docstring

route-path-element->route-id-elementclj

(route-path-element->route-id-element path-element)

Inputs: [path-element] Returns: schema/Str

Given a route path element from comidi route metadata, convert it into a string suitable for use in building a route id string. This function is mostly responsible for determining the type of the path element and dispatching to the appropriate function.

Inputs: [path-element]
Returns: schema/Str

Given a route path element from comidi route metadata, convert it into a string
suitable for use in building a route id string.  This function is mostly
responsible for determining the type of the path element and dispatching to
the appropriate function.
sourceraw docstring

route-tree-zipclj

(route-tree-zip root)

Returns a zipper for a bidi route tree i.e. for an arbitrarily nested structure of bidi.schema/RoutePairs

Returns a zipper for a bidi route tree i.e. for an arbitrarily nested structure of
`bidi.schema/RoutePair`s
sourceraw docstring

route-with-method*clj

(route-with-method* method pattern bindings body)

Helper function, used by the compojure-like macros (GET/POST/etc.) to generate a bidi route that includes a wrapped handler function.

Helper function, used by the compojure-like macros (GET/POST/etc.) to generate
a bidi route that includes a wrapped handler function.
sourceraw docstring

RouteInfoclj

source

RouteInfoWithIdclj

source

RouteMetadataclj

source

routesclj

(routes & routes)

Inputs: [& routes :- [bidi-schema/RoutePair]] Returns: bidi-schema/RoutePair

Combines multiple bidi routes into a single data structure; this is largely just a convenience function for grouping several routes together as a single object that can be passed around.

Inputs: [& routes :- [bidi-schema/RoutePair]]
Returns: bidi-schema/RoutePair

Combines multiple bidi routes into a single data structure; this is largely
just a convenience function for grouping several routes together as a single
object that can be passed around.
sourceraw docstring

routes->handlerclj

(routes->handler routes)

Inputs: [routes :- bidi-schema/RoutePair] Returns: (schema/pred fn?)

Given a bidi route tree, converts into a ring request handler function

Inputs: [routes :- bidi-schema/RoutePair]
Returns: (schema/pred fn?)

Given a bidi route tree, converts into a ring request handler function
sourceraw docstring

slashes->dashesclj

(slashes->dashes s)

Convert all forward slashes to hyphens

Convert all forward slashes to hyphens
sourceraw docstring

special-chars->underscoresclj

(special-chars->underscores s)

Convert all non-alpha chars except ! * and - to underscores

Convert all non-alpha chars except ! * and - to underscores
sourceraw docstring

update-route-info*clj

(update-route-info* route-info pattern)

Inputs: [route-info :- RouteInfo pattern :- bidi-schema/Pattern] Returns: RouteInfo

Helper function, used to maintain a RouteInfo data structure that represents the current path elements of a route as we traverse the Bidi route tree via zipper.

Inputs: [route-info :- RouteInfo pattern :- bidi-schema/Pattern]
Returns: RouteInfo

Helper function, used to maintain a RouteInfo data structure that represents
the current path elements of a route as we traverse the Bidi route tree via
zipper.
sourceraw docstring

wrap-routesclj

(wrap-routes routes middleware)

Inputs: [routes :- bidi-schema/RoutePair middleware :- (schema/pred fn?)] Returns: bidi-schema/RoutePair

Wraps middleware around the handlers at every leaf in the route in a manner analagous to compojure's wrap-routes function

Inputs: [routes :- bidi-schema/RoutePair middleware :- (schema/pred fn?)]
Returns: bidi-schema/RoutePair

Wraps middleware around the handlers at every leaf in the route in a manner
analagous to compojure's wrap-routes function
sourceraw docstring

wrap-routes*clj

(wrap-routes* loc middleware)

Help function, used by compojure-like wrap-routes function to wrap leaf handlers in the bidi route with the middleware

Help function, used by compojure-like wrap-routes function to wrap leaf handlers
in the bidi route with the middleware
sourceraw docstring

wrap-with-route-metadataclj

(wrap-with-route-metadata app routes)

Inputs: [app :- (schema/pred fn?) routes :- bidi-schema/RoutePair] Returns: (schema/pred fn?)

Ring middleware; adds the comidi route-metadata to the request map, as well as a :route-info key that can be used to determine which route a given request matches.

Inputs: [app :- (schema/pred fn?) routes :- bidi-schema/RoutePair]
Returns: (schema/pred fn?)

Ring middleware; adds the comidi route-metadata to the request map, as well
as a :route-info key that can be used to determine which route a given request
matches.
sourceraw docstring

Zipperclj

source

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

× close