Documentation
¶
Overview ¶
Package decompress wraps an input reader in a decompressing reader based on the compressed file's extension, so logidx import can read gzip/xz/bzip2/zstd-compressed log files directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
Wrap inspects path's extension and, if it names a supported compression format, wraps r in the matching decompressing reader. If the extension is unrecognized (including no extension), r is returned unchanged along with a nil Closer. The returned io.Closer releases any resources the decompressor itself holds beyond r (currently only gzip and zstd need this); callers must call it (if non-nil) in addition to closing the original reader/file.
gzip, xz, and zstd validate their header immediately - a mismatched or corrupt input makes this call return an error right away. bzip2's decoder does not validate anything until it is first read from; a corrupt bzip2 input surfaces as a read error later instead.
Types ¶
This section is empty.