burrow
burrow copied to clipboard
A modular Go web framework built on Chi, Den, and html/template — deploy as a single binary.
## Problem `Server.TemplateExecutor()` and `RenderFragment(ctx, ...)` were added to support template rendering outside of HTTP requests. However, the jobs app does not inject the `TemplateExecutor` into the job handler's context....
## Problem Burrow's template system requires a `*http.Request` for rendering (due to `RequestFuncMap` providers like CSRF, i18n). This makes it impossible to render templates outside of HTTP handlers — most...
## Problem Every mutating handler in an htmx+SSR app has the same response pattern: ```go if htmx.Request(r).IsHTMX() { return burrow.Render(w, r, http.StatusOK, "app/fragment", data) } http.Redirect(w, r, "/target", http.StatusSeeOther) return...
## Problem `burrow.Render()` currently requires `data map[string]any`, which forces apps to convert structs to maps before rendering: ```go func articleToMap(a *Article) map[string]any { return map[string]any{ "ID": a.ID, "URL": a.URL, "Title":...
## Problem Parsing numeric URL parameters is a recurring pattern in every app with resource routes: ```go func parseID(r *http.Request) (int64, error) { id, err := strconv.ParseInt(chi.URLParam(r, "id"), 10, 64)...
## Problem Every handler that needs the authenticated user repeats the same 4-line pattern: ```go user := auth.CurrentUser(r.Context()) if user == nil { return burrow.NewHTTPError(http.StatusUnauthorized, "not authenticated") } ``` Even...
## Problem The SSE broker is currently only accessible via the request context (set by middleware). Background jobs and other non-HTTP code that need to broadcast events must resort to...
## Problem `RegisterJobs()` is called during `jobs.Configure()`, which iterates over all registered apps. Due to the dependency resolver reordering apps, the calling app's own `Configure()` may not have run yet...