BtrzHealthchecker v0.2.3 BtrzHealthchecker View Source

BtrzHealthchecker main module.

Used to get the information about the desired services passed as Checkers.

Link to this section Summary

Types

A checker that implements the Checker behaviour

Functions

Returns the Info struct with the status of the desired services

Link to this section Types

Link to this type checker() View Source
checker() :: BtrzHealthchecker.Checker

A checker that implements the Checker behaviour

Link to this section Functions

Link to this function info() View Source
info() :: %BtrzHealthchecker.Info{
  build: term(),
  commit: term(),
  instanceId: term(),
  services: term(),
  status: term()
}

Returns the Info struct with the status of the desired services.

Examples

iex> my_connection_opts = %{hostname: "localhost", username: "postgres", password: "mypass", database: "mydb"}
iex> BtrzHealthchecker.info([%{checker_module: BtrzHealthchecker.Checkers.Postgres, opts: my_connection_opts}])
%BtrzHealthchecker.Info{build: "d3b3f9133f68b8877347e06b3d7285dd1d5d3921", commit: "3d7285dd1d5d3921d3b3f9133f68b8877347e06b",
      instanceId: "i-b3f9133f68b88", services: [%{name: "postgres", status: 200}], status: 200}

Or without any service
iex> BtrzHealthchecker.info()
%BtrzHealthchecker.Info{build: "d3b3f9133f68b8877347e06b3d7285dd1d5d3921", commit: "3d7285dd1d5d3921d3b3f9133f68b8877347e06b",
      instanceId: "i-b3f9133f68b88", services: [], status: 200}
Link to this function info(checkers) View Source
info([checker()]) :: %BtrzHealthchecker.Info{
  build: term(),
  commit: term(),
  instanceId: term(),
  services: term(),
  status: term()
}