Skip to content

Migrating to v0.24

v0.24 reshapes the burrow package layout. Implementation moves into themed public sub-packages (burrow/app, burrow/server, burrow/web, burrow/tasks, burrow/pagination) alongside the existing burrow/registry. The burrow root becomes a thin convenience facade — type aliases and wrapper functions for the everyday API.

For the full list of changes, see the v0.24 changelog.

TL;DR — your code keeps working

Every burrow.X symbol downstream apps use today resolves through an alias or a wrapper to the new sub-package. No source change is required to compile against v0.24. Run go get -u github.com/oliverandrich/burrow, go mod tidy, and your build is green.

The aliases preserve Go type identity, so compile-time interface assertions like var _ burrow.Configurable = (*MyApp)(nil) keep working, and app.(*burrow.Server) resolves to the same concrete type as app.(*server.Server).

What moved where

You write What it is now
burrow.App, burrow.AppConfig, burrow.NavItem, burrow.HasRoutes, burrow.HasMiddleware, burrow.Configurable, … Aliases to types in burrow/app
burrow.Config, burrow.ServerConfig, burrow.DatabaseConfig, burrow.TLSConfig, burrow.NewConfig, burrow.CoreFlags, burrow.FlagSources, burrow.IsLocalhost Aliases / wrappers into burrow/app
burrow.WithLayout, burrow.Layout, burrow.NavItems, burrow.IsAuthenticated, burrow.IsStaff, burrow.IsAdmin, burrow.AuthChecker, burrow.TemplateExecutor, … Wrappers / aliases into burrow/app (context helpers)
burrow.Server, burrow.Startable, burrow.NewServer, burrow.OpenDB Aliases / wrappers into burrow/server
burrow.Handle, burrow.JSON, burrow.Text, burrow.HTML, burrow.Bind, burrow.Validate, burrow.Render, burrow.RenderError, burrow.NewHTTPError, burrow.HTTPError, burrow.HandlerFunc, burrow.ValidationError, burrow.FieldError Wrappers / aliases into burrow/web
burrow.Queue, burrow.Enqueuer, burrow.HasJobs, burrow.JobConfig, burrow.JobOption, burrow.JobHandlerFunc, burrow.TaskDefinition[P], burrow.ResultTask[P, R], burrow.ResultCapture, burrow.DefineTask[P], burrow.DefineResultTask[P, R], burrow.WithMaxRetries, burrow.WithPriority, burrow.WithResultCapture, burrow.CaptureResult Wrappers / aliases into burrow/tasks
burrow.PageRequest, burrow.PageResult, burrow.PageResponse[T], burrow.ParsePageRequest, burrow.OffsetResult, burrow.PageURL, burrow.PageNumbers Wrappers / aliases into burrow/pagination
burrow.Registry, registry.New, registry.Add, registry.Get[T], … Unchanged (already a sub-package since v0.24-pre)

Optional: reach the sub-package directly

Apps can import the sub-package they care about and skip the burrow root indirection. Both spellings produce identical compiled code:

// Spelling A — burrow root convenience
func (a *App) Routes(r chi.Router) {
    r.Get("/", burrow.Handle(home))
}

// Spelling B — direct sub-package import
func (a *App) Routes(r chi.Router) {
    r.Get("/", web.Handle(home))
}

Convention: stick with burrow.X for the operations that show up everywhere (burrow.App, burrow.NewServer, burrow.Handle, burrow.JSON, burrow.Render, burrow.AppConfig, capability interfaces, burrow.NewHTTPError). Reach into the sub-package for less-frequent helpers — tasks.DefineTask[Payload] reads cleaner than burrow.DefineTask[Payload] in a file already importing burrow/tasks, and the same for pagination.ParsePageRequest in a pagination-heavy package.

Removed deprecation shim: burrow.RenderTemplate

burrow.RenderTemplate (deprecated since v0.21, //go:fix inline to burrow.Render) was dropped from the root wrapper layer. No in-tree callers — only stale doc comments referenced it. If your app still calls it, switch to burrow.Render:

// Before (v0.21–v0.23 deprecated)
return burrow.RenderTemplate(w, r, http.StatusOK, "myapp/home", data)

// After (v0.24)
return burrow.Render(w, r, http.StatusOK, "myapp/home", data)

The web.RenderTemplate shim is still present in the sub-package for one more release window; the root wrapper is gone now.

Config.ResolvedTLSMode is now public

Config.resolvedTLSMode (lowercase) was promoted to Config.ResolvedTLSMode. This was an internal helper that tls.go relied on; since tls.go now lives in burrow/server and Config lives in burrow/app, the method had to cross the package boundary. The behaviour is unchanged. App code rarely touches it — Config.ValidateTLS and Config.ResolveBaseURL are the user-facing methods.