interface.go 579 B

12345678910111213141516171819202122232425
  1. package getter
  2. import "github.com/docker/docker/pkg/plugins"
  3. const (
  4. // LOOKUP doesn't update RefCount
  5. LOOKUP = 0
  6. // CREATE increments RefCount
  7. CREATE = 1
  8. // REMOVE decrements RefCount
  9. REMOVE = -1
  10. )
  11. // CompatPlugin is a abstraction to handle both v2(new) and v1(legacy) plugins.
  12. type CompatPlugin interface {
  13. Client() *plugins.Client
  14. Name() string
  15. IsV1() bool
  16. }
  17. // PluginGetter is the interface implemented by Store
  18. type PluginGetter interface {
  19. Get(name, capability string, mode int) (CompatPlugin, error)
  20. GetAllByCap(capability string) ([]CompatPlugin, error)
  21. }