Standalone net/http middleware for panic recovery, CORS, request ID injection, and request logging. What's included: - Recover(): panic -> 500, captures debug.Stack, no logger required - CORS(origins): OPTIONS 204 preflight, origin allowlist, package-wide method/header constants - RequestID(generator): injects ID via logz.WithRequestID, sets X-Request-ID response header - RequestLogger(logger): logs method/path/status/latency/request_id; Error for 5xx, Info otherwise - Logger interface: Info, Error, With — duck-typed; satisfied by logz.Logger - StatusRecorder: exported http.ResponseWriter wrapper that captures written status code - Direct logz import for context helpers (documented exception to ADR-001) Tested-via: todo-api POC integration Reviewed-against: docs/adr/
26 lines
622 B
JSON
26 lines
622 B
JSON
{
|
|
"name": "Go",
|
|
"image": "mcr.microsoft.com/devcontainers/go:2-1.25-trixie",
|
|
"features": {
|
|
"ghcr.io/devcontainers-extra/features/claude-code:1": {}
|
|
},
|
|
"forwardPorts": [],
|
|
"postCreateCommand": "go version",
|
|
"customizations": {
|
|
"vscode": {
|
|
"settings": {
|
|
"files.autoSave": "afterDelay",
|
|
"files.autoSaveDelay": 1000,
|
|
"explorer.compactFolders": false,
|
|
"explorer.showEmptyFolders": true
|
|
},
|
|
"extensions": [
|
|
"golang.go",
|
|
"eamodio.golang-postfix-completion",
|
|
"quicktype.quicktype",
|
|
"usernamehw.errorlens"
|
|
]
|
|
}
|
|
},
|
|
"remoteUser": "vscode"
|
|
} |