Skip to content

Conversation

@slok
Copy link
Owner

@slok slok commented May 31, 2020

This PR refactors how Middleware service works. Now Middleware is not an interface and doesn't return a Handler.

Middleware struct now has a method called Measure that will receive a Reporter, this instance knows how to return the data required to be measure, this means that every different framework/library will need to implement the Reporter based on the lib/framework request/response implementation.

Apart from this, now the standard middleware http.Handler is under std in the same way the other lib/frameworks work.

This refactor has fixed some implementation issues.

Also, integration tests have been added.

Fixes #31

slok added 13 commits May 27, 2020 19:35
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
…ementations

Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Return to the past API so we don't break all libraries/framework implementations
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Add more requests in integration tests
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
@slok slok merged commit ae1558d into master May 31, 2020
@slok slok deleted the next-v1 branch May 31, 2020 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

example with gin does not work properly

2 participants