github.com/segakazzz/buffalo@v0.16.22-0.20210119082501-1f52048d3feb/handler.go (about) 1 package buffalo 2 3 // Handler is the basis for all of Buffalo. A Handler 4 // will be given a Context interface that represents the 5 // give request/response. It is the responsibility of the 6 // Handler to handle the request/response correctly. This 7 // could mean rendering a template, JSON, etc... or it could 8 // mean returning an error. 9 /* 10 func (c Context) error { 11 return c.Render(http.StatusOK, render.String("Hello World!")) 12 } 13 14 func (c Context) error { 15 return c.Redirect(http.StatusMovedPermanently, "http://github.com/gobuffalo/buffalo") 16 } 17 18 func (c Context) error { 19 return c.Error(http.StatusUnprocessableEntity, fmt.Errorf("oops!!")) 20 } 21 */ 22 type Handler func(Context) error