A lightweight web framework for Go
quartzgun is designed to enable speedy development of efficient web sites and APIs in Go. There are no dependencies outside of the standard library except for
bcrypt, and the library is modular – you can use any part of it independently. The router uses the
func(http.Handler) http.Handler middleware pattern so that you can plug and play existing middleware.
There are pre-made
renderers which are designed as plug and play endpoints in your middleware chains. They are used for providing the basic functionality of the route, rendering an HTML template in the case of a normal page, or JSON or XML for API endpoints.
auth system is designed from scratch to provide a modular system where new authentication/authorization backends can be added easily by satisfying the
about the name
Thinking about URL routes reminded me of the tree of light the fictional Quartz Gun emits when fired, so I named the library
A more complete usage guide will be forthcoming, but for now you can check out the quartzgun_test.go file for an overview of how to use it.
Features may be added here at any time as things are in early stages right now:
- router (static service trees, paramaterized routes, and per-method handlers on routes)
- basic renderers (HTML template, JSON, XML)
- top-level wrapper for attaching
UserStorebackends to cookie handler
- POC indental
- Bearer token-based authentication to supplement cookie-baesd auth
- middleware for easing auth flow:
Protected: require login
Authorize: login and redirect
Bunt: logout and redirect
Fortify: setup CSRF protection (use on the form)
Defend: enact CSRF protection (use on the endpoint)
quartzgun is licensed under the MIT license – see the LICENSE file for details but the long and short of it is you can use/modify it for any reason, but give me (and other authors where applicable) credit for writing it.
Send patches to email@example.com using
git format-patch -s HEAD~<however many commits>. The
-s flag ensures that your name makes it into the commit log.