diff options
author | Shobhit Gupta <smartyshobhit@gmail.com> | 2018-10-03 13:04:37 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-10-03 16:04:37 -0400 |
commit | 8c03e584c182218c84bebc8af23c70fb0cd203d4 (patch) | |
tree | 90cad75d922dc3d9fb25c4456b342b2b4e642d3b /app/plugin_key_value_store.go | |
parent | 7468f35cb0c86b60f66e1c9228a60da244d3fcc4 (diff) | |
download | chat-8c03e584c182218c84bebc8af23c70fb0cd203d4.tar.gz chat-8c03e584c182218c84bebc8af23c70fb0cd203d4.tar.bz2 chat-8c03e584c182218c84bebc8af23c70fb0cd203d4.zip |
MM-11863 Add KVList method (#9467)
* Add KVList method
* Add KVList method
Add KVList method
* Add pagination support
* Change offset, limit to page, perPage
* Rename constant
Diffstat (limited to 'app/plugin_key_value_store.go')
-rw-r--r-- | app/plugin_key_value_store.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/plugin_key_value_store.go b/app/plugin_key_value_store.go index bf2a46004..8c3e1f18b 100644 --- a/app/plugin_key_value_store.go +++ b/app/plugin_key_value_store.go @@ -59,3 +59,14 @@ func (a *App) DeletePluginKey(pluginId string, key string) *model.AppError { return result.Err } + +func (a *App) ListPluginKeys(pluginId string, page, perPage int) ([]string, *model.AppError) { + result := <-a.Srv.Store.Plugin().List(pluginId, page, perPage) + + if result.Err != nil { + mlog.Error(result.Err.Error()) + return nil, result.Err + } + + return result.Data.([]string), nil +} |