This definitely doesn't require you to modify net/http directly.

Just create a library with custom handler types that satisfy the
http.Handler interface. Many existing Go routing libraries & frameworks
will get you 90% of the way there.


On Fri, Jan 27, 2017 at 7:42 PM Marwan abdel moneim <mrwnm...@gmail.com>
wrote:

> i want to do something like this
>
> http.Handler{
>   Action:   "Create new user",
>   Method: "POST",
>   URI:       "/users",
>   Auth:      false,
>   Params: []string{"name:max=100"},
>   Do: func(r *http.Request) http.Response{
>         ......
>         return http.JSON(&user)
>   }}
>
> and do the common tasks like validation and authentication on a top layer
> and could also generate a nice looking html file for the API
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/g9NYQNaBBMA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to