PlugCheckup v0.6.0 PlugCheckup.Check.Formatter View Source

Format the given checks into a list of maps which respects the following JSON schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Health check response",
  "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 in micros",
        "type": ["integer", "null"]
      },
      "error": {
        "description": "The error reason in case the check fails",
        "type": ["string", "null"]
      }
    }
  }
}

Link to this section Summary

Link to this section Functions

Link to this function

format(checks, opts \\ [])

View Source
format([PlugCheckup.Check.t()], keyword()) :: [map()]
format(PlugCheckup.Check.t(), keyword()) :: map()