# Packages
Package listener provides a way to incorporate graceful shutdown to any
net.Listener.
# Functions
AddSignal adds the given signal to the set of signals that trigger a graceful shutdown.
DoubleKickWindow sets the length of the window during which two back-to-back signals are treated as an especially urgent or forceful request to exit (i.e., ShutdownNow instead of Shutdown).
HandleSignals installs signal handlers for a set of standard signals.
ListenAndServe behaves exactly like the net/http function of the same name.
ListenAndServeTLS behaves almost exactly like the net/http function of the same name.
PostHook registers a function to be called after all of this package's normal shutdown actions.
PostHookWithSignal registers a function to be called after all of this package's normal shutdown actions, which receives the signal that caused the shutdown (or nil for manual shutdowns).
PreHook registers a function to be called before any of this package's normal shutdown actions.
PreHookWithSignal registers a function to be called before any of this package's normal shutdown actions, which recieves the signal that caused the shutdown (or nil for manual shutdowns).
ResetSignals resets the list of signals that trigger a graceful shutdown.
Serve mostly behaves like the net/http function of the same name, except that if the passed listener is a net.TCPListener, TCP keep-alives are enabled on accepted connections.
Shutdown manually triggers a shutdown from your application.
ShutdownNow triggers an immediate shutdown from your application.
Timeout sets the maximum amount of time package graceful will wait for connections to gracefully shut down after receiving a signal.
Wait for all connections to gracefully shut down.
WrapListener wraps an arbitrary net.Listener for use with graceful shutdowns.
# Type aliases
A Server is exactly the same as an http.Server, but provides more graceful implementations of its methods.