Liking cljdoc? Tell your friends :D

reitit.core


conflicting-paths

(conflicting-paths conflicts)
source

Expandprotocol

expand
(expand this opts)
source

linear-router

(linear-router compiled-routes)
(linear-router compiled-routes opts)

Creates a linear-router from resolved routes and optional expanded options. See router for available options.

Creates a linear-router from resolved routes and optional
expanded options. See [[router]] for available options.
sourceraw docstring

lookup-router

(lookup-router compiled-routes)
(lookup-router compiled-routes opts)

Creates a lookup-router from resolved routes and optional expanded options. See router for available options.

Creates a lookup-router from resolved routes and optional
expanded options. See [[router]] for available options.
sourceraw docstring

map-data

(map-data f routes)
source

Match

source

match->path

(match->path match)
(match->path match query-params)
source

match-by-name!

(match-by-name! this name)
(match-by-name! this name path-params)
source

merge-data

(merge-data x)
source

mixed-router

(mixed-router compiled-routes)
(mixed-router compiled-routes opts)

Creates two routers: lookup-router or single-static-path-router for static routes and segment-router for wildcard routes. All routes should be non-conflicting. Takes resolved routes and optional expanded options. See router for options.

Creates two routers: [[lookup-router]] or [[single-static-path-router]] for
static routes and [[segment-router]] for wildcard routes. All
routes should be non-conflicting. Takes resolved routes and optional
expanded options. See [[router]] for options.
sourceraw docstring

name-conflicting-routes

(name-conflicting-routes routes)
source

name-conflicts-str

(name-conflicts-str conflicts)
source

partial-match?

(partial-match? x)
source

PartialMatch

source

path-conflicting-routes

(path-conflicting-routes routes)
source

path-conflicts-str

(path-conflicts-str conflicts)
source

quarantine-router

(quarantine-router compiled-routes)
(quarantine-router compiled-routes opts)

Creates two routers: mixed-router for non-conflicting routes and linear-router for conflicting routes. Takes resolved routes and optional expanded options. See router for options.

Creates two routers: [[mixed-router]] for non-conflicting routes
and [[linear-router]] for conflicting routes. Takes resolved routes
and optional expanded options. See [[router]] for options.
sourceraw docstring

resolve-routes

(resolve-routes raw-routes {:keys [coerce], :as opts})
source

route-info

(route-info route)
source

Routerprotocol

compiled-routes
(compiled-routes this)
match-by-name
(match-by-name this name)
(match-by-name this name path-params)
match-by-path
(match-by-path this path)
options
(options this)
route-names
(route-names this)
router-name
(router-name this)
routes
(routes this)
source

router

(router raw-routes)
(router raw-routes opts)

Create a Router from raw route data and optionally an options map. Selects implementation based on route details. The following options are available:

keydescription
:pathBase-path for routes
:routesInitial resolved routes (default [])
:dataInitial route data (default {})
:specclojure.spec definition for a route data, see reitit.spec on how to use this
:expandFunction of arg opts => data to expand route arg to route data (default reitit.core/expand)
:coerceFunction of route opts => route to coerce resolved route, can throw or return nil
:compileFunction of route opts => result to compile a route handler
:validateFunction of routes opts => () to validate route (data) via side-effects
:conflictsFunction of {route #{route}} => () to handle conflicting routes (default reitit.core/throw-on-conflicts!)
:routerFunction of routes opts => router to override the actual router implementation
Create a [[Router]] from raw route data and optionally an options map.
Selects implementation based on route details. The following options
are available:

| key          | description |
| -------------|-------------|
| `:path`      | Base-path for routes
| `:routes`    | Initial resolved routes (default `[]`)
| `:data`      | Initial route data (default `{}`)
| `:spec`      | clojure.spec definition for a route data, see `reitit.spec` on how to use this
| `:expand`    | Function of `arg opts => data` to expand route arg to route data (default `reitit.core/expand`)
| `:coerce`    | Function of `route opts => route` to coerce resolved route, can throw or return `nil`
| `:compile`   | Function of `route opts => result` to compile a route handler
| `:validate`  | Function of `routes opts => ()` to validate route (data) via side-effects
| `:conflicts` | Function of `{route #{route}} => ()` to handle conflicting routes (default `reitit.core/throw-on-conflicts!`)
| `:router`    | Function of `routes opts => router` to override the actual router implementation
sourceraw docstring

router?

(router? x)
source

segment-router

(segment-router compiled-routes)
(segment-router compiled-routes opts)

Creates a special prefix-tree style segment router from resolved routes and optional expanded options. See router for available options.

Creates a special prefix-tree style segment router from resolved routes and optional
expanded options. See [[router]] for available options.
sourceraw docstring

single-static-path-router

(single-static-path-router compiled-routes)
(single-static-path-router compiled-routes opts)

Creates a fast router of 1 static route(s) and optional expanded options. See router for available options.

Creates a fast router of 1 static route(s) and optional
expanded options. See [[router]] for available options.
sourceraw docstring

throw-on-conflicts!

(throw-on-conflicts! f conflicts)
source

walk

(walk raw-routes
      {:keys [path data routes expand],
       :or {data [], routes [], expand expand},
       :as opts})
source

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

× close