Releases: saurabh0719/jett
v0.3.0
Jett v0.3.0 -
What's new?
- New
HTML
renderer for simple and nested templates
func HTML(w http.ResponseWriter, data interface{}, htmlFiles ...string)
Any
route handler - Assigns a HandlerFunc to the GET, HEAD, OPTIONS, POST, PUT, PATCH & DELETE method for the given path. It DOES NOT actually match any random arbitrary method method.
func (r *Router) Any(path string, handlerFn http.HandlerFunc, middleware ...func(http.Handler) http.Handler)
- Middleware returns a slice ([]func(http.Handler) http.Handler) of the middleware stack for the router
func (r *Router) Middleware() []func(http.Handler) http.Handler
-
Heartbeat
middleware - Set up an endpoint to convenientlyping
your server. -
Timeout
middleware - Timeout is a middleware that cancels context after a given timeout -
Extensive comments and Go doc coverage
Breaking change -
TEXT
renderer is nowText
- see the docs for more.
Jett's API and design are now seemingly stable, with no immediate requirements planned for the future. We will enter stable mode soon, with the main focus on adding more tests and documentation + PRs from the community.
v0.3.0
is here! 🚀
v0.2.0
Jett v0.2.0
Middleware -
Some essential middleware are provided out of the box in github.com/saurabh0719/jett/middleware
-
-
RequestID
: Injects a request ID into the context of each
request -
Logger
: Log request paths, methods, status code as well as execution duration -
Recoverer
: Recover and handlepanic
-
NoCache
: Sets a number of HTTP headers to prevent
a router (or subrouter) from being cached by an upstream proxy and/or client -
BasicAuth
: Basic Auth middleware, RFC 2617, Section 2
API mods -
Changed PathParams
to URLParams
and updated the docs.
v0.1.1
Jett, version 0.1.1
Description -
Accept ctx context.Context in Run functions
// Run without context -
func (r *Router) Run(address string, onShutdownFns ...func())
func (r *Router) RunTLS(address, certFile, keyFile string, onShutdownFns ...func())
// Run with context -
// Useful when you need to pass a top-level context. Shutdown process will begin when the parent context cancels.
func (r *Router) RunWithContext(ctx context.Context, address string, onShutdownFns ...func())
func (r *Router) RunTLSWithContext(ctx context.Context, address, certFile, keyFile string, onShutdownFns ...func())
Modified Response writers function names - JSON
, XML
, TEXT
func JSON(w http.ResponseWriter, data interface{}, status int)
func TEXT(w http.ResponseWriter, data string, status int)
func XML(w http.ResponseWriter, data interface{}, status int)
v0.1.0
Jett is an extremely lightweight micro-framework for building Go HTTP services. 🚀
$ go get github.com/saurabh0719/jett
Key Features :
-
Build Robust APIs with minimal abstraction!
-
Add middleware at any level - Root, Subrouter or in a specific route!
-
Built-in development server with support for graceful shutdown with timeout and shutdown functions.
-
Highly Flexible & easily customisable with middleware.
-
Helpful Response writers for JSON, XML and Plain Text.
-
Extremely lightweight. Built on top of HttpRouter.
v0.1.0
🎯
v0.0.2
Release notes
- Middleware can now be added at all levels - Root, Subrouter and a specific Route!
NotFound
helper function added
Note - This is a pre-release
v0.0.1
Full Changelog: https://github.com/saurabh0719/jett/commits/v0.0.1