add core plugins thru store (#43085)

This commit is contained in:
Will Browne
2021-12-14 15:22:40 +01:00
committed by GitHub
parent 5d18834deb
commit e4ba5f17dd
23 changed files with 139 additions and 95 deletions
+5 -6
View File
@@ -18,11 +18,15 @@ type Store interface {
Plugins(ctx context.Context, pluginTypes ...Type) []PluginDTO
// Add adds a plugin to the store.
Add(ctx context.Context, pluginID, version string, opts AddOpts) error
Add(ctx context.Context, pluginID, version string) error
// AddWithFactory adds a plugin to the store.
AddWithFactory(ctx context.Context, pluginID string, factory backendplugin.PluginFactoryFunc, resolver PluginPathResolver) error
// Remove removes a plugin from the store.
Remove(ctx context.Context, pluginID string) error
}
type PluginPathResolver func() (string, error)
type AddOpts struct {
PluginInstallDir, PluginZipURL, PluginRepoURL string
}
@@ -66,11 +70,6 @@ type RendererManager interface {
Renderer() *Plugin
}
type CoreBackendRegistrar interface {
// LoadAndRegister loads and registers a Core backend plugin
LoadAndRegister(pluginID string, factory backendplugin.PluginFactoryFunc) error
}
type StaticRouteResolver interface {
Routes() []*StaticRoute
}