Skip to content

yankeguo-deprecated/health

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages