Documentation
¶
Overview ¶
Package burrow is a Go web framework built on chi, Den, and html/template. It provides a modular architecture where features are packaged as "apps" that plug into a shared server.
The root burrow package re-exports the most-used names from the sub-packages as type aliases and thin wrapper functions, so downstream code can keep writing burrow.App, burrow.AppConfig, burrow.NewServer, burrow.Handle and so on. Less-frequent names live in their proper sub-package:
- github.com/oliverandrich/burrow/app — App interface, capability interfaces (HasRoutes, HasMiddleware, …), AppConfig, NavItem, NavLink, Config and TLS/Server/Database/Storage sub-configs, context helpers
- github.com/oliverandrich/burrow/registry — the app registry with typed lookup (Get[T], MustGet[T], …)
- github.com/oliverandrich/burrow/server — Server, OpenDB, boot sequence
- github.com/oliverandrich/burrow/web — HandlerFunc, HTTPError, Handle, JSON, Render, Bind, Validate
- github.com/oliverandrich/burrow/tasks — Queue, DefineTask, DefineResultTask, JobOption
- github.com/oliverandrich/burrow/pagination — PageRequest, ParsePageRequest, OffsetResult, PageURL
Getting Started ¶
Create a server, register apps, and run:
srv := burrow.NewServer(
session.New(),
csrf.New(),
myapp.New(),
)
srv.SetLayout(myLayout)
app := &cli.Command{
Name: "mysite",
Flags: srv.Flags(nil),
Action: srv.Run,
}
_ = app.Run(context.Background(), os.Args)
NewServer sorts apps by declared dependencies automatically. The boot sequence runs migrations, configures each app from CLI/ENV/TOML flags, and starts the HTTP server with graceful shutdown.
Handler Functions ¶
Burrow handlers return an error instead of silently swallowing failures:
func listItems(w http.ResponseWriter, r *http.Request) error {
items, err := fetchItems(r.Context())
if err != nil {
return err // logged and rendered as 500
}
return burrow.JSON(w, http.StatusOK, items)
}
Wrap them with Handle to get a standard http.HandlerFunc:
r.Get("/items", burrow.Handle(listItems))
Return an HTTPError to control the status code and message:
return burrow.NewHTTPError(http.StatusNotFound, "item not found")
App Interface ¶
Every app implements App (Name only). Apps gain additional capabilities by implementing optional interfaces such as HasRoutes, HasMiddleware, HasMigrations, Configurable, HasShutdown, and others — all defined in the github.com/oliverandrich/burrow/app package.
Contrib Apps ¶
The contrib/ directory provides reusable apps:
- admin — admin panel coordinator with three-tier role gating
- auth — WebAuthn passkey authentication with recovery codes
- authmail — pluggable email rendering with SMTP backend
- csrf — CSRF protection (gorilla/csrf)
- healthcheck — liveness and readiness probes
- htmx — HTMX asset serving and request/response helpers
- humanize — i18n-aware template helpers for times, numbers, file sizes
- jobs — Den-backed in-process job queue with retry (SQLite + Postgres)
- messages — flash messages via session storage
- ratelimit — per-client token bucket rate limiting
- secure — security response headers (X-Frame-Options, HSTS, CSP, …)
- selfupdate — in-app binary self-update from GitHub releases
- session — cookie-based sessions (gorilla/sessions)
- sse — Server-Sent Events with in-memory pub/sub broker
- staticfiles — static file serving with content-hashed URLs
Locale detection and translations are provided by the root github.com/oliverandrich/burrow/i18n package, not a contrib.
Index ¶
- Constants
- Variables
- func Bind(r *http.Request, v any) error
- func CaptureResult(ctx context.Context, data []byte)
- func ClientIP(ctx context.Context) string
- func ClientIPAddr(ctx context.Context) netip.Addr
- func ContextValue[T any](ctx context.Context, key any) (T, bool)
- func CoreFlags(configSource func(key string) cli.ValueSource) []cli.Flag
- func FlagSources(configSource func(key string) cli.ValueSource, envVar, tomlKey string) cli.ValueSourceChain
- func HTML(w http.ResponseWriter, code int, s string) error
- func Handle(fn HandlerFunc) http.HandlerFunc
- func IsAdmin(ctx context.Context) bool
- func IsAuthenticated(ctx context.Context) bool
- func IsLocalhost(host string) bool
- func IsStaff(ctx context.Context) bool
- func JSON(w http.ResponseWriter, code int, v any) error
- func Layout(ctx context.Context) string
- func OpenDB(ctx context.Context, dsn string, opts ...den.Option) (*den.DB, error)
- func PageNumbers(current, total int) []int
- func PageURL(basePath, rawQuery string, page int) string
- func Render(w http.ResponseWriter, r *http.Request, statusCode int, name string, ...) error
- func RenderContent(w http.ResponseWriter, r *http.Request, statusCode int, content template.HTML, ...) error
- func RenderError(w http.ResponseWriter, r *http.Request, code int, message string)
- func RenderFragment(ctx context.Context, name string, data map[string]any) (template.HTML, error)
- func RequestIsHTTPS(r *http.Request) bool
- func RequestPath(ctx context.Context) string
- func Text(w http.ResponseWriter, code int, s string) error
- func Validate(v any) error
- func WithAuthChecker(ctx context.Context, checker AuthChecker) context.Context
- func WithContextValue(ctx context.Context, key, val any) context.Context
- func WithLayout(ctx context.Context, name string) context.Context
- func WithNavItems(ctx context.Context, items []NavItem) context.Context
- func WithRequestPath(ctx context.Context, path string) context.Context
- func WithResultCapture(ctx context.Context, rc *ResultCapture) context.Context
- func WithTemplateExecutor(ctx context.Context, exec TemplateExecutor) context.Context
- type AdminAuth
- type App
- type AppConfig
- type AuthChecker
- type Config
- type Configurable
- type DatabaseConfig
- type Enqueuer
- type FieldError
- type HTTPError
- type HandlerFunc
- type HasAdmin
- type HasCLICommands
- type HasDependencies
- type HasDocuments
- type HasFlags
- type HasFuncMap
- type HasJobs
- type HasMiddleware
- type HasMigrations
- type HasNavItems
- type HasRequestFuncMap
- type HasRoutes
- type HasShutdown
- type HasStaticFiles
- type HasTemplates
- type HasTranslations
- type JobConfig
- type JobHandlerFunc
- type JobOption
- type NamedMigration
- type NavItem
- type NavLink
- type PageRequest
- type PageResponse
- type PageResult
- type PostConfigurable
- type Queue
- type ReadinessChecker
- type Registry
- type ResultCapture
- type ResultTask
- type Server
- type ServerConfig
- type Startable
- type StorageConfig
- type TLSConfig
- type TaskDefinition
- type TemplateExecutor
- type ValidationError
Constants ¶
const CacheControlImmutable = web.CacheControlImmutable
CacheControlImmutable is the value to set on Cache-Control headers for content-hashed static assets. Alias for web.CacheControlImmutable.
Variables ¶
var ErrNoTemplateExecutor = web.ErrNoTemplateExecutor
ErrNoTemplateExecutor is returned by Render when no executor is in context. Alias for web.ErrNoTemplateExecutor.
Functions ¶
func Bind ¶
Bind parses a request body (JSON, multipart, or form-encoded) into v and validates it. Wrapper around web.Bind.
func CaptureResult ¶ added in v0.13.0
CaptureResult stores result data in the context-bound capture. Wrapper around tasks.CaptureResult.
func ClientIP ¶ added in v0.26.0
ClientIP returns the client IP stored in the context by burrow's server-level ClientIP middleware (configured via --client-ip-mode). Returns "" when no middleware ran. Wrapper around chimw.GetClientIP. See docs/guide/client-ip.md for the trust model.
func ClientIPAddr ¶ added in v0.26.0
ClientIPAddr returns the client IP as a netip.Addr. Use netip.Addr.IsValid to check whether a middleware ran. Wrapper around chimw.GetClientIPAddr.
func ContextValue ¶
ContextValue retrieves a typed value from the context. Wrapper around app.ContextValue.
func CoreFlags ¶
func CoreFlags(configSource func(key string) cli.ValueSource) []cli.Flag
CoreFlags returns the CLI flags for core framework configuration. Wrapper around app.CoreFlags.
func FlagSources ¶
func FlagSources(configSource func(key string) cli.ValueSource, envVar, tomlKey string) cli.ValueSourceChain
FlagSources builds a cli.ValueSourceChain from an environment variable and an optional TOML key. Wrapper around app.FlagSources.
func HTML ¶
func HTML(w http.ResponseWriter, code int, s string) error
HTML writes an HTML response with the given status code. Wrapper around web.HTML.
func Handle ¶
func Handle(fn HandlerFunc) http.HandlerFunc
Handle wraps a HandlerFunc into an http.HandlerFunc with centralized error handling. Wrapper around web.Handle.
func IsAdmin ¶ added in v0.23.0
IsAdmin returns true if the AuthChecker in context reports admin status. Wrapper around app.IsAdmin.
func IsAuthenticated ¶ added in v0.23.0
IsAuthenticated returns true if the AuthChecker in context reports authentication. Wrapper around app.IsAuthenticated.
func IsLocalhost ¶
IsLocalhost reports whether the host string refers to a localhost address. Wrapper around app.IsLocalhost.
func IsStaff ¶ added in v0.23.0
IsStaff returns true if the AuthChecker in context reports staff status. Wrapper around app.IsStaff.
func JSON ¶
func JSON(w http.ResponseWriter, code int, v any) error
JSON writes a JSON response with the given status code. Wrapper around web.JSON.
func Layout ¶
Layout retrieves the layout template name from the context. Wrapper around app.Layout.
func OpenDB ¶ added in v0.7.0
OpenDB opens a database from a URL-style DSN. Wrapper around server.OpenDB.
func PageNumbers ¶ added in v0.6.0
PageNumbers returns the truncated page list for a paginator UI. Wrapper around pagination.PageNumbers.
func PageURL ¶ added in v0.6.0
PageURL builds a pagination URL preserving existing query parameters. Wrapper around pagination.PageURL.
func Render ¶
func Render(w http.ResponseWriter, r *http.Request, statusCode int, name string, data map[string]any) error
Render writes a rendered template into the HTTP response, wrapping it in the layout for full-page requests. Wrapper around web.Render.
func RenderContent ¶ added in v0.6.0
func RenderContent(w http.ResponseWriter, r *http.Request, statusCode int, content template.HTML, data map[string]any) error
RenderContent writes pre-rendered template.HTML into the response. Wrapper around web.RenderContent.
func RenderError ¶ added in v0.5.0
RenderError writes a typed error response (JSON or HTML based on Accept). Wrapper around web.RenderError.
func RenderFragment ¶ added in v0.9.0
RenderFragment executes a named template into template.HTML using the context's executor. Wrapper around web.RenderFragment.
func RequestIsHTTPS ¶ added in v0.29.0
RequestIsHTTPS reports whether the request should be treated as HTTPS for per-request security decisions (CSRF origin check, Secure cookies). Wrapper around app.RequestIsHTTPS: it honors a trusted reverse proxy's X-Forwarded-Proto (see --forwarded-mode) and falls back to r.TLS.
func RequestPath ¶ added in v0.9.0
RequestPath retrieves the request path from the context. Wrapper around app.RequestPath.
func Text ¶
func Text(w http.ResponseWriter, code int, s string) error
Text writes a plain-text response with the given status code. Wrapper around web.Text.
func Validate ¶
Validate runs validator on v and returns any *ValidationError. Wrapper around web.Validate.
func WithAuthChecker ¶ added in v0.4.0
func WithAuthChecker(ctx context.Context, checker AuthChecker) context.Context
WithAuthChecker stores an AuthChecker in the context. Wrapper around app.WithAuthChecker.
func WithContextValue ¶
WithContextValue stores a value in the context under the given key. Wrapper around app.WithContextValue.
func WithLayout ¶
WithLayout stores the layout template name in the context. Wrapper around app.WithLayout.
func WithNavItems ¶
WithNavItems stores navigation items in the context. Wrapper around app.WithNavItems.
func WithRequestPath ¶ added in v0.9.0
WithRequestPath stores the request path in the context. Wrapper around app.WithRequestPath.
func WithResultCapture ¶ added in v0.13.0
func WithResultCapture(ctx context.Context, rc *ResultCapture) context.Context
WithResultCapture stores a ResultCapture in the context. Wrapper around tasks.WithResultCapture.
func WithTemplateExecutor ¶
func WithTemplateExecutor(ctx context.Context, exec TemplateExecutor) context.Context
WithTemplateExecutor stores the template executor in the context. Wrapper around app.WithTemplateExecutor.
Types ¶
type AdminAuth ¶ added in v0.13.0
AdminAuth provides middleware for the admin panel. Alias for app.AdminAuth.
type AppConfig ¶
AppConfig is passed to each app's Configure method, providing access to shared framework resources. Alias for app.AppConfig.
type AuthChecker ¶ added in v0.4.0
type AuthChecker = app.AuthChecker
AuthChecker carries auth-state closures in the request context. Alias for app.AuthChecker.
type Config ¶
Config holds core framework configuration. Alias for app.Config.
type Configurable ¶
type Configurable = app.Configurable
Configurable is implemented by apps that need to read configuration and perform setup. Alias for app.Configurable.
type DatabaseConfig ¶
type DatabaseConfig = app.DatabaseConfig
DatabaseConfig holds database settings. Alias for app.DatabaseConfig.
type Enqueuer ¶ added in v0.13.0
Enqueuer provides job submission and cancellation. Alias for tasks.Enqueuer.
type FieldError ¶
type FieldError = web.FieldError
FieldError is one entry in a ValidationError. Alias for web.FieldError.
type HTTPError ¶
HTTPError is the typed error returned from handlers to control status code and message. Alias for web.HTTPError.
func NewHTTPError ¶
NewHTTPError constructs a typed HTTP error. Wrapper around web.NewHTTPError.
type HandlerFunc ¶
type HandlerFunc = web.HandlerFunc
HandlerFunc is burrow's error-returning HTTP handler signature. Alias for web.HandlerFunc.
type HasAdmin ¶
HasAdmin is implemented by apps that contribute admin routes and nav items. Alias for app.HasAdmin.
type HasCLICommands ¶
type HasCLICommands = app.HasCLICommands
HasCLICommands is implemented by apps that contribute CLI subcommands. Alias for app.HasCLICommands.
type HasDependencies ¶
type HasDependencies = registry.HasDependencies
HasDependencies is implemented by apps that require other apps to be registered first. Alias for registry.HasDependencies.
type HasDocuments ¶ added in v0.11.0
type HasDocuments = app.HasDocuments
HasDocuments is implemented by apps that register Den document types. Alias for app.HasDocuments.
type HasFlags ¶ added in v0.10.0
HasFlags is implemented by apps that define CLI flags. Alias for app.HasFlags.
type HasFuncMap ¶
type HasFuncMap = app.HasFuncMap
HasFuncMap is implemented by apps that provide static template functions. Alias for app.HasFuncMap.
type HasJobs ¶
HasJobs is implemented by apps that register background job handlers. Alias for tasks.HasJobs.
type HasMiddleware ¶
type HasMiddleware = app.HasMiddleware
HasMiddleware is implemented by apps that contribute HTTP middleware. Alias for app.HasMiddleware.
type HasMigrations ¶ added in v0.22.0
type HasMigrations = app.HasMigrations
HasMigrations is implemented by apps that ship versioned migrations. Alias for app.HasMigrations.
type HasNavItems ¶
type HasNavItems = app.HasNavItems
HasNavItems is implemented by apps that contribute navigation items. Alias for app.HasNavItems.
type HasRequestFuncMap ¶
type HasRequestFuncMap = app.HasRequestFuncMap
HasRequestFuncMap is implemented by apps that provide context-scoped template functions. Alias for app.HasRequestFuncMap.
type HasRoutes ¶
HasRoutes is implemented by apps that register HTTP routes. Alias for app.HasRoutes.
type HasShutdown ¶
type HasShutdown = app.HasShutdown
HasShutdown is implemented by apps that need cleanup during graceful shutdown. Alias for app.HasShutdown.
type HasStaticFiles ¶
type HasStaticFiles = app.HasStaticFiles
HasStaticFiles is implemented by apps that contribute static assets. Alias for app.HasStaticFiles.
type HasTemplates ¶
type HasTemplates = app.HasTemplates
HasTemplates is implemented by apps that provide HTML template files. Alias for app.HasTemplates.
type HasTranslations ¶
type HasTranslations = app.HasTranslations
HasTranslations is implemented by apps that contribute translation files. Alias for app.HasTranslations.
type JobConfig ¶
JobConfig holds per-handler job configuration. Alias for tasks.JobConfig.
type JobHandlerFunc ¶
type JobHandlerFunc = tasks.JobHandlerFunc
JobHandlerFunc is the signature for job handler functions. Alias for tasks.JobHandlerFunc.
type JobOption ¶
JobOption configures job handler registration. Alias for tasks.JobOption.
func WithMaxRetries ¶
WithMaxRetries sets the maximum number of retries for a job type. Wrapper around tasks.WithMaxRetries.
func WithPriority ¶ added in v0.13.0
WithPriority sets the default priority for a job type. Wrapper around tasks.WithPriority.
type NamedMigration ¶ added in v0.22.0
type NamedMigration = app.NamedMigration
NamedMigration pairs a version label with a Den migration. Alias for app.NamedMigration.
type NavItem ¶
NavItem represents a navigation entry contributed by an app. Alias for app.NavItem.
type NavLink ¶ added in v0.4.0
NavLink is a template-ready navigation item with pre-computed active state. Alias for app.NavLink.
type PageRequest ¶
type PageRequest = pagination.PageRequest
PageRequest captures requested limit and page from the query string. Alias for pagination.PageRequest.
func ParsePageRequest ¶
func ParsePageRequest(r *http.Request) PageRequest
ParsePageRequest extracts limit and page from the request query string. Wrapper around pagination.ParsePageRequest.
type PageResponse ¶
type PageResponse[T any] = pagination.PageResponse[T]
PageResponse wraps items and pagination metadata for JSON APIs. Alias for pagination.PageResponse.
type PageResult ¶
type PageResult = pagination.PageResult
PageResult holds the computed pagination metadata. Alias for pagination.PageResult.
func CursorResult ¶
func CursorResult(hasMore bool, nextCursor string) PageResult
CursorResult builds pagination metadata for forward cursor pagination. Wrapper around pagination.CursorResult.
func OffsetResult ¶
func OffsetResult(pr PageRequest, totalCount int) PageResult
OffsetResult computes pagination metadata from a request and total count. Wrapper around pagination.OffsetResult.
type PostConfigurable ¶ added in v0.7.4
type PostConfigurable = app.PostConfigurable
PostConfigurable is implemented by apps that need a second configuration pass after Configure has run on every Configurable app. Alias for app.PostConfigurable.
type Queue ¶
Queue provides job handler registration, enqueueing, and cancellation. Alias for tasks.Queue.
type ReadinessChecker ¶ added in v0.4.0
type ReadinessChecker = app.ReadinessChecker
ReadinessChecker is implemented by apps that contribute to the readiness probe. Alias for app.ReadinessChecker.
type Registry ¶
Registry stores the apps that make up a Server. Alias for registry.Registry — operate on it with the free functions in package registry: registry.New, registry.Add, registry.Get, etc.
type ResultCapture ¶ added in v0.13.0
type ResultCapture = tasks.ResultCapture
ResultCapture holds the captured result of a job handler. Alias for tasks.ResultCapture.
type ResultTask ¶ added in v0.13.0
type ResultTask[P, R any] = tasks.ResultTask[P, R]
ResultTask is a generic typed task that captures a result. Alias for tasks.ResultTask.
func DefineResultTask ¶ added in v0.13.0
func DefineResultTask[P, R any](name string, handler func(context.Context, P) (R, error), opts ...JobOption) *ResultTask[P, R]
DefineResultTask wires up a generic typed task that captures a result. Wrapper around tasks.DefineResultTask.
type Server ¶
Server is the framework's main orchestrator. Alias for server.Server. Construct with NewServer; configure layout via server.Server.SetLayout; start with server.Server.Run inside a urfave/cli action.
func NewServer ¶
NewServer creates a Server and registers the given apps. Apps are auto-sorted to satisfy HasDependencies declarations. Wrapper around server.New.
type ServerConfig ¶
type ServerConfig = app.ServerConfig
ServerConfig holds HTTP server settings. Alias for app.ServerConfig.
type Startable ¶ added in v0.9.0
Startable is implemented by apps that need to start background processes after the boot sequence completes. Alias for server.Startable.
type StorageConfig ¶ added in v0.15.0
type StorageConfig = app.StorageConfig
StorageConfig holds file-storage settings. Alias for app.StorageConfig.
type TLSConfig ¶
TLSConfig holds TLS settings. Alias for app.TLSConfig.
type TaskDefinition ¶ added in v0.13.0
type TaskDefinition[P any] = tasks.TaskDefinition[P]
TaskDefinition is a generic typed task wrapper. Alias for tasks.TaskDefinition.
func DefineTask ¶ added in v0.13.0
func DefineTask[P any](name string, handler func(context.Context, P) error, opts ...JobOption) *TaskDefinition[P]
DefineTask wires up a generic typed task definition. Wrapper around tasks.DefineTask.
type TemplateExecutor ¶
type TemplateExecutor = app.TemplateExecutor
TemplateExecutor executes a named template with the given data. Alias for app.TemplateExecutor.
func TemplateExec ¶ added in v0.5.0
func TemplateExec(ctx context.Context) TemplateExecutor
TemplateExec retrieves the template executor from the context. Wrapper around app.TemplateExec.
func TemplateExecutorFromContext ¶
func TemplateExecutorFromContext(ctx context.Context) TemplateExecutor
TemplateExecutorFromContext is a deprecated alias for TemplateExec.
type ValidationError ¶
type ValidationError = web.ValidationError
ValidationError carries per-field validation failures. Alias for web.ValidationError.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package app defines the foundation types and capability interfaces every burrow app implements.
|
Package app defines the foundation types and capability interfaces every burrow app implements. |
|
Package burrowtest provides test helpers for code that uses the burrow framework.
|
Package burrowtest provides test helpers for code that uses the burrow framework. |
|
cmd
|
|
|
burrow
command
Command burrow is the Burrow framework's command-line companion.
|
Command burrow is the Burrow framework's command-line companion. |
|
contrib
|
|
|
admin
Package admin provides the admin panel coordinator as a burrow contrib app.
|
Package admin provides the admin panel coordinator as a burrow contrib app. |
|
apidocs
Package apidocs serves a self-hosted, interactive OpenAPI documentation UI.
|
Package apidocs serves a self-hosted, interactive OpenAPI documentation UI. |
|
auth
Package auth provides authentication as a burrow contrib app.
|
Package auth provides authentication as a burrow contrib app. |
|
auth/authtest
Package authtest provides test helpers for creating auth-migrated databases and test users, following the convention of net/http/httptest.
|
Package authtest provides test helpers for creating auth-migrated databases and test users, following the convention of net/http/httptest. |
|
authmail
Package authmail defines the Renderer interface for auth email templates.
|
Package authmail defines the Renderer interface for auth email templates. |
|
authmail/smtpmail
Package smtpmail provides an SMTP-based implementation of auth.EmailService with pluggable email templates via authmail.Renderer.
|
Package smtpmail provides an SMTP-based implementation of auth.EmailService with pluggable email templates via authmail.Renderer. |
|
csrf
Package csrf provides CSRF protection as a burrow contrib app.
|
Package csrf provides CSRF protection as a burrow contrib app. |
|
healthcheck
Package healthcheck provides liveness and readiness probes for burrow.
|
Package healthcheck provides liveness and readiness probes for burrow. |
|
htmx
Package htmx provides request detection and response helpers for htmx, inspired by django-htmx.
|
Package htmx provides request detection and response helpers for htmx, inspired by django-htmx. |
|
humanize
Package humanize provides i18n-aware template functions for human-friendly display of times, numbers, and file sizes.
|
Package humanize provides i18n-aware template functions for human-friendly display of times, numbers, and file sizes. |
|
messages
Package messages provides flash message support as a burrow contrib app.
|
Package messages provides flash message support as a burrow contrib app. |
|
ratelimit
Package ratelimit provides per-client rate limiting as a burrow contrib app.
|
Package ratelimit provides per-client rate limiting as a burrow contrib app. |
|
selfupdate
Package selfupdate adds an `update` sub-command to a burrow app that downloads the latest release for the running OS/arch from GitHub, Codeberg, or any Forgejo instance and atomically replaces the binary in place.
|
Package selfupdate adds an `update` sub-command to a burrow app that downloads the latest release for the running OS/arch from GitHub, Codeberg, or any Forgejo instance and atomically replaces the binary in place. |
|
session
Package session provides cookie-based session management as a burrow contrib app.
|
Package session provides cookie-based session management as a burrow contrib app. |
|
sse
Package sse provides a Server-Sent Events (SSE) contrib app for burrow.
|
Package sse provides a Server-Sent Events (SSE) contrib app for burrow. |
|
staticfiles
Package staticfiles provides static file serving as a burrow contrib app.
|
Package staticfiles provides static file serving as a burrow contrib app. |
|
Package crud turns a Den document type into a standard set of JSON CRUD endpoints, so the common 90% of an API can be declared instead of hand-written while custom actions stay ordinary chi routes.
|
Package crud turns a Den document type into a standard set of JSON CRUD endpoints, so the common 90% of an API can be declared instead of hand-written while custom actions stay ordinary chi routes. |
|
example
|
|
|
hello
command
Command hello is a minimal burrow application that serves a single "Hello, World!" page with Tailwind v4 styling and i18n support.
|
Command hello is a minimal burrow application that serves a single "Hello, World!" page with Tailwind v4 styling and i18n support. |
|
notes/cmd/server
command
Command server demonstrates how to build an application using the burrow framework with contrib apps.
|
Command server demonstrates how to build an application using the burrow framework with contrib apps. |
|
notes/internal/app
Package app is the example-notes shell: it owns the project's layout templates, the homepage, the compiled Tailwind CSS bundle, and the brand logo.
|
Package app is the example-notes shell: it owns the project's layout templates, the homepage, the compiled Tailwind CSS bundle, and the brand logo. |
|
notes/internal/notes
Package notes is an example custom app demonstrating the burrow framework.
|
Package notes is an example custom app demonstrating the burrow framework. |
|
Package forms provides struct-based form definitions for creation, binding, validation, and field metadata extraction.
|
Package forms provides struct-based form definitions for creation, binding, validation, and field metadata extraction. |
|
Package i18n provides internationalization as core framework infrastructure.
|
Package i18n provides internationalization as core framework infrastructure. |
|
internal
|
|
|
bgloop
Package bgloop provides panic recovery for long-lived background goroutines.
|
Package bgloop provides panic recovery for long-lived background goroutines. |
|
cryptokey
Package cryptokey provides shared utilities for resolving and decoding hex-encoded 32-byte cryptographic keys used by contrib apps (csrf, session).
|
Package cryptokey provides shared utilities for resolving and decoding hex-encoded 32-byte cryptographic keys used by contrib apps (csrf, session). |
|
dev
Package dev implements the `burrow dev` integrated development server: a file watcher that restarts the application on source changes and (optionally) runs the Tailwind v4 standalone CLI in `--watch` mode alongside it.
|
Package dev implements the `burrow dev` integrated development server: a file watcher that restarts the application on source changes and (optionally) runs the Tailwind v4 standalone CLI in `--watch` mode alongside it. |
|
scaffold
Package scaffold renders embedded file trees into a destination directory, applying placeholder substitution and (optionally) a Go module path rewrite.
|
Package scaffold renders embedded file trees into a destination directory, applying placeholder substitution and (optionally) a Go module path rewrite. |
|
tailwind
Package tailwind drives the standalone Tailwind v4 CLI with a pre-generated `@source` listing that points at every template directory in the project — Burrow's contribs plus the project's own templates.
|
Package tailwind drives the standalone Tailwind v4 CLI with a pre-generated `@source` listing that points at every template directory in the project — Burrow's contribs plus the project's own templates. |
|
translationscheck
Package translationscheck holds the repo-wide translation guards that walk every contrib's and example's TOML translation files and assert cross-cutting invariants: go-i18n accepts each file (reserved-keys guard) and no message ID has divergent values across files for the same locale (boot-time merge collision guard).
|
Package translationscheck holds the repo-wide translation guards that walk every contrib's and example's TOML translation files and assert cross-cutting invariants: go-i18n accepts each file (reserved-keys guard) and no message ID has divergent values across files for the same locale (boot-time merge collision guard). |
|
Package registry holds the apps that make up a burrow Server.
|
Package registry holds the apps that make up a burrow Server. |
|
Package uploader provides HTTP-layer helpers for file uploads built on top of den.Storage: an Uploader service that validates and persists multipart uploads into a document.Attachment, a ServeHandler that streams stored bytes back to HTTP clients, and a Mount helper that registers the serving handler at the Storage's own URL prefix.
|
Package uploader provides HTTP-layer helpers for file uploads built on top of den.Storage: an Uploader service that validates and persists multipart uploads into a document.Attachment, a ServeHandler that streams stored bytes back to HTTP clients, and a Mount helper that registers the serving handler at the Storage's own URL prefix. |