github.com/portworx/docker@v1.12.1/plugin/legacy.go (about)

     1  // +build !experimental
     2  
     3  package plugin
     4  
     5  import "github.com/docker/docker/pkg/plugins"
     6  
     7  // FindWithCapability returns a list of plugins matching the given capability.
     8  func FindWithCapability(capability string) ([]Plugin, error) {
     9  	pl, err := plugins.GetAll(capability)
    10  	if err != nil {
    11  		return nil, err
    12  	}
    13  	result := make([]Plugin, len(pl))
    14  	for i, p := range pl {
    15  		result[i] = p
    16  	}
    17  	return result, nil
    18  }
    19  
    20  // LookupWithCapability returns a plugin matching the given name and capability.
    21  func LookupWithCapability(name, capability string) (Plugin, error) {
    22  	return plugins.Get(name, capability)
    23  }