Sketch: Registry plugins

Someone has to import the package, and doing that at the highest possible level doesn't require static initializers with the low level packages.  Eg make the static map in your main pkg and register them that way.




> On Nov 25, 2014, at 11:31 AM, Tim Hockin <notifications@github.com> wrote:
> 
> In pkg/registry/plugins.go:
> 
> > +type Plugin interface {
> > +	// Name returns the top-level REST name of this plugin, e.g.
> > +	// "replicationControllers".
> > +	Name() string
> > +
> > +	// Path is the desired path for this plugin within the backing
> > +	// store.
> > +	Path() string
> > +
> > +	// New instantiates the plugin into the provided backing store.
> > +	New(store Store) (apiserver.RESTStorage, error)
> > +}
> > +
> > +// All registered registries.
> > +var pluginsMutex sync.Mutex
> > +var pluginsMap = make(map[string]Plugin)
> Meh, it's pkg-private - how else are you going to do dynamic registration of plugins? Go doesn't let me mess with linker maps, so I can't iterate them on my own.
> 
> —
> Reply to this email directly or view it on GitHub.
>