Skip to main content

Welcome

Zinc is a Go API framework for developers who want expressive routing and practical helpers without leaving net/http.

It gives you route groups, middleware chains, request binding, response helpers, static files, rendering, route metadata, and first-party middleware while keeping normal Go deployment and testing habits.

go get github.com/0mjs/zinc
package main

import "github.com/0mjs/zinc"

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

app.Get("/", "Hello, World!")

app.Listen()
}

What Zinc is good at

  • API ergonomics: handlers and middleware use one func(*zinc.Context) error shape.
  • Standard library compatibility: mount http.Handler values and keep normal net/http server behavior.
  • Fast request paths: Zinc is built around a compact router and a pooled request context.
  • Practical defaults: common response formats, request binding, error handling, static files, and middleware are first-party.

Mental model

A Zinc app is a request pipeline:

  1. app-level middleware runs
  2. prefix and group middleware run when their route matches
  3. the route handler writes a response or returns an error
  4. Zinc's error handler turns returned errors into responses
app.Post("/posts", requireUser, requireRole("editor"), createPost)

Each item in that chain can call c.Next() to continue, return a response to stop, or return an error for the app error handler.

Where to go next

  • Installation covers module setup and Go version requirements.
  • Quick Start builds a small API in one file.
  • First Route explains params, query values, JSON, and errors in one handler.
  • Routing is the first full guide page once you are ready for groups and named routes.
  • API Reference keeps the method-level details separate from the learning path.