Instance returns an instance with the given ID.
(pluginID uint)
| 165 | |
| 166 | // Instance returns an instance with the given ID. |
| 167 | func (m *Manager) Instance(pluginID uint) (compat.PluginInstance, error) { |
| 168 | m.mutex.RLock() |
| 169 | defer m.mutex.RUnlock() |
| 170 | |
| 171 | if instance, ok := m.instances[pluginID]; ok { |
| 172 | return instance, nil |
| 173 | } |
| 174 | return nil, errors.New("instance not found") |
| 175 | } |
| 176 | |
| 177 | // HasInstance returns whether the given plugin ID has a corresponding instance. |
| 178 | func (m *Manager) HasInstance(pluginID uint) bool { |
no outgoing calls