Documentation
¶
Overview ¶
Package httpserve runs an *http.Server until the process is asked to stop, then shuts it down gracefully.
It owns no routing, no middleware and no configuration: the caller builds the server it wants and hands it over.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Logger records the server lifecycle. Required.
Logger *slog.Logger
// ShutdownTimeout bounds the graceful shutdown.
ShutdownTimeout time.Duration
// StopSignals, when set, is called as shutdown begins so that a second
// interrupt terminates the process instead of being swallowed by the
// shutdown that is already in flight.
//
// Pass the CancelFunc returned by Signals.
StopSignals func()
}
Click to show internal directories.
Click to hide internal directories.