Merge pull request #29665 from mavenugo/getall
Add a GetAll function that returns only managed plugins supported by V2 Upstream-commit: e4512d264741e83e954a19f9ef5e3cb06c5856b6 Component: engine
This commit is contained in:
@@ -30,5 +30,6 @@ type CountedPlugin interface {
|
||||
type PluginGetter interface {
|
||||
Get(name, capability string, mode int) (CompatPlugin, error)
|
||||
GetAllByCap(capability string) ([]CompatPlugin, error)
|
||||
GetAllManagedPluginsByCap(capability string) []CompatPlugin
|
||||
Handle(capability string, callback func(string, *plugins.Client))
|
||||
}
|
||||
|
||||
@@ -206,6 +206,11 @@ func (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlug
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// GetAllManagedPluginsByCap returns a list of managed plugins matching the given capability.
|
||||
func (ps *Store) GetAllManagedPluginsByCap(capability string) []plugingetter.CompatPlugin {
|
||||
return ps.getAllByCap(capability)
|
||||
}
|
||||
|
||||
// GetAllByCap returns a list of enabled plugins matching the given capability.
|
||||
func (ps *Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error) {
|
||||
result := make([]plugingetter.CompatPlugin, 0, 1)
|
||||
|
||||
Reference in New Issue
Block a user