datasources: change to optimisic concurrency

prerequisite for #9504
This commit is contained in:
bergquist
2017-10-23 07:55:16 +02:00
parent 48f384dcf1
commit 89923bf77a
8 changed files with 196 additions and 72 deletions
+8 -5
View File
@@ -25,8 +25,9 @@ const (
// Typed errors
var (
ErrDataSourceNotFound = errors.New("Data source not found")
ErrDataSourceNameExists = errors.New("Data source with same name already exists")
ErrDataSourceNotFound = errors.New("Data source not found")
ErrDataSourceNameExists = errors.New("Data source with same name already exists")
ErrDataSouceUpdatingOldVersion = errors.New("Trying to update old version of datasouce")
)
type DsAccess string
@@ -131,10 +132,12 @@ type UpdateDataSourceCommand struct {
IsDefault bool `json:"isDefault"`
JsonData *simplejson.Json `json:"jsonData"`
SecureJsonData map[string]string `json:"secureJsonData"`
Version int `json:"version"`
OrgId int64 `json:"-"`
Id int64 `json:"-"`
Version int `json:"-"`
OrgId int64 `json:"-"`
Id int64 `json:"-"`
Result *DataSource
}
type DeleteDataSourceByIdCommand struct {