package gzip
import "github.com/google/go-containerregistry/internal/gzip"
Package gzip provides helper functions for interacting with gzipped streams.
Index ¶
- Variables
- func Is(r io.Reader) (bool, error)
- func ReadCloser(r io.ReadCloser) io.ReadCloser
- func ReadCloserLevel(r io.ReadCloser, level int) io.ReadCloser
- func UnzipReadCloser(r io.ReadCloser) (io.ReadCloser, error)
Variables ¶
var MagicHeader = []byte{'\x1f', '\x8b'}
MagicHeader is the start of gzip files.
Functions ¶
func Is ¶
Is detects whether the input stream is compressed.
func ReadCloser ¶
func ReadCloser(r io.ReadCloser) io.ReadCloser
ReadCloser reads uncompressed input data from the io.ReadCloser and returns an io.ReadCloser from which compressed data may be read. This uses gzip.BestSpeed for the compression level.
func ReadCloserLevel ¶
func ReadCloserLevel(r io.ReadCloser, level int) io.ReadCloser
ReadCloserLevel reads uncompressed input data from the io.ReadCloser and returns an io.ReadCloser from which compressed data may be read. Refer to compress/gzip for the level: https://golang.org/pkg/compress/gzip/#pkg-constants
func UnzipReadCloser ¶
func UnzipReadCloser(r io.ReadCloser) (io.ReadCloser, error)
UnzipReadCloser reads compressed input data from the io.ReadCloser and returns an io.ReadCloser from which uncompressed data may be read.
Source Files ¶
- Version
- v0.20.3 (latest)
- Published
- Jan 15, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 21 hours ago –
Tools for package owners.