LemonGateway.Health (lemon_gateway v0.1.0)

View Source

Health check system for the gateway.

Runs built-in checks (supervisor, scheduler, run_supervisor, engine_lock) and optional custom checks configured via :health_checks application env. Returns a structured health status map consumed by Health.Router.

Summary

Functions

Returns a map with :ok (boolean), :timestamp, and :checks (list of individual check results).

Types

check_fun()

@type check_fun() :: (-> check_response())

check_response()

@type check_response() :: :ok | true | false | {:ok, term()} | {:error, term()}

custom_check()

@type custom_check() ::
  check_fun()
  | {atom() | String.t(), check_fun()}
  | {module(), atom(), [term()]}
  | {atom() | String.t(), {module(), atom(), [term()]}}

Functions

status()

@spec status() :: map()

Returns a map with :ok (boolean), :timestamp, and :checks (list of individual check results).