Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 5.8% dependent packages on proxy.golang.org
Top 4.7% dependent repos on proxy.golang.org

proxy.golang.org : github.com/ancientlore/go-health

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.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/ancientlore/go-health
Keywords: golang, health-check
License: Apache-2.0
Latest release: over 1 year ago
First release: about 6 years ago
Namespace: github.com/ancientlore
Dependent packages: 1
Dependent repositories: 1
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 16 days ago

    Loading...
    Readme
    Loading...