MM-14246 - Plugin framework: support transactional semantics with KV Store (#10634)

* MM-14246 - Plugin framework: support transactional semantics with KV Store

Rename old, new variable names

Moving New function to the bottom

* Made CompareAndUpdate sync, updated tests

* Removed going through channel in CompareAndSetPluginKey

* Inserting new key when oldValue is nil to KVCompareAndSet

* Updated error text to include CompareAndSet
Этот коммит содержится в:
Ali F
2019-04-23 13:35:17 -04:00
коммит произвёл Christopher Speller
родитель 446c6d452e
Коммит 6f8577b4c1
10 изменённых файлов: 311 добавлений и 0 удалений

Просмотреть файл

@@ -13,6 +13,29 @@ type PluginStore struct {
mock.Mock
}
// CompareAndSet provides a mock function with given fields: keyVal, oldValue
func (_m *PluginStore) CompareAndSet(keyVal *model.PluginKeyValue, oldValue []byte) (bool, *model.AppError) {
ret := _m.Called(keyVal, oldValue)
var r0 bool
if rf, ok := ret.Get(0).(func(*model.PluginKeyValue, []byte) bool); ok {
r0 = rf(keyVal, oldValue)
} else {
r0 = ret.Get(0).(bool)
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(*model.PluginKeyValue, []byte) *model.AppError); ok {
r1 = rf(keyVal, oldValue)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}
// Delete provides a mock function with given fields: pluginId, key
func (_m *PluginStore) Delete(pluginId string, key string) store.StoreChannel {
ret := _m.Called(pluginId, key)