2016-09-08 00:01:10 +00:00
|
|
|
// +build !experimental
|
2016-08-26 17:02:38 +00:00
|
|
|
|
|
|
|
package store
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/pkg/plugins"
|
2016-09-08 00:01:10 +00:00
|
|
|
"github.com/docker/docker/plugin/getter"
|
2016-08-26 17:02:38 +00:00
|
|
|
)
|
|
|
|
|
2016-09-08 00:01:10 +00:00
|
|
|
// GetAllByCap returns a list of plugins matching the given capability.
|
|
|
|
func (ps Store) GetAllByCap(capability string) ([]getter.CompatPlugin, error) {
|
|
|
|
pl, err := plugins.GetAll(capability)
|
2016-08-26 17:02:38 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2016-09-08 00:01:10 +00:00
|
|
|
result := make([]getter.CompatPlugin, len(pl))
|
|
|
|
for i, p := range pl {
|
|
|
|
result[i] = p
|
2016-08-26 17:02:38 +00:00
|
|
|
}
|
|
|
|
return result, nil
|
|
|
|
}
|
2016-09-06 21:30:55 +00:00
|
|
|
|
2016-09-08 00:01:10 +00:00
|
|
|
// Get returns a plugin matching the given name and capability.
|
|
|
|
func (ps Store) Get(name, capability string, _ int) (getter.CompatPlugin, error) {
|
|
|
|
return plugins.Get(name, capability)
|
2016-09-06 21:30:55 +00:00
|
|
|
}
|