-
Notifications
You must be signed in to change notification settings - Fork 33
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
Extracting parameters from request #51
Comments
Yes. Since SelectPipeline(req *Request) (pipe RequestFilter) has access to the request, you can do any sort of parsing and saving of parameters in the Context on the request. You can see an example here: https://github.com/ngmoco/pat/blob/master/falcore_mux.go#L23 |
If you want to do param parsing, but not routing, you can simply use a RequestFilter. Requests have a Context property you can use to store data you want to be accessible to later staging. For example, parsed query information or authentication state data. |
Thx, not sure I totallyget it.
But I'm missing the "after filter" functionality. |
The ngmoco/pat fork will do restful routes in the same way as your example from drones/routes. The one thing that is a major difference is the signature for a falcore RequestFilter is quite different from the standard library. We wrap the http.Request in a falcore.Request and also return an http.Response rather than using the http.ResponseWriter. It shouldn't be difficult to convert your controllers to use the falcore signature instead. |
Is it possible to extract parameters with the router to pass to a pipeline stage ?
The text was updated successfully, but these errors were encountered: