github.com/ancientlore/go-health (go): Package health is a framework for running health tests. Test functions are run in parallel and results can be reported via a web handler.  To get started, initialize the Tests map with named tests:  You can manually invoke tests using Run:  Or, use the HTTP handler and have a load balancer periodically run and check the results:  If all the tests succeed, an HTTP 200 is returned. Otherwise, and HTTP 500 is returned. Both cases return JSON:  Note that all tests are run in parallel, and the system includes code to trap calls to panic(). Tests should respect the timeout by checking ctx.Done(), however the system will not break if they don't check.  Tests can also be run periodically in the background using the Ticker type. The difference is that a thread is started to periodically run the tests, and a mechanism is provided to get the results.  Start by defining some tests:  Then start the background testing (and provide a means for it to stop running at some point, usually the end of the program):  You can manually check the results using GetResults:  Or, use the HTTP handler and have a load balancer periodically check the results:  If all the tests succeed, an HTTP 200 is returned. Otherwise, and HTTP 500 is returned. Both cases return JSON.
Keywords: golang|health-check