1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-04 10:00:18 +00:00

add func InsertFilter(pattern string, pos int, filter FilterFunc) *App to replace AddFilter

pos can be const:
    BeforeRouter = iota
    AfterStatic
    BeforeExec
    AfterExec
    FinishRouter
This commit is contained in:
knightmare
2013-11-25 15:59:40 +08:00
parent a0dff9148a
commit 47fc32ba47
3 changed files with 56 additions and 15 deletions

View File

@ -49,6 +49,7 @@ func DelStaticPath(url string) *App {
return BeeApp
}
//!!DEPRECATED!! use InsertFilter
//action has four values:
//BeforRouter
//AfterStatic
@ -59,6 +60,12 @@ func AddFilter(pattern, action string, filter FilterFunc) *App {
return BeeApp
}
func InsertFilter(pattern string, pos int, filter FilterFunc) *App {
BeeApp.InsertFilter(pattern, pos, filter)
return BeeApp
}
func Run() {
//if AppConfigPath not In the conf/app.conf reParse config
if AppConfigPath != path.Join(AppPath, "conf", "app.conf") {