1
0
mirror of https://github.com/astaxie/beego.git synced 2024-10-01 11:31:51 +00:00
Beego/beego/core/controller.go

19 lines
531 B
Go
Raw Normal View History

2012-03-26 15:18:16 +00:00
package beego
// Interface for controller types that handle requests
type Controller interface {
// When implemented, handles the request
HandleRequest(c *Context)
}
// The ControllerFunc type is an adapter to allow the use of
// ordinary functions as goweb handlers. If f is a function
// with the appropriate signature, ControllerFunc(f) is a
// Controller object that calls f.
type ControllerFunc func(*Context)
// HandleRequest calls f(c).
func (f ControllerFunc) HandleRequest(c *Context) {
f(c)
}