View Source BtrzHealthchecker (BtrzHealthchecker v0.4.0)
BtrzHealthchecker main module.
Used to get the information about the desired services passed as Checkers.
Link to this section Summary
Link to this section Types
@type checker() :: Map.t()
A checker that implements the Checker behaviour
Link to this section Functions
@spec 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
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}