Documentation
¶
Overview ¶
Package infra provides a wrapper around the standard library's net/http HTTP server with graceful shutdown support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a wrapper around http.Server that simplifies HTTP server setup and provides convenient methods for route registration and graceful shutdown.
func (*Server) HandleFunc ¶
func (s *Server) HandleFunc(pattern string, handler http.HandlerFunc)
HandleFunc registers an HTTP handler function for the given pattern.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server on the specified address. It treats http.ErrServerClosed as a successful shutdown and returns nil. Returns an error wrapped with context if the server fails to start.
Click to show internal directories.
Click to hide internal directories.