gzip

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2020 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncoderFilter

type EncoderFilter struct {
	EnableGzip  bool
	GzipMinSize int
}

EncoderFilter is struct to host Middleware function DoFilter and store minimum data size for gzip

func NewGzipEncoderFilter

func NewGzipEncoderFilter(enable bool, minSizeToCompress int) *EncoderFilter

NewGzipEncoderFilter creates new encoder filter that handles gzip compression.

func (*EncoderFilter) DoFilter

func (filter *EncoderFilter) DoFilter(next http.Handler) http.Handler

DoFilter will return the middleware function for compressing body IF the client ask for Accept-Encoding: gzip

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL