defs.go 649 B

1234567891011121314151617181920212223242526
  1. package plugin
  2. import (
  3. "sync"
  4. "github.com/docker/docker/pkg/plugins"
  5. "github.com/docker/docker/plugin/v2"
  6. )
  7. // Store manages the plugin inventory in memory and on-disk
  8. type Store struct {
  9. sync.RWMutex
  10. plugins map[string]*v2.Plugin
  11. /* handlers are necessary for transition path of legacy plugins
  12. * to the new model. Legacy plugins use Handle() for registering an
  13. * activation callback.*/
  14. handlers map[string][]func(string, *plugins.Client)
  15. }
  16. // NewStore creates a Store.
  17. func NewStore(libRoot string) *Store {
  18. return &Store{
  19. plugins: make(map[string]*v2.Plugin),
  20. handlers: make(map[string][]func(string, *plugins.Client)),
  21. }
  22. }