Documentation
¶
Overview ¶
Package api provides HTTP handlers, middleware, and routing for the user preferences service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config holds configuration for the API server. TODO: Expand with Address, TLS config, timeouts etc.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the dependencies for the HTTP server.
func (*Server) Start ¶
Start runs the HTTP server. This method is blocking and will only return when the server is shut down or an unrecoverable error occurs (e.g., failure to bind to the address). If non-blocking behavior is desired, the caller should run this method in a separate goroutine. It logs the server startup and shutdown events. Returns http.ErrServerClosed if the server is gracefully shut down, nil otherwise for graceful shutdown scenarios handled by ListenAndServe itself, or an error if the server fails to start or stops unexpectedly.