health

Simple Go health handler

MIT License

Stars
1

Bot releases are visible (Hide)

health - v1.6.0 Latest Release

Published by TwiN almost 2 years ago

feat: Add GetResponseStatusCodeAndBody for non-stdlib routers

health - v1.5.0

Published by TwiN about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/TwiN/health/compare/v1.4.1...v1.5.0

health - v1.4.1

Published by TwiN about 2 years ago

chore: Update Go to 1.19

health - v1.4.0

Published by TwiN over 2 years ago

Added SetHealthy and SetUnhealthy functions

health - v1.3.0

Published by TwiN almost 3 years ago

Added SetStatusAndReason function

health - v1.2.1

Published by TwiN almost 3 years ago

Minor improvements

health - v1.2.0

Published by TwiN almost 3 years ago

Added optional reason parameter, which can be set using SetReason and retrieved using GetReason.

Assuming the status is health.Down and the reason is "database unreachable"

If JSON is enabled (WithJSON(true)):

{
  "status": "DOWN",
  "reason": "database unreachable"
}

If JSON is not enabled:

DOWN: database unreachable

Assuming the status is health.Up and the reason is not set ("")

If JSON is enabled (WithJSON(true)):

{
  "status": "UP"
}

If JSON is not enabled:

UP

In other words, if the reason is empty, it is as if the parameter does not exist. This is by design.

health - v1.1.0

Published by TwiN almost 3 years ago

  • Added GetStatus function to retrieve current status
  • Fixed potential issue with race condition
health - v1.0.1

Published by TwiN about 3 years ago

health - v1.0.0

Published by TwiN over 3 years ago

First release

Package Rankings
Top 7.36% on Proxy.golang.org
Badges
Extracted from project README
Go Report Card codecov Go version Go Reference