🚀 Feature: Add idempotency middleware (v2 backport)#2288
🚀 Feature: Add idempotency middleware (v2 backport)#2288ReneWerner87 merged 2 commits intogofiber:masterfrom
Conversation
* middleware: add idempotency middleware * middleware/idempotency: use fiber.Storage instead of custom storage * middleware/idempotency: only allocate data if really required * middleware/idempotency: marshal response using msgp * middleware/idempotency: add msgp tests * middleware/idempotency: do not export response * middleware/idempotency: disable msgp's -io option to disable generating unused methods * middleware/idempotency: switch to time.Duration based app.Test * middleware/idempotency: only create closure once * middleware/idempotency: add benchmarks * middleware/idempotency: optimize strings.ToLower when making comparison The real "strings.ToLower" still needs to be used when storing the data. * middleware/idempotency: safe-copy body
|
CI is failing for some unrelated data race. |
efectn
left a comment
There was a problem hiding this comment.
OK to me after creating a PR for docs repo
|
@efectn why is this even required? It's a 1:1 copy of the README here, why can't this be automated as follows? # From inside the docs repo:
git clone --depth 1 https://github.com/gofiber/fiber
find fiber/middleware -maxdepth 2 -name 'README.md' -exec bash -c 'MW="$(basename $(dirname {}))" ; cp "{}" "api/middleware/$MW.md"' \;
rm -rf fiber |
|
i will create the docs PR, shortly before the release |
|
Nice! I noticed that the docs in this repo slightly differ from the ones in the |
|
I think there is a reason for this :D |
|
Later, when we are on docusaurus, by the way, the idea is to |
The doc repo for example uses space-indentation for code while this repo uses tabs. There should not be a reason for that ;)
That would be awesome! 🚀 |
Description
Add idempotency middleware.
Implements #2163.
This is a v2 backport of #2253.
Type of change
Please delete options that are not relevant.
Checklist: