Documentation
Thirteen sections. Every page has a Markdown companion at the same path with a .md suffix.
-
Configuration
Every field you can set on a MuxMaster *Mux: redirects, 405 handling, path matching, the opt-in pools, custom handlers, and the defaults that New applies.
-
Cookbook
Ready-to-use MuxMaster recipes: versioned REST APIs, central error handling, authentication, JWT, pagination, QUERY endpoints, graceful shutdown, and more.
-
Error handling
Return errors from MuxMaster handlers with HandlerFuncE and HTTPError, customise the ErrorHandler, set 404 and 405 handlers, and recover from panics.
-
Getting started
Build a small REST API with MuxMaster step by step: install the module, register routes, read path parameters, add middleware and groups, and return JSON.
-
Groups
Share a path prefix and middleware across MuxMaster routes: Group, nested groups, Route, With, Mount for sub-routers, and ServeFiles on a group.
-
HTTP QUERY method (RFC 10008)
MuxMaster supports the HTTP QUERY method (RFC 10008), a safe, idempotent method that carries a request body. Learn to register, validate, and call QUERY routes.
-
Maximum performance
Remove per-request allocations in MuxMaster with PoolRequestBundle, PoolFastParams, and HandleFast: the lifetime contract, the audit, and recipes.
-
Middleware
How MuxMaster middleware works: Pre, Use, UseFast, and With, writing custom middleware, and the 21 constructors of the middleware package, Logger to CORS.
-
Migration
Migrate to MuxMaster from gorilla/mux, chi, httprouter, or the net/http ServeMux, with side-by-side route registration and the common adjustments.
-
Observability
Observe a MuxMaster service: access logs with Logger, request correlation with RequestID, Prometheus and OpenTelemetry patterns, health checks, and pprof.
-
Performance
How MuxMaster keeps allocations low, the measured results for v1.3.0, the changes since v1.1.0, and how to run the benchmarks on your own machine.
-
Response helpers
Write a complete HTTP response in one call with MuxMaster's JSON, XML, and Text helpers, use them with HandlerFuncE, or fall back to encoding/json.
-
Routing
How MuxMaster matches requests: static, named, regex, optional, and catch-all patterns, match priority, method helpers including QUERY, and trailing slashes.