Documentation
¶
Overview ¶
Package compression provides HTTP compression utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressGzip ¶
CompressGzip compresses data with the specified compression level. The level parameter should be one of the gzip constants (e.g., gzip.BestSpeed). Returns the compressed data or an error if compression fails.
func IsGzipped ¶
IsGzipped checks if data is already gzip compressed. It checks for the gzip magic bytes (0x1f 0x8b) at the start of the data.
func SupportsGzip ¶
SupportsGzip checks if the client accepts gzip encoding. It inspects the Accept-Encoding header and returns true if gzip is supported.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.