/health

health check middleware for Echo web framework

Primary LanguageGoMIT LicenseMIT

health

Buy Me A Coffee Build Status

health check middleware for Echo web framework

Usage

Integration

type redisResource struct {
  *redis.Client
}

func (r redisResource) HealthCheck() error {
  return r.Client.Ping().Err()
}

func main() {
  // ...

  e := echo.New()
  e.Use(health.New(redisResource{Client: redisClient}))

  // ...
}

Check

For HTTP service, liveness and readiness should be identical.

curl http://127.0.0.1:1234/_health

This will check all resources with HealthCheck() method

License

canhead hi@canhead.xyz MIT License