Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GracefulServer ¶ added in v0.0.3
GracefulServer combines an HTTP server with a context for graceful shutdown handling.
func (*GracefulServer) Run ¶ added in v0.0.3
func (s *GracefulServer) Run(sig ...os.Signal)
Run starts the HTTP server in a goroutine and listens for termination signals to gracefully shut down. It takes optional signals to listen for; if none are provided, it uses default signals.
type Middleware ¶
Middleware represents a function that can wrap a http.Handler with additional functionality. It takes a http.Handler and returns a new http.Handler that includes the middleware's behavior.
type RunLogger ¶ added in v0.0.3
type RunLogger interface {
Printf(format string, v ...interface{})
Fatalf(format string, v ...interface{})
}
RunLogger defines the interface for logging used within the GracefulServer's Run method. It provides methods for formatted printing and fatal errors which halt the program.
type WrappedWriter ¶ added in v0.0.2
type WrappedWriter struct {
http.ResponseWriter
StatusCode int
}
func (*WrappedWriter) WriteHeader ¶ added in v0.0.2
func (w *WrappedWriter) WriteHeader(c int)
Click to show internal directories.
Click to hide internal directories.