PlugCheckup v0.2.1 API Reference
Modules
PlugCheckup provides a Plug for adding simple health checks to your app
Defines the structure of a check. Executes a check updating its result and execution time. Also, it transforms any exception into a tuple {:error, reason}
Format the given checks into a list of maps which respects the following JSON schema
{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Health check list",
"type": "array",
"items": {
"title": "Check",
"type": "object",
"properties": {
"name": {
"description": "The name of this check, for example: 'redis', or 'postgres'",
"type": "string"
},
"healthy": {
"description": "If the check was successful or not",
"type" : "boolean"
},
"time": {
"description": "How long the check took to run",
"type": "integer"
},
"error": {
"description": "The error reason in case the check fails",
"type": "string"
}
}
}
}
Executes the given checks asynchronously respecting the given timeout for each of the checks, and decides whether the execution was successful or not
Defines the options which can be given to initialize PlugCheckup