Files
mattermost/app/app.go
Chris 4731b8f9b9 fix plugin test (#7436)
* fix plugin test

* ugh. global state

* Fix plugin test

* Fix TestDeleteChannel

* Remove plugin config listener when shutting down
2017-09-12 15:12:29 -04:00

31 lines
519 B
Go

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package app
import (
"io/ioutil"
"net/http"
"github.com/mattermost/mattermost-server/plugin/pluginenv"
)
type App struct {
Srv *Server
PluginEnv *pluginenv.Environment
PluginConfigListenerId string
}
var globalApp App
func Global() *App {
return &globalApp
}
func CloseBody(r *http.Response) {
if r.Body != nil {
ioutil.ReadAll(r.Body)
r.Body.Close()
}
}