Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run wraps the http.Server and waits until either an error occurs or the provided context is cancelled. The error returned will be from the server (if listening fails) or from the context (if cancelled).
func Signal ¶
Signal returns a context that will cancel when a signal is received or the provided parent context is cancelled.
func WaitForSignal ¶
func WaitForSignal()
WaitForSignal returns only when a signal has been received.
Types ¶
type HTTPWrapper ¶
type HTTPWrapper struct {
// contains filtered or unexported fields
}
HTTPWrapper wraps an http.Server.
func New ¶
func New(s *http.Server) *HTTPWrapper
New creates a new HTTPWrapper from the provided http.Server. Note that the server will begin listening immediately.
func (*HTTPWrapper) Close ¶
func (h *HTTPWrapper) Close()
Close shuts down and waits for the server.
func (*HTTPWrapper) Error ¶
func (h *HTTPWrapper) Error() <-chan error
Error returns a channel that sends when a listening error occurs.
Click to show internal directories.
Click to hide internal directories.