Plugins: Remove stream handler from plugins DTO (#63812)

remove stream handler from DTO
This commit is contained in:
Will Browne
2023-02-27 18:48:18 +00:00
committed by GitHub
parent 25b3abece9
commit 32aa0ad272
3 changed files with 23 additions and 25 deletions

View File

@@ -74,7 +74,7 @@ type CoreGrafanaScope struct {
}
func ProvideService(plugCtxProvider *plugincontext.Provider, cfg *setting.Cfg, routeRegister routing.RouteRegister,
pluginStore plugins.Store, cacheService *localcache.CacheService,
pluginStore plugins.Store, pluginClient plugins.Client, cacheService *localcache.CacheService,
dataSourceCache datasources.CacheService, sqlStore db.DB, secretsService secrets.Service,
usageStatsService usagestats.Service, queryDataService *query.Service, toggles featuremgmt.FeatureToggles,
accessControl accesscontrol.AccessControl, dashboardService dashboards.DashboardService, annotationsRepo annotations.Repository,
@@ -85,6 +85,7 @@ func ProvideService(plugCtxProvider *plugincontext.Provider, cfg *setting.Cfg, r
PluginContextProvider: plugCtxProvider,
RouteRegister: routeRegister,
pluginStore: pluginStore,
pluginClient: pluginClient,
CacheService: cacheService,
DataSourceCache: dataSourceCache,
SQLStore: sqlStore,
@@ -408,6 +409,7 @@ type GrafanaLive struct {
SQLStore db.DB
SecretsService secrets.Service
pluginStore plugins.Store
pluginClient plugins.Client
queryDataService *query.Service
orgService org.Service
@@ -460,7 +462,7 @@ func (g *GrafanaLive) getStreamPlugin(ctx context.Context, pluginID string) (bac
return nil, fmt.Errorf("plugin not found: %s", pluginID)
}
if plugin.SupportsStreaming() {
return plugin, nil
return g.pluginClient, nil
}
return nil, fmt.Errorf("%s plugin does not implement StreamHandler: %#v", pluginID, plugin)
}