initPlugins init and run plugins
()
| 514 | |
| 515 | // initPlugins init and run plugins |
| 516 | func (app *DotWeb) initPlugins() { |
| 517 | for _, p := range app.pluginMap { |
| 518 | if p.IsValidate() { |
| 519 | go func(p Plugin) { |
| 520 | defer func() { |
| 521 | if err := recover(); err != nil { |
| 522 | app.Logger().Error(exception.CatchError("DotWeb::initPlugins run error plugin - "+p.Name(), "", err), LogTarget_HttpServer) |
| 523 | } |
| 524 | }() |
| 525 | p.Run() |
| 526 | }(p) |
| 527 | app.Logger().Debug("DotWeb initPlugins start run plugin - "+p.Name(), LogTarget_HttpServer) |
| 528 | } else { |
| 529 | app.Logger().Debug("DotWeb initPlugins not validate plugin - "+p.Name(), LogTarget_HttpServer) |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | // init bind app's middleware to router node |
| 535 | func (app *DotWeb) initBindMiddleware() { |
no test coverage detected