Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xerions/medex
Medical Examination - application for register health check callbacks and represent their state via HTTP.
https://github.com/xerions/medex
Last synced: 3 months ago
JSON representation
Medical Examination - application for register health check callbacks and represent their state via HTTP.
- Host: GitHub
- URL: https://github.com/xerions/medex
- Owner: xerions
- Created: 2015-10-27T12:49:20.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-11T08:22:33.000Z (about 9 years ago)
- Last Synced: 2024-10-04T16:17:19.720Z (4 months ago)
- Language: Elixir
- Size: 6.84 KB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Medical Examination - application for register health check callbacks and represent their state via HTTP. (Applications)
- fucking-awesome-elixir - medex - Medical Examination - application for register health check callbacks and represent their state via HTTP. (Applications)
- awesome-elixir - medex - Medical Examination - application for register health check callbacks and represent their state via HTTP. (Applications)
README
# Medex [![Build Status](https://travis-ci.org/xerions/medex.svg)](https://travis-ci.org/xerions/medex)
Medical Examination - application for register health check callbacks and represent their state via HTTP.
## Installation
1. Add medex to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:medex, github: "xerions/medex"}]
end
```2. Ensure medex is started before your application:
```elixir
def application do
[applications: [:medex]]
end
```## Example
Register new check callback:
```elixir
Medex.register "db", fn ->
case :erlang.phash2(:erlang.now, 3) do
0 -> :ok
1 -> :warning
2 -> :critical
end
end
```and get state
$ curl -v http://localhost:4000/health/db
## Consul
Medex suports pushing health check statutes to [Consul](https://www.consul.io/). It is disabled by default but you can turn it on:
```elixir
# use consul, false by default
config :medex, consul: true# which service name will be using for consul health-checks (optional)
config :medex, service_id: "service_example"
```And ensure start of consul application.