mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
Chore: Remove datasources from the Store interface (#53515)
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/apikey"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
@@ -21,7 +20,6 @@ type SQLStoreMock struct {
|
||||
LatestUserId int64
|
||||
|
||||
ExpectedUser *user.User
|
||||
ExpectedDatasource *datasources.DataSource
|
||||
ExpectedAlert *models.Alert
|
||||
ExpectedPluginSetting *models.PluginSetting
|
||||
ExpectedDashboards []*models.Dashboard
|
||||
@@ -31,11 +29,9 @@ type SQLStoreMock struct {
|
||||
ExpectedTeamsByUser []*models.TeamDTO
|
||||
ExpectedSearchOrgList []*models.OrgDTO
|
||||
ExpectedSearchUsers models.SearchUserQueryResult
|
||||
ExpectedDatasources []*datasources.DataSource
|
||||
ExpectedOrg *models.Org
|
||||
ExpectedSystemStats *models.SystemStats
|
||||
ExpectedDataSourceStats []*models.DataSourceStats
|
||||
ExpectedDataSources []*datasources.DataSource
|
||||
ExpectedDataSourcesAccessStats []*models.DataSourceAccessStats
|
||||
ExpectedNotifierUsageStats []*models.NotifierUsageStats
|
||||
ExpectedPersistedDashboards models.HitList
|
||||
@@ -374,40 +370,6 @@ func (m *SQLStoreMock) GetDashboards(ctx context.Context, query *models.GetDashb
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m SQLStoreMock) GetDataSource(ctx context.Context, query *datasources.GetDataSourceQuery) error {
|
||||
query.Result = m.ExpectedDatasource
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) GetDataSources(ctx context.Context, query *datasources.GetDataSourcesQuery) error {
|
||||
query.Result = m.ExpectedDataSources
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) GetDataSourcesByType(ctx context.Context, query *datasources.GetDataSourcesByTypeQuery) error {
|
||||
query.Result = m.ExpectedDataSources
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) GetDefaultDataSource(ctx context.Context, query *datasources.GetDefaultDataSourceQuery) error {
|
||||
query.Result = m.ExpectedDatasource
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) DeleteDataSource(ctx context.Context, cmd *datasources.DeleteDataSourceCommand) error {
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) AddDataSource(ctx context.Context, cmd *datasources.AddDataSourceCommand) error {
|
||||
cmd.Result = m.ExpectedDatasource
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) UpdateDataSource(ctx context.Context, cmd *datasources.UpdateDataSourceCommand) error {
|
||||
cmd.Result = m.ExpectedDatasource
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) Migrate(_ bool) error {
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
@@ -70,13 +69,6 @@ type Store interface {
|
||||
GetOrgUsers(ctx context.Context, query *models.GetOrgUsersQuery) error
|
||||
SearchOrgUsers(ctx context.Context, query *models.SearchOrgUsersQuery) error
|
||||
RemoveOrgUser(ctx context.Context, cmd *models.RemoveOrgUserCommand) error
|
||||
GetDataSource(ctx context.Context, query *datasources.GetDataSourceQuery) error
|
||||
GetDataSources(ctx context.Context, query *datasources.GetDataSourcesQuery) error
|
||||
GetDataSourcesByType(ctx context.Context, query *datasources.GetDataSourcesByTypeQuery) error
|
||||
GetDefaultDataSource(ctx context.Context, query *datasources.GetDefaultDataSourceQuery) error
|
||||
DeleteDataSource(ctx context.Context, cmd *datasources.DeleteDataSourceCommand) error
|
||||
AddDataSource(ctx context.Context, cmd *datasources.AddDataSourceCommand) error
|
||||
UpdateDataSource(ctx context.Context, cmd *datasources.UpdateDataSourceCommand) error
|
||||
Migrate(bool) error
|
||||
Sync() error
|
||||
Reset() error
|
||||
|
||||
Reference in New Issue
Block a user