INNER CODE UNIT · Go
InstallPlugin
go-chassis/go-chassis · bootstrap/bootstrap.go:31
func InstallPlugin(name string, plugin Plugin) {
bootstrapPlugins = append(bootstrapPlugins, &PluginItem{
Name: name,
Plugin: plugin,
})
}
// Bootstrap will boot plugins in orders
func Bootstrap() {
for _, bp := range bootstrapPlugins {
openlog.Info("Bootstrap " + bp.Name)
if err := bp.Plugin.Init(); err != nil {
openlog.Error(fmt.Sprintf("Failed to init %s. error [%s]", bp.Name, err.Error()))
}
}
}