Commit ab078133 by Arve Knudsen Committed by GitHub

Backend: Remove unused code (#28933)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 7378af0a
...@@ -207,10 +207,6 @@ type GetDataSourcesQuery struct { ...@@ -207,10 +207,6 @@ type GetDataSourcesQuery struct {
Result []*DataSource Result []*DataSource
} }
type GetAllDataSourcesQuery struct {
Result []*DataSource
}
type GetDataSourceByIdQuery struct { type GetDataSourceByIdQuery struct {
Id int64 Id int64
OrgId int64 OrgId int64
......
...@@ -35,7 +35,6 @@ func TestDatasourceAsConfig(t *testing.T) { ...@@ -35,7 +35,6 @@ func TestDatasourceAsConfig(t *testing.T) {
bus.AddHandler("test", mockInsert) bus.AddHandler("test", mockInsert)
bus.AddHandler("test", mockUpdate) bus.AddHandler("test", mockUpdate)
bus.AddHandler("test", mockGet) bus.AddHandler("test", mockGet)
bus.AddHandler("test", mockGetAll)
bus.AddHandler("test", mockGetOrg) bus.AddHandler("test", mockGetOrg)
Convey("apply default values when missing", func() { Convey("apply default values when missing", func() {
...@@ -282,11 +281,6 @@ func mockInsert(cmd *models.AddDataSourceCommand) error { ...@@ -282,11 +281,6 @@ func mockInsert(cmd *models.AddDataSourceCommand) error {
return nil return nil
} }
func mockGetAll(cmd *models.GetAllDataSourcesQuery) error {
cmd.Result = fakeRepo.loadAll
return nil
}
func mockGet(cmd *models.GetDataSourceByNameQuery) error { func mockGet(cmd *models.GetDataSourceByNameQuery) error {
for _, v := range fakeRepo.loadAll { for _, v := range fakeRepo.loadAll {
if cmd.Name == v.Name && cmd.OrgId == v.OrgId { if cmd.Name == v.Name && cmd.OrgId == v.OrgId {
......
...@@ -18,7 +18,6 @@ import ( ...@@ -18,7 +18,6 @@ import (
func init() { func init() {
bus.AddHandler("sql", GetDataSources) bus.AddHandler("sql", GetDataSources)
bus.AddHandler("sql", GetAllDataSources)
bus.AddHandler("sql", AddDataSource) bus.AddHandler("sql", AddDataSource)
bus.AddHandler("sql", DeleteDataSourceById) bus.AddHandler("sql", DeleteDataSourceById)
bus.AddHandler("sql", DeleteDataSourceByName) bus.AddHandler("sql", DeleteDataSourceByName)
...@@ -74,13 +73,6 @@ func GetDataSources(query *models.GetDataSourcesQuery) error { ...@@ -74,13 +73,6 @@ func GetDataSources(query *models.GetDataSourcesQuery) error {
return sess.Find(&query.Result) return sess.Find(&query.Result)
} }
func GetAllDataSources(query *models.GetAllDataSourcesQuery) error {
sess := x.Limit(5000, 0).Asc("name")
query.Result = make([]*models.DataSource, 0)
return sess.Find(&query.Result)
}
func DeleteDataSourceById(cmd *models.DeleteDataSourceByIdCommand) error { func DeleteDataSourceById(cmd *models.DeleteDataSourceByIdCommand) error {
return inTransaction(func(sess *DBSession) error { return inTransaction(func(sess *DBSession) error {
var rawSQL = "DELETE FROM data_source WHERE id=? and org_id=?" var rawSQL = "DELETE FROM data_source WHERE id=? and org_id=?"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment