Liking cljdoc? Tell your friends :D

health-check.core


failureclj

(failure error)
(failure base-response error)

Indicates a service is down. If only an error is given, then you will get just a map that looks like {:up? false :error error}. Otherwise, the given base-response will be merged into the above map

Indicates a service is down. If only an `error` is given, then
you will get just a map that looks like `{:up? false :error error}`.
Otherwise, the given `base-response` will be merged into the above map
raw docstring

health-checkclj

(health-check m)
(health-check af m)

Checks various services and aggregates their statuses up into a single overall status with descriptive data

m -- map of service name and function/value
     which represent the status of those
     services

af -- an aggregation function which takes all the sub-statuses
      of a structure and converts them into a single boolean value
      defaults to `every?`

If it is a function it should return the result of a call to either failure, success or response. Alternatively, the function could return any value which will be passed straight through without contributing to the overall status.

For example:

(health-check
  {:version "1.2.3"
   :up? (fn []
          (try (success (hit-db))
            (catch Exception e
              (failure "db down")))})
Checks various services and aggregates their statuses up
into a single overall status with descriptive data

    m -- map of service name and function/value
         which represent the status of those
         services

    af -- an aggregation function which takes all the sub-statuses
          of a structure and converts them into a single boolean value
          defaults to `every?`

If it is a function it should return the result of a call to either `failure`,
`success` or `response`. Alternatively, the function could return any value
which will be passed straight through without contributing to the overall
status.

For example:

    (health-check
      {:version "1.2.3"
       :up? (fn []
              (try (success (hit-db))
                (catch Exception e
                  (failure "db down")))})
raw docstring

responseclj

(response base-response error & [status])

Indicates a service is either up or down. If an error is not nil, then you will get a map that looks like {:up? false :error error}. Otherwise, the map will look like {:up? true :status status}. It will then be merged into the base-response.

Indicates a service is either up or down. If an `error` is not `nil`, then
you will get a map that looks like `{:up? false :error error}`. Otherwise,
the map will look like `{:up? true :status status}`. It will then
be merged into the `base-response`.
raw docstring

successclj

(success status)
(success base-response status)

Indicates a service is up. If only a status is given, then you will get just a map that looks like {:up? true :status status}. Otherwise, the given base-response will be merged into the above map

Indicates a service is up. If only a `status` is given, then
you will get just a map that looks like `{:up? true :status status}`.
Otherwise, the given `base-response` will be merged into the above map
raw docstring

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

× close