You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to wrap your library in an additional abstraction library of my own design. The intention is to create convenience functions to create REST services. This may be more of a Go question than anything, but I have tracked the problem down to your validation code when adding handlers (isValidHandler).
So that all of my libraries that create handlers aren't required to include your library as well as my new one, I have created a set of types to accommodate your signatures:
type PathHandler func(rw WebWriter, req *WebRequest)
type WebWriter web.ResponseWriter
type WebRequest web.Request
In this manner, my functions can adhere to this type PathHandler
Hi Folks,
I'm attempting to wrap your library in an additional abstraction library of my own design. The intention is to create convenience functions to create REST services. This may be more of a Go question than anything, but I have tracked the problem down to your validation code when adding handlers (
isValidHandler
).Your functions require the following signature:
func YourFunctionName(rw web.ResponseWriter, req *web.Request)
So that all of my libraries that create handlers aren't required to include your library as well as my new one, I have created a set of types to accommodate your signatures:
In this manner, my functions can adhere to this type
PathHandler
The code panics when trying to add the handler via
router.Get()
etc., as theisValidHandler
function rejects the types I have created.Is there any way to accomplish this, or do you have a function type that I may have missed that I can use to abstract your library?
Thanks.
The text was updated successfully, but these errors were encountered: