From 8c03e584c182218c84bebc8af23c70fb0cd203d4 Mon Sep 17 00:00:00 2001 From: Shobhit Gupta Date: Wed, 3 Oct 2018 13:04:37 -0700 Subject: 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 --- app/plugin_key_value_store.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/plugin_key_value_store.go') 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 +} -- cgit v1.2.3-1-g7c22