package
module
Version:
v1.4.0
Opens a new window with list of versions in this module.
Published: Dec 13, 2023
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 5
Opens a new window with list of known importers.
Documentation
¶
Package httpgzip provides a wrapper to http.Handler that does on the fly gzip
encoding if certain conditions are met.
Content is compressed only if client understands it, content size is greater
than certain threshold and content type matches predefined list of types.
New returns a http.Handler that optionally compresses response using
'Content-Enconding: gzip' scheme.
type Option func(*gzipHandler)
Option functions are used to configure new handler.
WithLevel configures handler to use specified compression level. It will
panic if level is not one of the values accepted by gzip.NewWriterLevel.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.