5dbd71307f
Tres tipos Go en el paquete infra para construir servidores HTTP: - Middleware: funcion que envuelve http.Handler (patron decorator) - Route: struct con Method, Path y Handler para registrar rutas - HTTPError: struct con Status, Code y Message para respuestas JSON de error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 lines
297 B
Go
9 lines
297 B
Go
package infra
|
|
|
|
// HTTPError representa un error HTTP estructurado para respuestas JSON.
|
|
type HTTPError struct {
|
|
Status int // codigo HTTP (ej: 400, 404, 500)
|
|
Code string // codigo de error legible por maquina (ej: "invalid_input")
|
|
Message string // mensaje de error legible por humano
|
|
}
|