blob: 949c688808d1b9036bce31bfe56746cbbef0343c (
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
|
package gzip
import (
"net/http"
"github.com/NYTimes/gziphandler"
)
const PluginName = "gzip"
type Plugin struct{}
// needed for the Endure
func (g *Plugin) Init() error {
return nil
}
func (g *Plugin) Middleware(next http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
gziphandler.GzipHandler(next).ServeHTTP(w, r)
}
}
func (g *Plugin) Name() string {
return PluginName
}
|