itk_health_checkex v0.0.9 HealthCheckex View Source

Documentation for ITK Healthcheckex.

Link to this section Summary

Functions

Macro that hold the health check logic and assign it a meaningful name for easy referencing.

Link to this section Functions

Link to this macro

healthcheck(name, list)

View Source (macro)

Macro that hold the health check logic and assign it a meaningful name for easy referencing.

You should either return in the check block one of these values: :ok {:ok, result} {:warn, result} {:fail, result}

Returns {:ok, :service} | {:ok, :service, result} | {:fail, :service, result} | {:warn, :service, result} | {:error, :service, "Didn't get the right response from the check."}

Examples

iex> healthcheck(:service, do: :ok)
{:ok, :service}

iex> healthcheck(:service, do: {:ok, "message"})
{:ok, :service, "message"}

iex> healthcheck(:service, do: {:warn, "message"})
{:warn, :service, "message"}

iex> healthcheck(:service, do: {:fail, "message"})
{:fail, :service, "message"}

iex> healthcheck(:service, do: :something_else)
{:error, service, "Didn't get the right response from the check."}