alice icon indicating copy to clipboard operation
alice copied to clipboard

Provide http.HandlerFunc alternative for middleware?

Open samherrmann opened this issue 9 years ago • 0 comments

After playing around with alice for a bit, I was wondering, might it be a good idea to provide a Constructor alternative whose signature is func(http.HandlerFunc) http.HandlerFunc? All my middleware are just handler functions, and so I have to do http.HandlerFunc(myMiddlewareFunc) before passing them into alice. This is not a big deal, but since there is also a .ThenFunc alternative to the .Then function to pass in the final handler, I was wondering if there is a reason not to provide the same flexibility for the middleware? I am not sure though what a good name for that alternative Constructor type would be since ConstructorFunc doesn't feel right to me.

samherrmann avatar Feb 22 '16 16:02 samherrmann