summaryrefslogtreecommitdiffstats
path: root/app/app.go
blob: 667c425bd7f3493d8960473939c7f5b00198c27e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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()
	}
}