Liking cljdoc? Tell your friends :D

blueprint.server

An encoding of the most common API building case, allows building servers with a map of API command to handling function, leaving wiring to this

An encoding of the most common API building case, allows
building servers with a map of API command to handling
function, leaving wiring to this
raw docstring

api-handler-fnclj

(api-handler-fn definition dispatch-map)

The default handler function, at the end of a blueprint interceptor chain. When reached, a valid command has been parsed.

A provided dispatch map is looked up for the corresponding handler function and hands off to it.

The default handler function, at the end of a blueprint
interceptor chain. When reached, a valid command has been
parsed.

A provided dispatch map is looked up for the corresponding
handler function and hands off to it.
raw docstring

BlueprintDispatchercljprotocol

command-mapclj

(command-map this)

Yield a partial dispatch map

Yield a partial dispatch map

buildclj

(build)
(build this)

Builds a map describing a stopped API server, ready for use by start and stop.

Acts as a component if wired to a system map.

No required checking of configuration yet, this is deferred to start in case dynamic wiring of dependencies is done.

Builds a map describing a stopped API server,
 ready for use by `start` and `stop`.

Acts as a component if wired to a system map.

No required checking of configuration yet, this is deferred
to `start` in case dynamic wiring of dependencies
is done.
raw docstring

build-dispatch-mapclj

(build-dispatch-map {:blueprint.server/keys [dispatch-map dispatchers]
                     :or {dispatch-map {}}
                     :as this})

Walk the collection of dispatcher paths, representing keys into the input map that should be looked up to find partial dispatch maps.

Elements found may implement BlueprintDispatcher or contain a :blueprint.server/commands key. When neither of these are true, the map is returned as is.

All provided dispatchers are merged together and should be a valid dispatch-map implementation (a map of keyword to values implementing clojure.lang.IFn.

Walk the collection of dispatcher paths, representing keys
into the input map that should be looked up to find partial
dispatch maps.

Elements found may implement BlueprintDispatcher or contain
a `:blueprint.server/commands` key. When neither of these
are true, the map is returned as is.

All provided dispatchers are merged together and should be
a valid dispatch-map implementation (a map of keyword to
values implementing `clojure.lang.IFn`.
raw docstring

build-handlerclj

(build-handler {:blueprint.core/keys [definition] :as this})

Constructs a handler function

Constructs a handler function
raw docstring

find-dispatcherclj

(find-dispatcher this k)

Resolve key to a dispatcher. Prefers protocol implemenations, namespaced keys, or yields the value

Resolve key to a dispatcher. Prefers protocol implemenations,
namespaced keys, or yields the value
raw docstring

ring-handlerclj

(ring-handler this)

Build ring-handler

Build ring-handler
raw docstring

startclj

(start {:aleph.http/keys [port options] :as this})

Start a server, expects the output of build, returns a modified map with an additional :aleph.http/server key which holds the Aleph server.

Start a server, expects the output of `build`,
returns a modified map with an additional `:aleph.http/server`
key which holds the Aleph server.
raw docstring

stopclj

(stop {:aleph.http/keys [server] :as http-server})

Stop a server, expects the output of build. Returns the input map without the ::http/server key.

Stop a server, expects the output of `build`. Returns
the input map without the `::http/server` key.
raw docstring

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

× close