compressor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package compressor implements GZIP compression for HTTP responses.

Index

Constants

View Source
const (
	BestCompression    = gzip.BestCompression
	BestSpeed          = gzip.BestSpeed
	DefaultCompression = gzip.DefaultCompression
	NoCompression      = gzip.NoCompression
)

Variables

This section is empty.

Functions

func GzipHandler

func GzipHandler(h http.Handler, opts ...option) http.Handler

GzipHandler applies GZIP compression to the response body, except in the following scenarios: * The response body is already compressed using gzip or deflate * The request's Accept-Encoding header does not announce gzip support * The request is upgrading to a websocket connection.

func GzipLevel

func GzipLevel(l int) option

GzipLevel allows configuring GZIP compression level. Options: * compressor.BestCompression * compressor.BestSpeed * compressor.DefaultCompression * compressor.NoCompression

Types

This section is empty.

Jump to

Keyboard shortcuts

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