Skip to content

Zinc

Zinc 0.2.1 available now!

Fast Go APIs.
Still net/http.

Routing, binding, errors, and middleware on top of the HTTP stack you already know. Zinc stays small enough to get out of the way.

main.goGo
package main

import (
    "log"

    "github.com/0mjs/zinc"
)

func main() {
    app := zinc.New()

    app.Get("/", func(c *zinc.Context) error {
        return c.JSON(zinc.Map{
            "message": "Hello from Zinc!",
        })
    })

    log.Fatal(app.Listen(":8080"))
}
$

HTTP/1.1 200 OK

Content-Type: application/json; charset=utf-8

{"message":"Hello from Zinc!"}
WHAT ZINC ADDS

Application code without the ceremony.

Zinc fills the practical gaps above the standard library. Nothing underneath is replaced.

01

Write the common path quickly.

Concise routes, groups, binding, response helpers, and one central place for errors.

app.Get("/users/{id}", showUser)
02

Keep standard Go within reach.

A Zinc app is an http.Handler. The original request and response writer stay available.

server.Handler = app
03

Bring the ecosystem with you.

Mount existing handlers and wrap the application with ordinary HTTP middleware.

app.HandleHTTP(pattern, handler)
ONE HTTP STACK

Zinc is the thin layer—not another engine.

Own your server configuration, use Go-style brace routes, and move between Zinc and standard handlers without adapters.

See net/http interoperability
LAYEROWNSCONTRACT
Applicationbusiness logic · packagesyour code
Zincrouting · binding · errorshttp.Handler
net/httprequest · writer · serverstandard library
NATIVE BY DESIGN

Mix framework and standard handlers.

Choose the shortest API for your own code. Keep third-party and standard-library integrations standard.

ZINC HANDLER
app.Get("/users/{id}", func(c *zinc.Context) error {
  return c.String(c.Param("id"))
})
+
STANDARD HANDLER
app.HandleHTTP(
  "GET /metrics",
  promhttp.Handler(),
)
=
ONE APPLICATION
server := &http.Server{
  Addr:    ":8080",
  Handler: app,
}
log.Fatal(server.ListenAndServe())
29DOCUMENTED
MIDDLEWARE
MIDDLEWARE + INTEGRATIONS

Production pieces, ready to compose.

Browse all middleware
PROTECTBasic Auth · Casbin · CORS · CSRF · Header Guards · JWT · Key Auth · Secure · Session09
OBSERVEBody Dump · Jaeger · OpenTelemetry · Pprof · Prometheus · Request ID · Request Logger07
CONTROLBody Limit · Context Timeout · Rate Limiter · Recover · Utility05
TRANSPORTDecompress · Gzip · Method Override · Proxy · Redirect · Rewrite · Static · Trailing Slash08
62/ 77
MEASURED PERFORMANCE

Fast where applications actually route.

On the latest published comparison, Zinc recorded the lowest latency in 62 of 77 comparable benchmarks against Gin, Echo, and Chi.

Read the benchmark report
CHOOSE A PATH

Start where your code is.

Build something new or introduce Zinc to an existing Go service without changing the rest of your stack.