compress

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compress

type Compress struct {
	New       func() Compressor
	Encoding  string // http Accept-Encoding, Content-Encoding value
	Vary      bool   // add Vary: Accept-Encoding
	Types     string // only compress for given types, * for all types
	MinLength int    // skip if Content-Length less than given value
}

Compress is the compress middleware

func Deflate

func Deflate() Compress

Deflate creates new deflate compress middleware

func Gzip

func Gzip() Compress

Gzip creates new gzip compress middleware

func (Compress) ServeHandler

func (m Compress) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

type Compressor

type Compressor interface {
	io.Writer
	io.Closer
	Reset(io.Writer)
	Flush() error
}

Compressor type

type Noop

type Noop struct {
}

Noop middleware

func Br

func Br() *Noop

Br creates noop middleware

func (*Noop) ServeHandler

func (m *Noop) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

Jump to

Keyboard shortcuts

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