MCPcopy
hub / github.com/gotify/server / LoadPlugin

Method LoadPlugin

plugin/manager.go:257–264  ·  view source on GitHub ↗

LoadPlugin loads a compat plugin, exported to sideload plugins for testing purposes.

(compatPlugin compat.Plugin)

Source from the content-addressed store, hash-verified

255
256// LoadPlugin loads a compat plugin, exported to sideload plugins for testing purposes.
257func (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.
267func (m *Manager) InitializeForUserID(userID uint) error {

Callers 4

SetupSuiteMethod · 0.95
loadPluginsMethod · 0.95
BeforeTestMethod · 0.80

Calls 2

ErrorfMethod · 0.80
PluginInfoMethod · 0.65

Tested by 3

SetupSuiteMethod · 0.76
BeforeTestMethod · 0.64