LoadPlugin loads a compat plugin, exported to sideload plugins for testing purposes.
(compatPlugin compat.Plugin)
| 255 | |
| 256 | // LoadPlugin loads a compat plugin, exported to sideload plugins for testing purposes. |
| 257 | func (m *Manager) LoadPlugin(compatPlugin compat.Plugin) error { |
| 258 | modulePath := compatPlugin.PluginInfo().ModulePath |
| 259 | if _, ok := m.plugins[modulePath]; ok { |
| 260 | return fmt.Errorf("plugin with module path %s is present at least twice", modulePath) |
| 261 | } |
| 262 | m.plugins[modulePath] = compatPlugin |
| 263 | return nil |
| 264 | } |
| 265 | |
| 266 | // InitializeForUserID initializes all plugin instances for a given user. |
| 267 | func (m *Manager) InitializeForUserID(userID uint) error { |