Go APIs, effortlessly.
Lightweight Go HTTP. Router, logging, OpenAPI, auth - no magic, just Go.
Capabilities
No magic. Just Go.
Everything you need to build production-ready Web APIs.
Radix Tree Router
Per-method radix tree with zero-allocation path params, backtracking, and 405 detection.
Request Binding
Bind JSON, XML, form data, headers, query strings, and path params to typed Go structs.
Middleware
Global, per-route, and group-scoped middleware. Built-in CORS, CSRF, rate-limit, and more.
Validation
Pluggable validator backed by go-playground/validator with optional auto-validation after bind.
OpenAPI
Auto-generated OpenAPI 3.0.3 spec with Swagger UI. Zero cost when unused.
Auth
JWT, Basic, API Key, OAuth2, OIDC — with RBAC and PBAC. Separate package.
Context
Per-request context with typed values, deadline control, and automatic cleanup.
Route Groups
Organize routes with shared prefixes, middleware, and metadata for cleaner APIs.
See it in action
Zero-alloc routing. Plain handlers.
A radix tree router with path params, JSON responses, and middleware — in under 20 lines. No boilerplate, no framework directives.
// new to zen? start here
1package main2 3import (4 "github.com/Pavan-Silva/go-zen"5 "github.com/Pavan-Silva/go-zen/middleware"6)7 8func main() {9 r := zen.New(":8080")10 r.Use(middleware.Recover)11 r.Use(middleware.Logger)12 13 r.GET("/hello", func(c *zen.Ctx) {14 c.String(200, "Hello, World!")15 })16 17 r.GET("/users/:id", func(c *zen.Ctx) {18 id := c.Param("id")19 c.JSON(200, map[string]string{"id": id})20 })21 22 r.Run()23}