API Reference¶
Complete API documentation for Marten.
Core Types¶
| Type | Description |
|---|---|
| App | Main application instance |
| Ctx | Request context with helpers |
| Router | HTTP routing |
| Middleware | Built-in middleware |
Quick Reference¶
Creating an App¶
Registering Routes¶
app.GET("/path", handler)
app.POST("/path", handler)
app.PUT("/path/:id", handler)
app.DELETE("/path/:id", handler)
Handler Signature¶
Middleware Signature¶
func middleware(next marten.Handler) marten.Handler {
return func(c *marten.Ctx) error {
// before
err := next(c)
// after
return err
}
}