MCPcopy Create free account
hub / github.com/devfeel/dotweb / initPlugins

Method initPlugins

dotweb.go:516–532  ·  view source on GitHub ↗

initPlugins init and run plugins

()

Source from the content-addressed store, hash-verified

514
515// initPlugins init and run plugins
516func (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
535func (app *DotWeb) initBindMiddleware() {

Callers 1

ListenAndServeMethod · 0.95

Calls 7

LoggerMethod · 0.95
CatchErrorFunction · 0.92
IsValidateMethod · 0.65
ErrorMethod · 0.65
NameMethod · 0.65
RunMethod · 0.65
DebugMethod · 0.65

Tested by

no test coverage detected