mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove bus from datasource api (#44987)
* Remove bus from datasource api * Add DatasourcePermissionService and use it in api * Fix wire and rename * Fix import in wire * Fix bug * Rename Service to OSS service * Roll back fix
This commit is contained in:
@@ -28,7 +28,9 @@ type SQLStoreMock struct {
|
||||
ExpectedDashboardSnapshot *models.DashboardSnapshot
|
||||
ExpectedTeamsByUser []*models.TeamDTO
|
||||
ExpectedSearchOrgList []*models.OrgDTO
|
||||
ExpectedError error
|
||||
ExpectedDatasources []*models.DataSource
|
||||
|
||||
ExpectedError error
|
||||
}
|
||||
|
||||
func NewSQLStoreMock() *SQLStoreMock {
|
||||
@@ -483,6 +485,7 @@ func (m *SQLStoreMock) GetDataSource(ctx context.Context, query *models.GetDataS
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) GetDataSources(ctx context.Context, query *models.GetDataSourcesQuery) error {
|
||||
query.Result = m.ExpectedDatasources
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
@@ -499,10 +502,12 @@ func (m *SQLStoreMock) DeleteDataSource(ctx context.Context, cmd *models.DeleteD
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) AddDataSource(ctx context.Context, cmd *models.AddDataSourceCommand) error {
|
||||
cmd.Result = m.ExpectedDatasource
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) UpdateDataSource(ctx context.Context, cmd *models.UpdateDataSourceCommand) error {
|
||||
cmd.Result = m.ExpectedDatasource
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user