github.com/olljanat/moby@v1.13.1/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 a 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 }