decompress

package
v0.0.0-...-ebaf64e Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 9 Imported by: 0

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

func Wrap(path string, r io.Reader) (io.Reader, io.Closer, error)

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.

Jump to

Keyboard shortcuts

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