Plugins: Move store and plugin dto to pluginsintegration (#74655)
move store and plugin dto
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/appcontext"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/tsdb/grafanads"
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ type dsVal struct {
|
||||
|
||||
type dsCache struct {
|
||||
ds datasources.DataSourceService
|
||||
pluginStore plugins.Store
|
||||
pluginStore pluginstore.Store
|
||||
cache map[int64]map[string]*dsVal
|
||||
timestamp time.Time // across all orgIDs
|
||||
mu sync.Mutex
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/services/store/entity"
|
||||
)
|
||||
|
||||
@@ -31,7 +32,7 @@ type EntityReferenceResolver interface {
|
||||
Resolve(ctx context.Context, ref *entity.EntityExternalReference) (ResolutionInfo, error)
|
||||
}
|
||||
|
||||
func ProvideEntityReferenceResolver(ds datasources.DataSourceService, pluginStore plugins.Store) EntityReferenceResolver {
|
||||
func ProvideEntityReferenceResolver(ds datasources.DataSourceService, pluginStore pluginstore.Store) EntityReferenceResolver {
|
||||
return &standardReferenceResolver{
|
||||
pluginStore: pluginStore,
|
||||
ds: dsCache{
|
||||
@@ -42,7 +43,7 @@ func ProvideEntityReferenceResolver(ds datasources.DataSourceService, pluginStor
|
||||
}
|
||||
|
||||
type standardReferenceResolver struct {
|
||||
pluginStore plugins.Store
|
||||
pluginStore pluginstore.Store
|
||||
ds dsCache
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,9 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/appcontext"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/fakes"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
fakeDatasources "github.com/grafana/grafana/pkg/services/datasources/fakes"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/services/store/entity"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
@@ -37,15 +36,15 @@ func TestResolver(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
p1 := plugins.PluginDTO{}
|
||||
p2 := plugins.PluginDTO{}
|
||||
p3 := plugins.PluginDTO{}
|
||||
p1 := pluginstore.Plugin{}
|
||||
p2 := pluginstore.Plugin{}
|
||||
p3 := pluginstore.Plugin{}
|
||||
|
||||
p1.ID = "influx"
|
||||
p2.ID = "heatmap"
|
||||
p3.ID = "xyz"
|
||||
pluginStore := &fakes.FakePluginStore{
|
||||
PluginList: []plugins.PluginDTO{p1, p2, p3},
|
||||
pluginStore := &pluginstore.FakePluginStore{
|
||||
PluginList: []pluginstore.Plugin{p1, p2, p3},
|
||||
}
|
||||
provider := ProvideEntityReferenceResolver(ds, pluginStore)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user