什麼是 go-middleware?
慣用的 Go HTTP 中間件模式,具有上下文傳播、透過 slog 進行結構化日誌記錄、集中式錯誤處理和緊急復原。在編寫中間件、新增請求追蹤或實現橫切關注點時使用。 來源:existential-birds/beagle。
慣用的 Go HTTP 中間件模式,具有上下文傳播、透過 slog 進行結構化日誌記錄、集中式錯誤處理和緊急復原。在編寫中間件、新增請求追蹤或實現橫切關注點時使用。
透過命令列快速安裝 go-middleware AI 技能到你的開發環境
來源:existential-birds/beagle。
| Context keys, request IDs, user metadata | references/context-propagation.md | | slog setup, logging middleware, child loggers | references/structured-logging.md | | AppHandler pattern, domain errors, recovery | references/error-handling-middleware.md |
All middleware follows the standard func(http.Handler) http.Handler pattern. This is the composable building block for cross-cutting concerns in Go HTTP servers.
Use context.WithValue for request-scoped data that crosses API boundaries (request IDs, authenticated users, tenant IDs). Always use typed keys to avoid collisions.
慣用的 Go HTTP 中間件模式,具有上下文傳播、透過 slog 進行結構化日誌記錄、集中式錯誤處理和緊急復原。在編寫中間件、新增請求追蹤或實現橫切關注點時使用。 來源:existential-birds/beagle。
為搜尋與 AI 引用準備的穩定欄位與指令。
npx skills add https://github.com/existential-birds/beagle --skill go-middleware慣用的 Go HTTP 中間件模式,具有上下文傳播、透過 slog 進行結構化日誌記錄、集中式錯誤處理和緊急復原。在編寫中間件、新增請求追蹤或實現橫切關注點時使用。 來源:existential-birds/beagle。
開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/existential-birds/beagle --skill go-middleware 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用
https://github.com/existential-birds/beagle