-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Breaking change in celeris core
The HandlerFunc type has changed from func(*Context) to func(*Context) error in v1.0.0.
Documentation updates needed
All code examples must use the new signature:
Before:
s.GET("/hello", func(c *celeris.Context) {
c.String(200, "Hello, World!")
})After:
s.GET("/hello", func(c *celeris.Context) error {
return c.String(200, "Hello, World!")
})New features to document
- Error-returning handlers — handlers return
error,c.Next()returnserror HTTPErrortype —celeris.NewHTTPError(code, message)for structured errors- Error handling in middleware —
err := c.Next()to intercept downstream errors - Unhandled error safety net —
*HTTPError→ writes Code+Message; bareerror→ 500 - XML serialization —
c.XML(code, v)response method - Content-type-aware binding —
c.Bind(v)auto-detects JSON/XML from Content-Type - Explicit binding —
c.BindJSON(),c.BindXML() - Content negotiation —
c.Negotiate(),c.Respond()for auto-format selection - Response capture —
c.CaptureResponse(),c.ResponseBody(),c.ResponseContentType() - Route-level middleware —
s.GET("/path", handler).Use(middleware)
Note: ProtoBuf is NOT in core — available via goceleris/middlewares.
Reference
The core doc.go and README.md have already been updated with the new patterns.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels