Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
ListenAndServe starts an HTTP server and blocks until SIGINT or SIGTERM is received. It then initiates a graceful shutdown, waiting up to ShutdownTimeout for active connections to finish.
func ListenAndServeMulti ¶
func ListenAndServeMulti(services []ServiceConfig) error
ListenAndServeMulti starts multiple HTTP servers on separate ports and blocks until SIGINT/SIGTERM. All servers are shut down gracefully.
Types ¶
type Config ¶
type Config struct {
Addr string
Handler http.Handler
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
ShutdownTimeout time.Duration
}
Config holds HTTP server settings.
type ServiceConfig ¶
type ServiceConfig struct {
Name string // "web", "api", "ws" — for logging
Config Config // Standard server config (addr, handler, timeouts)
}
ServiceConfig identifies a named HTTP service to run on a specific port.
Click to show internal directories.
Click to hide internal directories.