diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-06-25 12:33:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 12:33:13 -0700 |
commit | 1e5c432e1029601a664454388ae366ef69618d62 (patch) | |
tree | cb9e8bfb66640ac3b29c934bb2c3202d25aeb368 /api4/plugin.go | |
parent | ecefa6cdd1e7376046bbec82c1b47f7756fea646 (diff) | |
download | chat-1e5c432e1029601a664454388ae366ef69618d62.tar.gz chat-1e5c432e1029601a664454388ae366ef69618d62.tar.bz2 chat-1e5c432e1029601a664454388ae366ef69618d62.zip |
MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.
* Tweaks from feedback.
Diffstat (limited to 'api4/plugin.go')
-rw-r--r-- | api4/plugin.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/api4/plugin.go b/api4/plugin.go index ab026ab5f..90ea25b2d 100644 --- a/api4/plugin.go +++ b/api4/plugin.go @@ -24,11 +24,10 @@ func (api *API) InitPlugin() { api.BaseRoutes.Plugin.Handle("", api.ApiSessionRequired(removePlugin)).Methods("DELETE") api.BaseRoutes.Plugins.Handle("/statuses", api.ApiSessionRequired(getPluginStatuses)).Methods("GET") - api.BaseRoutes.Plugin.Handle("/activate", api.ApiSessionRequired(activatePlugin)).Methods("POST") - api.BaseRoutes.Plugin.Handle("/deactivate", api.ApiSessionRequired(deactivatePlugin)).Methods("POST") + api.BaseRoutes.Plugin.Handle("/enable", api.ApiSessionRequired(enablePlugin)).Methods("POST") + api.BaseRoutes.Plugin.Handle("/disable", api.ApiSessionRequired(disablePlugin)).Methods("POST") api.BaseRoutes.Plugins.Handle("/webapp", api.ApiHandler(getWebappPlugins)).Methods("GET") - } func uploadPlugin(c *Context, w http.ResponseWriter, r *http.Request) { @@ -165,7 +164,7 @@ func getWebappPlugins(c *Context, w http.ResponseWriter, r *http.Request) { w.Write([]byte(model.ManifestListToJson(clientManifests))) } -func activatePlugin(c *Context, w http.ResponseWriter, r *http.Request) { +func enablePlugin(c *Context, w http.ResponseWriter, r *http.Request) { c.RequirePluginId() if c.Err != nil { return @@ -189,7 +188,7 @@ func activatePlugin(c *Context, w http.ResponseWriter, r *http.Request) { ReturnStatusOK(w) } -func deactivatePlugin(c *Context, w http.ResponseWriter, r *http.Request) { +func disablePlugin(c *Context, w http.ResponseWriter, r *http.Request) { c.RequirePluginId() if c.Err != nil { return |