https://github.com/euskadi31/go-healthcheck
A Go Healthcheck handler
https://github.com/euskadi31/go-healthcheck
Last synced: about 2 months ago
JSON representation
A Go Healthcheck handler
- Host: GitHub
- URL: https://github.com/euskadi31/go-healthcheck
- Owner: euskadi31
- License: mit
- Created: 2022-01-28T15:12:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T20:49:43.000Z (2 months ago)
- Last Synced: 2025-04-09T20:04:41.348Z (about 2 months ago)
- Language: Go
- Size: 84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Healthcheck HTTP Handler [](https://github.com/euskadi31/go-healthcheck/releases/latest) [](https://godoc.org/github.com/euskadi31/go-healthcheck)
[](https://goreportcard.com/report/github.com/euskadi31/go-healthcheck)
| Branch | Status | Coverage |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| main | [](https://github.com/euskadi31/go-healthcheck/actions/workflows/go.yml) | [](https://coveralls.io/github/euskadi31/go-healthcheck?branch=main) |## Example
```go
package mainimport (
"github.com/euskadi31/go-healthcheck"
)type RedisHealthcheck struct {
}
func (c *RedisHealthcheck) Check() bool {
return true
}func main() {
hc := healthcheck.New()// use healthcheck.Handler
hc.Add("redis", &RedisHealthcheck{})// use healthcheck.HandlerFunc
err := hc.Add("mysql", healthcheck.HandlerFunc(func() bool {
return true
}))http.Handle("/health", hc)
http.ListenAndServe(":8090", nil)
}
```