mitchellh / go-server-timing

Go (golang) library for creating and consuming HTTP Server-Timing headers
https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc
MIT License
862 stars 38 forks source link

Extract handler to standalone for easier usage in libraries #22

Open deefdragon opened 3 years ago

deefdragon commented 3 years ago

Because the handler is currently entirely inside the middleware, it is very difficult to fine tune it (such as enabling/disabling it), and takes a reasonably large work around when used with a library like echo or gin.

Please put the handler into a standalone function so that it can be called manually from whatever library a user chooses/ in a more flexible manner in general.