Provides constructors and predicates for check results.
Provides constructors and predicates for check results.
(healthy)
(healthy extra-data)
Constructs a healthy result.
The optional map of extra data is stored with the result for future use.
Unless overridden in the extra data map, an :salutem/evaluated-at
field is
added to the result, set to the current date time in the system default time
zone.
Constructs a healthy result. The optional map of extra data is stored with the result for future use. Unless overridden in the extra data map, an `:salutem/evaluated-at` field is added to the result, set to the current date time in the system default time zone.
(healthy? result)
Returns true
if the result has a :healthy
status, false
otherwise.
Returns `true` if the result has a `:healthy` status, `false` otherwise.
(outdated? result check)
(outdated? result check relative-to)
Returns true
if the result of the check is outdated, false
otherwise.
For a realtime check, a result is always considered outdated.
For a background check, a result is considered outdated if the time to re-evaluation of the check has passed, i.e., if its evaluation date time is before the current date time minus the check's time to re-evaluation.
If relative-to
is provided, the calculation is performed relative to that
date time rather than to the current date time.
Returns `true` if the result of the check is outdated, `false` otherwise. For a realtime check, a result is always considered outdated. For a background check, a result is considered outdated if the time to re-evaluation of the check has passed, i.e., if its evaluation date time is before the current date time minus the check's time to re-evaluation. If `relative-to` is provided, the calculation is performed relative to that date time rather than to the current date time.
(prepend result extra-data)
Adds each entry from the provided map of extra data to the result if no entry already exists in the result for the key.
Adds each entry from the provided map of extra data to the result if no entry already exists in the result for the key.
(result status)
(result
status
{:keys [salutem/evaluated-at] :or {evaluated-at (t/now)} :as extra-data})
Constructs a result with the provided status
.
The optional map of extra data is stored with the result for future use.
Unless overridden in the extra data map, an :salutem/evaluated-at
field is
added to the result, set to the current date time in the system default time
zone.
Constructs a result with the provided `status`. The optional map of extra data is stored with the result for future use. Unless overridden in the extra data map, an `:salutem/evaluated-at` field is added to the result, set to the current date time in the system default time zone.
(status result)
Returns the status of the provided result.
Returns the status of the provided result.
(unhealthy)
(unhealthy extra-date)
Constructs an unhealthy result.
The optional map of extra data is stored with the result for future use.
Unless overridden in the extra data map, an :salutem/evaluated-at
field is
added to the result, set to the current date time in the system default time
zone.
Constructs an unhealthy result. The optional map of extra data is stored with the result for future use. Unless overridden in the extra data map, an `:salutem/evaluated-at` field is added to the result, set to the current date time in the system default time zone.
(unhealthy? result)
Returns true
if the result has an :unhealthy
status, false
otherwise.
Returns `true` if the result has an `:unhealthy` status, `false` otherwise.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close