diff options
Diffstat (limited to 'plugins/informer/plugin.go')
-rw-r--r-- | plugins/informer/plugin.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/informer/plugin.go b/plugins/informer/plugin.go index 98081d34..3d219cda 100644 --- a/plugins/informer/plugin.go +++ b/plugins/informer/plugin.go @@ -11,6 +11,7 @@ const PluginName = "informer" type Plugin struct { registry map[string]Informer + plugins map[string]Lister log logger.Logger } @@ -31,19 +32,24 @@ func (p *Plugin) Workers(name string) ([]process.State, error) { return svc.Workers(), nil } -// CollectTarget resettable service. -func (p *Plugin) CollectTarget(name endure.Named, r Informer) error { - p.registry[name.Name()] = r - return nil -} - // Collects declares services to be collected. func (p *Plugin) Collects() []interface{} { return []interface{}{ - p.CollectTarget, + p.CollectWorkers, } } +// CollectPlugins collects all RR plugins +func (p *Plugin) CollectPlugins(name endure.Named, l Lister) { + p.plugins[name.Name()] = l +} + +// CollectWorkers obtains plugins with workers inside. +func (p *Plugin) CollectWorkers(name endure.Named, r Informer) error { + p.registry[name.Name()] = r + return nil +} + // Name of the service. func (p *Plugin) Name() string { return PluginName |