HttpdShutdown: Graceful Daemon Shutdown in Go
This is one of those bits of code I keep cutting and pasting into projects so it seems to make sense to release it on its own. httpdshutdown (godocs) provides a mechanism to shutdown an http daemon either after all connections have closed, or a timeout. Upon shutting down, a series of user-defined shutdown hooks can be called.
This package is largely unopinionated about other aspects of http daemon tooling, so it should be something you may be able to use with your favorite framework. The gist below contains a neat summary of how to use it:
last update 2016-01-31