Changelog¶
All notable changes to Marten.
[0.1.2] - 2026-01-14¶
Added¶
OnStart()andOnShutdown()lifecycle hooks for AppLoggerConfig.EnableColorsfor colored terminal outputLoggerConfig.JSONFormatfor JSON-formatted logsRecoverWithConfig()with custom panic handlerRecoverWithHandler()convenience functionRecoverJSONmiddleware for JSON error responsesRateLimitConfig.OnLimitReachedfor custom rate limit responses- CORS wildcard subdomain support (e.g.,
*.example.com) Bind()now supportsapplication/x-www-form-urlencodedBind()now supportsmultipart/form-data
Fixed¶
- Context pool reset now ensures all fields are cleared between requests
Bind()now returns error for empty request bodyBind()now checks Content-Type header before parsing
Changed¶
DefaultLoggerConfig()no longer sets a default Format function
[0.1.1] - 2026-01-10¶
Added¶
HEAD()andOPTIONS()route methods on Router and GroupRoutes()method to list all registered routes for debuggingc.GetHeader()method to read request headersc.Written()method to check if response has been writtenc.HTML()method for HTML responsesc.Blob()method for binary responsesc.Stream()method for streaming responses from io.Readerc.QueryParams()method to get all query parameters as url.ValuesLoggerWithConfig()for configurable logging (custom output, format, skip)NewRateLimiter()withStop()method for proper cleanupX-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-ResetheadersRetry-Afterheader when rate limit exceededSkipoption for RateLimit and Logger middleware- CORS
ExposeHeadersandMaxAgeoptions SetTrailingSlash()for configurable trailing slash handling (Ignore, Redirect, Strict)- Route conflict detection - panics when registering conflicting param routes
Fixed¶
- Router returns 405 Method Not Allowed (with
Allowheader) instead of 404 when path exists but method doesn't match - Timeout middleware goroutine leak
- RateLimit cleanup goroutine now stoppable via
Stop()method - Compress middleware buffer flush issue
- Group middleware slice mutation
- CORS
Vary: Originheader for proper caching - ETag middleware preserves response headers
- BodyLimit handles chunked encoding (ContentLength = -1)
Changed¶
- Timeout middleware checks context cancellation properly
[0.1.0] - 2026-01-08¶
Added¶
- Core routing with radix tree
- Route groups with prefix and middleware
- Path parameters (
:id) and wildcards (*filepath) - Global and route-specific middleware
- Context with JSON/Text responses
- Response helpers:
OK(),Created(),NoContent(),BadRequest(),Unauthorized(),Forbidden(),NotFound(),ServerError() - Typed parameter helpers:
ParamInt(),ParamInt64(),QueryInt(),QueryInt64(),QueryBool() - Request helpers:
ClientIP(),Bearer(),RequestID(),IsJSON(),IsAJAX() - Request-scoped storage:
Set(),Get(),GetString(),GetInt(),GetBool() - Cookie helpers:
Cookie(),SetCookie() - Form helpers:
FormValue(),File() - Convenience types:
marten.M,marten.E() BindValid()for validation- Graceful shutdown with
RunGraceful() - 13 built-in middleware: Logger, Recover, CORS, RateLimit, BasicAuth, Timeout, Secure, BodyLimit, Compress, ETag, RequestID, NoCache