A Clojure(Script) library for the unified responses.
A Clojure(Script) library for the unified responses.
(add-anomaly! anomaly)
Adds a new anomaly to the anomalies registry.
Adds a new anomaly to the anomalies registry.
(anomaly? x)
Returns true
if x
is an anomaly. Otherwise, false
.
Returns `true` if `x` is an anomaly. Otherwise, `false`.
(as-accepted data)
(as-accepted data meta)
Returns a unified accepted
response.
Returns a unified `accepted` response.
(as-busy data)
(as-busy data meta)
Returns a unified busy
response.
Returns a unified `busy` response.
(as-conflict data)
(as-conflict data meta)
Returns a unified conflict
response.
Returns a unified `conflict` response.
(as-created data)
(as-created data meta)
Returns a unified created
response.
Returns a unified `created` response.
(as-deleted data)
(as-deleted data meta)
Returns a unified deleted
response.
Returns a unified `deleted` response.
(as-error data)
(as-error data meta)
Returns a unified error
response.
Returns a unified `error` response.
(as-exception data)
(as-exception data meta)
Returns a unified exception
response.
Returns a unified `exception` response.
(as-forbidden data)
(as-forbidden data meta)
Returns a unified forbidden
response.
Returns a unified `forbidden` response.
(as-found data)
(as-found data meta)
Returns a unified found
response.
Returns a unified `found` response.
(as-incorrect data)
(as-incorrect data meta)
Returns a unified incorrect
response.
Returns a unified `incorrect` response.
(as-interrupted data)
(as-interrupted data meta)
Returns a unified interrupted
response.
Returns a unified `interrupted` response.
(as-not-found data)
(as-not-found data meta)
Returns a unified not-found
response.
Returns a unified `not-found` response.
(as-response type)
(as-response type data)
(as-response type data meta)
Returns an instance of a unified response.
Returns an instance of a unified response.
(as-success data)
(as-success data meta)
Returns a unified success
response.
Returns a unified `success` response.
(as-unauthorized data)
(as-unauthorized data meta)
Returns a unified unauthorized
response.
Returns a unified `unauthorized` response.
(as-unavailable data)
(as-unavailable data meta)
Returns a unified unavailable
response.
Returns a unified `unavailable` response.
(as-unknown data)
(as-unknown data meta)
Returns a unified unknown
response.
Returns a unified `unknown` response.
(as-unsupported data)
(as-unsupported data meta)
Returns a unified unsupported
response.
Returns a unified `unsupported` response.
(as-updated data)
(as-updated data meta)
Returns a unified updated
response.
Returns a unified `updated` response.
(as-warning data)
(as-warning data meta)
Returns a unified warning
response.
Returns a unified `warning` response.
(cljs? env)
Checks &env in macro and returns true
if that cljs env. Otherwise false
.
Checks &env in macro and returns `true` if that cljs env. Otherwise `false`.
(data x)
Returns data
of a unified response.
Returns `data` of a unified response.
(error? x)
Returns true
if is a unified error response. Otherwise, false
.
Returns `true` if is a unified error response. Otherwise, `false`.
A unified response protocol.
A unified response protocol.
(-data this)
Returns data
of a unified response.
Returns `data` of a unified response.
(-error? this)
Returns true
if type
of a unified response is an anomaly. Otherwise, false
.
Returns `true` if `type` of a unified response is an anomaly. Otherwise, `false`.
(-meta this)
Returns meta
of a unified response.
Returns `meta` of a unified response.
(-type this)
Returns type
of a unified response.
Returns `type` of a unified response.
(meta x)
Returns meta
of a unified response.
Returns `meta` of a unified response.
(remove-anomaly! anomaly)
Removes an anomaly from the anomalies registry.
Removes an anomaly from the anomalies registry.
(safe body)
(safe body with)
Extended version of try-catch. Usage:
Extended version of try-catch. Usage: * (safe (/ 1 0)) ;; => nil * (safe (/ 1 0) #(ex-message %)) ;; => "Divide by zero" * (safe (/ 1 0) #(as-exception (ex-message %))) ;; => #ninja/response{:type :exception, :data "Divide by zero", :meta nil}
(type x)
Returns type
of a unified response.
Returns `type` of a unified response.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close