Skip to content

hanzoai/zip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zip

Canonical Hanzo Go web framework. Sinatra-style API built on Fiber v3 / fasthttp. The ONE Go web framework — no .Fast escape hatch.

Status License

Quick start

go get github.com/hanzoai/zip
package main

import "github.com/hanzoai/zip"

func main() {
    app := zip.New()
    app.Get("/", func(c zip.Ctx) error {
        return c.SendString("hello world!")
    })
    app.Listen(":1337")
}

What this is

zip is the canonical web framework every Hanzo Go service uses (iam, kms, gateway, commerce, base, cloud, ...). Built on Fiber v3 over fasthttp. Sinatra/Express-style primary API for fast prototyping, fasthttp-grade throughput in production.

Specs

Implements:

  • HIP-0106 Unified Cloud Binary (web framework section)

Used by every subsystem listed in HIP-0106.

Architecture

   your handler  ->  zip.App  ->  Fiber v3  ->  fasthttp  ->  net.Listener
                       |
                       +--  middlewares: identity strip/mint, JWT, CORS, rate-limit
                       +--  mount points for cloud subsystems (Mount(app, deps))

Zero parallel frameworks. No alternate Fast API. Same handler shape works in standalone services and inside the unified hanzoai/cloud binary.


zip

A zippy web micro-framework. Just a tiny bit of sugar for Go's excellent net/http package. Inspired by bottle, express, web.go, etc.

Install

Zip can be installed with go get:

$ go get zeekay.io/zip

Usage

A simple hello world web app looks like this:

package main

import "zeekay.io/zip"

func main() {
    zip.Get("/", func(req zip.Req, res zip.Res) {
        res.End("hello world!")
    })

    // Run and listen on port 1337.
    zip.Run(":1337")
}

You can run the server with go run:

$ go run hello.go

Examples

There are a few examples in examples/ for you to play with:

About

Hanzo's canonical Go web framework. Implementation of the Hanzo Improvement Proposals (HIPs). ZAP-typed handlers, luxfi/log, multi-language extension runtimes via HIP-0105.

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 100.0%