-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integrate with go-restful #23
Comments
seamless integration with go-restful would be awesome! |
@bokunodev thanks for the suggestion, i'll look into it :) |
the implementation is really straight forward, i think. since go-restful expose |
Thanks again @bokunodev, I'm so sorry that I'm busy these days and late to respond, but I think httpin-go-restful-adapter is a good idea and it's also an intuitive solution IMO. I'm very glad that you'd like to contribute to it, most welcome :) |
Hi @bokunodev, I know you are working on something about integrating httpin with go-restful. After some research, I find it will be much more helpful to make go-restful be able to easily adopt existing http middleware handlers. I have made a pull request to go-restful. I'm not sure if it can be merged to their source. But I'm glad to keep you posted about my work. |
hi, sorry for not submitting the pr as promised. i got a little bit busy. |
Hi @bokunodev, since the PR mentioned above has been merged to go-restful and here I'd like to recommend using httpin by converting Here's a demo to showcase this in an intuitive way: type ListUsersInput struct { ... }
ws := new(WebService)
ws.Route(ws.GET("/users").Filter(
restful.HttpMiddlewareHandlerToFilter(httpin.NewInput(ListUsersInput{})),
).To(handleListUsers))
func handleListUsers(request *restful.Request, response *restful.Response) {
input := request.Request.Context().Value(httpin.Input).(*ListUsersInput)
// ...
} I hope this would help you :) |
any suggestions?
The text was updated successfully, but these errors were encountered: