Documentation ¶
Overview ¶
Package compresshandler provides http middlewares which auto compress http responses and auto decompress http requests based on request's Accept-Encoding and Content-Encoding headers.
Index ¶
Constants ¶
View Source
const ( GzipBestSpeed = compressor.GzipBestSpeed GzipBestCompression = compressor.GzipBestCompression GzipDefaultCompression = (GzipBestCompression - GzipBestSpeed) / 2 ZlibBestSpeed = compressor.ZlibBestSpeed ZlibBestCompression = compressor.ZlibBestCompression ZlibDefaultCompression = (ZlibBestCompression - ZlibBestSpeed) / 2 BrotliBestSpeed = compressor.BrotliBestSpeed BrotliBestCompression = compressor.BrotliBestCompression BrotliDefaultCompression = (BrotliBestCompression - BrotliBestSpeed) / 2 )
Variables ¶
This section is empty.
Functions ¶
func NewFastHTTP ¶ added in v1.4.0
func NewFastHTTP(config Config) func(next fasthttp.RequestHandler) fasthttp.RequestHandler
NewFastHTTP creates autocompressing and autodecompressing fasthttp middleware with provided Config.
Types ¶
type Config ¶
type Config struct { GzipLevel int // gzip compression level for response between GzipBestSpeed and GzipBestCompression including boundaries ZlibLevel int // zlib compression level for response between ZlibBestSpeed and ZlibBestCompression including boundaries BrotliLevel int // brotli compression level for response between BrotliBestSpeed and BrotliBestCompression including boundaries MinContentLength int // minimal length of raw response to be compress }
Config describes configuration for New* methods.
Click to show internal directories.
Click to hide internal directories.