yes, you are right, if i am going to drop http.JSON and http.Response
i am trying to do that, i think it is better to make it small like you have 
said

thanks

On Saturday, January 28, 2017 at 5:50:08 AM UTC+2, Matt Silverlock wrote:
>
> 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 <mrwn...@gmail.com 
> <javascript:>> 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...@googlegroups.com <javascript:>.
>> 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