take a look at goa and gorma: https://goa.design

goa generates an API from your description DSL, and Gorma generates the 
data access layer. It uses gorm under the scenes so you'll have an easy 
route to migration.

Brian

On Tuesday, December 20, 2016 at 8:46:12 AM UTC-5, Thomas Bellembois wrote:
>
> Hello, 
>
> I have an application that define structures 
>
> type Team struct { 
>      ID   uint   `gorm:"primary_key"` 
>      Name string `json:"Name"` 
> } 
> type MailingList struct { 
>      ID   uint   `gorm:"primary_key"` 
>      Name string `json:"Name"` 
>      Comment string `json:"Comment"` 
> } 
> ... 
>
> and handlers to manage CRUD operations 
>
> func TeamUpdateHandler(w http.ResponseWriter, r *http.Request) 
> func TeamCreateHandler(w http.ResponseWriter, r *http.Request) 
> func TeamDeleteHandler(w http.ResponseWriter, r *http.Request) 
> func TeamReadHandler(w http.ResponseWriter, r *http.Request) 
> func MailingListUpdateHandler(w http.ResponseWriter, r *http.Request) 
> func MailingListCreateHandler(w http.ResponseWriter, r *http.Request) 
> func MailingListDeleteHandler(w http.ResponseWriter, r *http.Request) 
> func MailingListReadHandler(w http.ResponseWriter, r *http.Request) 
>
> Is there a way in Go to define a CRUD-like model with only 4 generic 
> handlers to manage this operations ? 
>
> Regards, 
>
> Thomas 
>
>

-- 
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