feat: tipos HTTP — Middleware, Route, HTTPError

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>
This commit is contained in:
2026-04-13 01:57:34 +02:00
parent 092f14eff0
commit d8d72bb8d6
6 changed files with 115 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
package infra
import "net/http"
// Middleware es una funcion que envuelve un http.Handler para añadir comportamiento.
type Middleware func(http.Handler) http.Handler