compress

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 11 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 GzipWithLevel added in v0.12.5

func GzipWithLevel(level int) *Compress

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 BrWithQuality added in v0.12.5

func BrWithQuality(quality int) *Noop

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