forked from gobuffalo/buffalo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.go
More file actions
22 lines (19 loc) · 684 Bytes
/
handler.go
File metadata and controls
22 lines (19 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package buffalo
// Handler is the basis for all of Buffalo. A Handler
// will be given a Context interface that represents the
// give request/response. It is the responsibility of the
// Handler to handle the request/response correctly. This
// could mean rendering a template, JSON, etc... or it could
// mean returning an error.
/*
func (c Context) error {
return c.Render(http.StatusOK, render.String("Hello World!"))
}
func (c Context) error {
return c.Redirect(http.StatusMovedPermanently, "http://github.com/gobuffalo/buffalo")
}
func (c Context) error {
return c.Error(http.StatusUnprocessableEntity, fmt.Errorf("oops!!"))
}
*/
type Handler func(Context) error