encoding

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2018 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package encoding provides an handler that compresses the response body using gzip.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gzip

func Gzip(h http.Handler, opts ...Option) http.Handler

Gzip returns a handler that will use gzip compression on the response body of handler h. Compression will only be applied if the request contains an 'Accept-Encoding' header that contains 'gzip'.

By default, no messages are printed out.

Types

type Option

type Option struct {
	// contains filtered or unexported fields
}

An Option is used to change the default behaviour of the encoding handlers.

func Logger

func Logger(l handler.Logger) Option

Logger is used to print out any error messages during compression. If none is provided, no error message will be printed.

Jump to

Keyboard shortcuts

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