Skip to content

Releases: guregu/kami

Go 1.9 support

25 Aug 15:23
Compare
Choose a tag to compare

This release fixes bugs introduced by type aliases in Go 1.9

Cancel contexts automatically

07 Oct 11:17
Compare
Choose a tag to compare

The net/http package in the standard library cancels every request's context after it has finished. kami doesn't do this by default for backwards compatibility reasons. Now you can set kami.Cancel (or mux.Cancel) to true to enable behavior like the standard library that cancels contexts automatically.

SetParam

10 Sep 18:43
Compare
Choose a tag to compare

Added kami.SetParam, this lets you change params you retrieve from kami.Param.

Params were never intended to be mutable, but this allows you to test handlers without running them through kami (see: #26).

If you use this in middleware or a request, it might have unintended consequences. Also, it isn't concurrency-safe. Please use it for setting up contexts for tests only.

I have experimented with making SetParam safe (safe-params branch) but it makes paths with lots of params slower and increases allocations.

If you have a use case for this, open an issue. However, I think it's a bad idea to mutate the params outside of testing.

Multiple wildcard middlewares

08 Sep 10:46
Compare
Choose a tag to compare

No longer are you restricted to one wildcard middleware/afterware per path.

More middleware types

24 Aug 09:11
Compare
Choose a tag to compare

You can use shorter function signatures like func(http.ResponseWriter, *http.Request) context.Context as middleware now.

Standard context!

23 Aug 20:54
Compare
Choose a tag to compare
  • Supports the standard context package.
  • Remains backwards compatible with the x/net/context package.
  • Middleware will change your *http.Request's context and you can use vanilla http.Handler's for read-only middleware.

Somewhat breaking changes in a couple type signatures (LogHandler, ContextHandler, Middleware, Afterware).

Serve methods for Mux

20 May 16:41
Compare
Choose a tag to compare

Adds the equivalent of kami.Serve() and similar methods to *kami.Mux.

gopkg.in fix

18 Feb 17:10
Compare
Choose a tag to compare

Internal packages don't play well when multiple import paths are acceptable, so I moved some stuff around.

httptreemux

12 Feb 23:58
Compare
Choose a tag to compare

This release replaces httprouter with httptreemux, but maintains the same API.
The routing rules have been significantly relaxed as a result, see Routing Rules.

Afterware

11 Sep 23:02
Compare
Choose a tag to compare

This release introduces afterware (#13), which is like a mirrored version of middleware that runs after the request handler.

Also, serving was made a little easier with the addition of kami.ServeTLS(*tls.Config) and kami.ServeListener(net.Listener).