Liking cljdoc? Tell your friends :D

com.moclojer.specs.moclojer


->reititclj

(->reitit spec)

Adapts given moclojer endpoints to reitit's data based routes, while parsing request data types throughout the way. Supports both HTTP endpoints and WebSocket endpoints.

Adapts given moclojer endpoints to reitit's data based routes, while
parsing request data types throughout the way. Supports both HTTP endpoints
and WebSocket endpoints.
sourceraw docstring

assoc-ifclj

(assoc-if m k v)
source

build-bodyclj

(build-body response request)

Builds the body from the response.

Builds the body from the response.
sourceraw docstring

build-parametersclj

(build-parameters request-values)
source

create-swagger-parametersclj

(create-swagger-parameters path query body)
source

create-swagger-routeclj

(create-swagger-route)

Create Swagger documentation endpoint

Create Swagger documentation endpoint
sourceraw docstring

create-urlclj

(create-url pattern)
source

create-ws-handlerclj

(create-ws-handler path on-connect on-message)

Create WebSocket handler function with connection and message handling

Create WebSocket handler function with connection and message handling
sourceraw docstring

enrich-external-bodyclj

(enrich-external-body external-body request)

Enriches the external body with a resolved path.

Enriches the external body with a resolved path.
sourceraw docstring

generate-methodclj

(generate-method method)

Adapts given method to a normalized string version of itself.

Adapts given `method` to a normalized string version of itself.
sourceraw docstring

generate-route-nameclj

(generate-route-name host path method)
source

generic-reitit-handlerclj

(generic-reitit-handler response webhook-config)

Builds a reitit handler that responds with pre-defined response. Since we also support webhooks, given webhook-config is used when necessary in together with the response.

Builds a reitit handler that responds with pre-defined `response`.
Since we also support `webhooks`, given `webhook-config` is used
when necessary in together with the `response`.
sourceraw docstring

get-response-bodyclj

(get-response-body response request)

Gets the correct response body (processing external-body if necessary)

Gets the correct response body (processing external-body if necessary)
sourceraw docstring

handle-ws-connectclj

(handle-ws-connect channel connect-config request-params)

Handle WebSocket connection

Handle WebSocket connection
sourceraw docstring

make-bodyclj

(make-body ?body type)
source

make-path-parametersclj

(make-path-parameters path & [gen?])

Based on path's declared type, provides a placeholder that can be used later on by reitit to understand the param's data type.

Based on `path`'s declared type, provides a placeholder that can be
used later on by reitit to understand the param's data type.
sourceraw docstring

make-query-parametersclj

(make-query-parameters query & [gen?])
source

merge-routesclj

(merge-routes routes [route-name route-definition])

Merge route definitions with the same path

Merge route definitions with the same path
sourceraw docstring

mock-response-body-requestclj

(mock-response-body-request ?body parameters)

Given a body, generates a request based on the used variables.

Given a `body`, generates a request based on the used variables.
sourceraw docstring

parse-json-safelyclj

(parse-json-safely content)

Tries to parse a JSON, returning the original content in case of error

Tries to parse a JSON, returning the original content in case of error
sourceraw docstring

process-http-routesclj

(process-http-routes spec)

Process HTTP endpoints and return route configurations

Process HTTP endpoints and return route configurations
sourceraw docstring

process-ws-messageclj

(process-ws-message channel message pattern-configs request-params)

Process WebSocket message based on pattern matching

Process WebSocket message based on pattern matching
sourceraw docstring

process-ws-routesclj

(process-ws-routes spec)

Process WebSocket endpoints and return route configurations

Process WebSocket endpoints and return route configurations
sourceraw docstring

provideclj

(provide val & [cond forced-type])
source

render-templateclj

(render-template template request)

Renders given template, using request's data.

Renders given `template`, using `request`'s data.
sourceraw docstring

webhook-conditionclj

(webhook-condition condition request)

Checks if condition and return boolean value, default is true when condition is empty

Checks `if` condition and return boolean value, default is true when condition is empty
sourceraw docstring

ws-send!clj

(ws-send! channel message)

Sends a message to a WebSocket connection

Sends a message to a WebSocket connection
sourceraw docstring

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

× close