Move QueryData method into backend plugin manager which HandleRequest uses to
query data from plugin SDK supported data sources. This allowed us to remove a lot
of code no longer needed.
Ref #21510
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
(cherry picked from commit b3e9087557)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
co-authored by
Marcus Efraimsson
parent
57060a2276
commit
5fe040d26b
@@ -30,9 +30,7 @@ func (r *RendererPlugin) Load(decoder *json.Decoder, base *PluginBase,
|
||||
|
||||
cmd := ComposePluginStartCommand("plugin_start")
|
||||
fullpath := filepath.Join(base.PluginDir, cmd)
|
||||
factory := grpcplugin.NewRendererPlugin(r.Id, fullpath, grpcplugin.PluginStartFuncs{
|
||||
OnStart: r.onPluginStart,
|
||||
})
|
||||
factory := grpcplugin.NewRendererPlugin(r.Id, fullpath, r.onPluginStart)
|
||||
if err := backendPluginManager.Register(r.Id, factory); err != nil {
|
||||
return nil, errutil.Wrapf(err, "failed to register backend plugin")
|
||||
}
|
||||
@@ -48,7 +46,7 @@ func (r *RendererPlugin) Start(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *RendererPlugin) onPluginStart(pluginID string, client *grpcplugin.Client, logger log.Logger) error {
|
||||
r.GrpcPluginV2 = client.RendererPlugin
|
||||
func (r *RendererPlugin) onPluginStart(pluginID string, renderer pluginextensionv2.RendererPlugin, logger log.Logger) error {
|
||||
r.GrpcPluginV2 = renderer
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user