1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-15 05:01:01 +00:00

simplify beego

This commit is contained in:
xiemengjun
2012-12-17 22:15:21 +08:00
parent ad892008cc
commit d562687868
4 changed files with 79 additions and 14 deletions

View File

@ -125,3 +125,27 @@ func (app *App) ErrorLog(ctx *Context) {
func (app *App) AccessLog(ctx *Context) {
BeeLogger.Printf("[ACC] host: '%s', request: '%s %s', proto: '%s', ua: %s'', remote: '%s'\n", ctx.Request.Host, ctx.Request.Method, ctx.Request.URL.Path, ctx.Request.Proto, ctx.Request.UserAgent(), ctx.Request.RemoteAddr)
}
func RegisterController(path string, c ControllerInterface) *App {
BeeApp.RegisterController(path, c)
return BeeApp
}
func Filter(filter http.HandlerFunc) *App {
BeeApp.Filter(filter)
return BeeApp
}
func FilterParam(param string, filter http.HandlerFunc) *App {
BeeApp.FilterParam(param, filter)
return BeeApp
}
func FilterPrefixPath(path string, filter http.HandlerFunc) *App {
BeeApp.FilterParam(path, filter)
return BeeApp
}
func Run() {
BeeApp.Run()
}