github.com/naoina/kocha@v0.7.1-0.20171129072645-78c7a531f799/cmd/kocha-generate/kocha-generate-controller/skeleton/controller/controller.go.tmpl (about) 1 package controller 2 3 import ( 4 "github.com/naoina/kocha" 5 ) 6 7 type {{.Name}} struct { 8 *kocha.DefaultController 9 } 10 11 func ({{.Receiver}} *{{.Name}}) GET(c *kocha.Context) error { 12 // FIXME: auto-generated by kocha 13 return c.Render(map[string]interface{}{ 14 "ControllerName": "{{.Name}}", 15 }) 16 } 17 18 func ({{.Receiver}} *{{.Name}}) POST(c *kocha.Context) error { 19 // FIXME: auto-generated by kocha 20 return c.Render(map[string]interface{}{ 21 "ControllerName": "{{.Name}}", 22 }) 23 }