Go Playground Pure Versions Save

:non-potable_water: Is a lightweight HTTP router that sticks to the std "net/http" implementation

v4.1.1

6 years ago

What was fixed?

  • Corrected bug in Group logic whereby the top level middleware was being copied, rather than the RouteGroup's middleware (which may be the top level also and why it wasn't found until now); it only became apparent will multiple levels of Grouping.

v4.1.0

7 years ago

What was added?

  • Added DecodeSEOQueryParams(...) function to allow only the SEO params to be decoded.
  • Cleaned up some spelling
  • Cleaned up a few inefassign
  • Change to Travis CI from Semaphore

v4.0.1

7 years ago

What was fixed?

  • Corrected README documentation to reflect the new Group functionality introduced in Release 4.0.0

v4.0.0

7 years ago

What Changed?

  • It used to be that the Group function handled 3 different scenarios:
  • .Group("/users") - group with existing middleware
  • .Group("/users", nil) - group but retain no middleware
  • .Group("/users", MoreMiddleware) - group, retain existing and add MoreMiddleware

This was confusing and even I was always referring to the function to remember what it all did so here is how it works now.

  1. .Group("/users") - group with existing middleware
  2. .GroupWithNone("/users") - group but retain no middleware.
  3. .GroupWithMore("/users", MoreMiddleware) - group, retain existing and add MoreMiddleware

v3.1.1

7 years ago

What was fixed?

Unexposed Param + Params type; it was not exposed nor able to be used outside of package

v3.1.0

7 years ago

What was added?

  • Add/separate DecodeJSON, DecodeXML, DecodeForm and DecodeMultipartForm functions into the helper functions for when you already know the Content-Type

v3.0.1

7 years ago

What was fixed?

corrected README documentation regarding URL param extraction.

rv := pure.RequestVars(r)

rv.URLParam("id")

v3.0.0

7 years ago

What changed?

  • removed QueryParams function from RequestVars, storing a single copy if requested multiple times really wasn't much faster because of the context.Context lookup time so removed.

What was added?

  • added DecodeQueryParams(...) function to explicitly decode url.Values only if desired
  • added QueryParams(...) function to allow retrieving of r.URL.Query() values and optionally SEO params.
  • updated Decode(...) so the the includeQueryParams flags also applies to JSON and XML

v2.6.0

7 years ago

What's new

  • reconfigured pure's serveHTTP function to only incur the overhead of request vars, when one is found in the route itself, which increases performance for non parameter/static routes like those used in an API vs SEO website.

benchmark                      old ns/op     new ns/op     delta
BenchmarkPure_Param            157           161           +2.55%
BenchmarkPure_Param5           208           205           -1.44%
BenchmarkPure_Param20          350           356           +1.71%
BenchmarkPure_ParamWrite       221           215           -2.71%
BenchmarkPure_GithubStatic     72.6          47.1          -35.12%
BenchmarkPure_GithubParam      230           227           -1.30%
BenchmarkPure_GithubAll        43054         42284         -1.79%
BenchmarkPure_GPlusStatic      54.0          31.7          -41.30%
BenchmarkPure_GPlusParam       182           178           -2.20%
BenchmarkPure_GPlus2Params     207           193           -6.76%
BenchmarkPure_GPlusAll         2297          2159          -6.01%
BenchmarkPure_ParseStatic      56.2          30.9          -45.02%
BenchmarkPure_ParseParam       166           159           -4.22%
BenchmarkPure_Parse2Params     180           174           -3.33%
BenchmarkPure_ParseAll         3671          3290          -10.38%
BenchmarkPure_StaticAll        14646         9964          -31.97%

benchmark                      old allocs     new allocs     delta
BenchmarkPure_Param            1              1              +0.00%
BenchmarkPure_Param5           1              1              +0.00%
BenchmarkPure_Param20          1              1              +0.00%
BenchmarkPure_ParamWrite       1              1              +0.00%
BenchmarkPure_GithubStatic     0              0              +0.00%
BenchmarkPure_GithubParam      1              1              +0.00%
BenchmarkPure_GithubAll        167            167            +0.00%
BenchmarkPure_GPlusStatic      0              0              +0.00%
BenchmarkPure_GPlusParam       1              1              +0.00%
BenchmarkPure_GPlus2Params     1              1              +0.00%
BenchmarkPure_GPlusAll         11             11             +0.00%
BenchmarkPure_ParseStatic      0              0              +0.00%
BenchmarkPure_ParseParam       1              1              +0.00%
BenchmarkPure_Parse2Params     1              1              +0.00%
BenchmarkPure_ParseAll         16             16             +0.00%
BenchmarkPure_StaticAll        0              0              +0.00%

benchmark                      old bytes     new bytes     delta
BenchmarkPure_Param            240           240           +0.00%
BenchmarkPure_Param5           240           240           +0.00%
BenchmarkPure_Param20          240           240           +0.00%
BenchmarkPure_ParamWrite       240           240           +0.00%
BenchmarkPure_GithubStatic     0             0             +0.00%
BenchmarkPure_GithubParam      240           240           +0.00%
BenchmarkPure_GithubAll        40082         40082         +0.00%
BenchmarkPure_GPlusStatic      0             0             +0.00%
BenchmarkPure_GPlusParam       240           240           +0.00%
BenchmarkPure_GPlus2Params     240           240           +0.00%
BenchmarkPure_GPlusAll         2640          2640          +0.00%
BenchmarkPure_ParseStatic      0             0             +0.00%
BenchmarkPure_ParseParam       240           240           +0.00%
BenchmarkPure_Parse2Params     240           240           +0.00%
BenchmarkPure_ParseAll         3840          3840          +0.00%
BenchmarkPure_StaticAll        0             0             +0.00%

v2.5.0

7 years ago

What was added?

nothing really, just updated the logging middleware example to use new ansi library to reduce code duplication.