package compression
import "github.com/google/go-containerregistry/internal/compression"
Package compression abstracts over gzip and zstd.
Index ¶
Functions ¶
func GetCompression ¶
func GetCompression(opener Opener) (compression.Compression, error)
GetCompression detects whether an Opener is compressed and which algorithm is used.
Types ¶
type Opener ¶
type Opener = func() (io.ReadCloser, error)
Opener represents e.g. opening a file.
type PeekReader ¶
PeekReader is an io.Reader that also implements Peek a la bufio.Reader.
func PeekCompression ¶
func PeekCompression(r io.Reader) (compression.Compression, PeekReader, error)
PeekCompression detects whether the input stream is compressed and which algorithm is used.
If r implements Peek, we will use that directly, otherwise a small number of bytes are buffered to Peek at the gzip/zstd header, and the returned PeekReader can be used as a replacement for the consumed input io.Reader.
Source Files ¶
- Version
- v0.20.3 (latest)
- Published
- Jan 15, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 21 hours ago –
Tools for package owners.