summaryrefslogtreecommitdiffstats
path: root/app/app.go
blob: ce812ed161cad637b6ef3b97c68b4c22dc464f9c (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
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package app

import (
	"io/ioutil"
	"net/http"
)

type App struct {
	Srv *Server
}

var globalApp App

func Global() *App {
	return &globalApp
}

func CloseBody(r *http.Response) {
	if r.Body != nil {
		ioutil.ReadAll(r.Body)
		r.Body.Close()
	}
}