1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-02 13:13:28 +00:00
Beego/beego/core/controller.go
xiemengjun 446daaea37 modify
2012-03-26 23:18:16 +08:00

19 lines
531 B
Go

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