github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/pkg/plugingetter/getter.go (about) 1 package plugingetter 2 3 import "github.com/docker/docker/pkg/plugins" 4 5 const ( 6 // Lookup doesn't update RefCount 7 Lookup = 0 8 // Acquire increments RefCount 9 Acquire = 1 10 // Release decrements RefCount 11 Release = -1 12 ) 13 14 // CompatPlugin is an abstraction to handle both v2(new) and v1(legacy) plugins. 15 type CompatPlugin interface { 16 Client() *plugins.Client 17 Name() string 18 BasePath() string 19 IsV1() bool 20 } 21 22 // CountedPlugin is a plugin which is reference counted. 23 type CountedPlugin interface { 24 Acquire() 25 Release() 26 CompatPlugin 27 } 28 29 // PluginGetter is the interface implemented by Store 30 type PluginGetter interface { 31 Get(name, capability string, mode int) (CompatPlugin, error) 32 GetAllByCap(capability string) ([]CompatPlugin, error) 33 GetAllManagedPluginsByCap(capability string) []CompatPlugin 34 Handle(capability string, callback func(string, *plugins.Client)) 35 }