Sketch: Registry plugins

Also, the path you expose at may change based on version of the api, so at least one part of the static initialization has to be controlled at the level of the consumer (I choose to expose plugin X into api version Y as name Z)


> 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.
>