Utils for Pedestal
Utils for Pedestal
Plumatic Schema definition of a Pedestal Context
Plumatic Schema definition of a Pedestal Context
(context? map-in)
Inputs: [map-in :- tsk/KeyMap] Returns: s/Bool
Returns true if the map arg is a Pedestal context map
Inputs: [map-in :- tsk/KeyMap] Returns: s/Bool Returns true if the map arg is a Pedestal context map
(ctx-trim ctx)
Inputs: [ctx :- tsk/KeyMap] Returns: tsk/KeyMap
Removes seldom-used keys from interceptor-chain context map to declutter debug printouts (:queue, :stack, :terminators).
Inputs: [ctx :- tsk/KeyMap] Returns: tsk/KeyMap Removes seldom-used keys from interceptor-chain context map to declutter debug printouts (:queue, :stack, :terminators).
Flag to control automatic trimming of interceptor-chain control information.
Flag to control automatic trimming of interceptor-chain control information.
Default options for configuring a Pedestal service
Default options for configuring a Pedestal service
(definterceptor name ctx)
Creates a Pedestal interceptor given a name and a map like (definterceptor my-intc { :enter <enter-fn> :leave <leave-fn> :error <error-fn> } )
Creates a Pedestal interceptor given a name and a map like (definterceptor my-intc { :enter <enter-fn> :leave <leave-fn> :error <error-fn> } )
(interceptor? map-in)
Inputs: [map-in :- tsk/KeyMap] Returns: s/Bool
Returns true if the map arg is a Pedestal interceptor map
Inputs: [map-in :- tsk/KeyMap] Returns: s/Bool Returns true if the map arg is a Pedestal interceptor map
(invoke-interceptors ctx interceptors)
Inputs: [ctx :- tsk/KeyMap interceptors :- [tsk/KeyMap]]
Given a context and a vector of interceptor-maps, invokes the interceptor chain and returns the resulting output context.
Inputs: [ctx :- tsk/KeyMap interceptors :- [tsk/KeyMap]] Given a context and a vector of interceptor-maps, invokes the interceptor chain and returns the resulting output context.
(not-found)
Returns response for status=Not Found: {:status 404 :body 'Not found '}
Returns response for status=Not Found: {:status 404 :body 'Not found '}
(ok body)
Wraps response for status=OK as: {:status 200 :body body}
Wraps response for status=OK as: {:status 200 :body body}
Plumatic Schema definition of a Pedestal Request
Plumatic Schema definition of a Pedestal Request
(request? map-in)
Inputs: [map-in :- tsk/KeyMap] Returns: s/Bool
Returns true if the map arg is a Pedestal request map
Inputs: [map-in :- tsk/KeyMap] Returns: s/Bool Returns true if the map arg is a Pedestal request map
(server-config!)
(server-config! server-opts)
Inputs: ([] [server-opts :- tsk/KeyMap])
Inputs: ([] [server-opts :- tsk/KeyMap])
(server-restart!)
Stops and restarts the Jetty HTTP server for a Pedestal service
Stops and restarts the Jetty HTTP server for a Pedestal service
(server-start!)
Starts the Jetty HTTP server for a Pedestal service as configured via define-service
Starts the Jetty HTTP server for a Pedestal service as configured via `define-service`
(server-stop!)
Stops the Jetty HTTP server.
Stops the Jetty HTTP server.
(service-delete & args)
Given that a Pedestal service has been defined, return the response for an HTTP DELETE request. Does not require a running Jetty server.
Given that a Pedestal service has been defined, return the response for an HTTP DELETE request. Does not require a running Jetty server.
(service-fn)
Returns the service-function
(which can be used for testing via pedestal.test/response-for)
Returns the `service-function` (which can be used for testing via pedestal.test/response-for)
(service-get & args)
Given that a Pedestal service has been defined, return the response for an HTTP GET request. Does not require a running Jetty server.
Given that a Pedestal service has been defined, return the response for an HTTP GET request. Does not require a running Jetty server.
(service-post & args)
Given that a Pedestal service has been defined, return the response for an HTTP POST request. Does not require a running Jetty server.
Given that a Pedestal service has been defined, return the response for an HTTP POST request. Does not require a running Jetty server.
(table-route route-map)
Inputs: [route-map :- TableRouteInfo] Returns: tsk/Tuple
Creates a Pedestal table-route entry from a context map.
Inputs: [route-map :- TableRouteInfo] Returns: tsk/Tuple Creates a Pedestal table-route entry from a context map.
Plumatic Schema definition of a Pedestal TableRouteInfo
Plumatic Schema definition of a Pedestal TableRouteInfo
(with-server service-map & forms)
Start & stop the server, even if exception occurs.
Start & stop the server, even if exception occurs.
(with-service service-map & forms)
Run the forms in the context of a Pedestal service definition
Run the forms in the context of a Pedestal service definition
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close