(dotserver *dotweb.HttpServer)
| 81 | } |
| 82 | |
| 83 | func InitModule(dotserver *dotweb.HttpServer) { |
| 84 | dotserver.RegisterModule(&dotweb.HttpModule{ |
| 85 | OnBeginRequest: func(ctx dotweb.Context) { |
| 86 | fmt.Println(time.Now(), "HttpModule BeginRequest1:", ctx.Request().RequestURI) |
| 87 | }, |
| 88 | OnEndRequest: func(ctx dotweb.Context) { |
| 89 | fmt.Println(time.Now(), "HttpModule EndRequest1:", ctx.Request().RequestURI) |
| 90 | }, |
| 91 | }) |
| 92 | |
| 93 | dotserver.RegisterModule(&dotweb.HttpModule{ |
| 94 | OnBeginRequest: func(ctx dotweb.Context) { |
| 95 | fmt.Println(time.Now(), "HttpModule BeginRequest2:", ctx.Request().RequestURI) |
| 96 | }, |
| 97 | }) |
| 98 | dotserver.RegisterModule(&dotweb.HttpModule{ |
| 99 | OnEndRequest: func(ctx dotweb.Context) { |
| 100 | fmt.Println(time.Now(), "HttpModule EndRequest3:", ctx.Request().RequestURI) |
| 101 | }, |
| 102 | }) |
| 103 | } |
| 104 | |
| 105 | type AccessFmtLog struct { |
| 106 | dotweb.BaseMiddleware |
nothing calls this directly
no test coverage detected