[MM-20353] Change KVSetWithOptions to accept a byte slice (#13213)

* Drop EncodeJSON from PluginKVSetOptions

* Add unit tests for KVSetWithOptions with nil values
Этот коммит содержится в:
Ben Schumacher
2019-12-03 10:46:15 +01:00
коммит произвёл GitHub
родитель 3543fcce6c
Коммит d0d6ce0a70
11 изменённых файлов: 104 добавлений и 161 удалений

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

@@ -758,13 +758,12 @@ type API interface {
KVCompareAndDelete(key string, oldValue []byte) (bool, *model.AppError)
// KVSetWithOptions stores a key-value pair, unique per plugin, according to the given options.
// If options.EncodeJSON is not true, the type of newValue must be of type []byte.
// Returns (false, err) if DB error occurred
// Returns (false, nil) if the value was not set
// Returns (true, nil) if the value was set
//
// Minimum server version: 5.18
KVSetWithOptions(key string, newValue interface{}, options model.PluginKVSetOptions) (bool, *model.AppError)
// Minimum server version: 5.20
KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError)
// KVSet stores a key-value pair with an expiry time, unique per plugin.
//