...

Package zstd

import "github.com/google/go-containerregistry/internal/zstd"
Overview
Index

Overview ▾

Package zstd provides helper functions for interacting with zstd streams.

Variables

MagicHeader is the start of zstd files.

var MagicHeader = []byte{'\x28', '\xb5', '\x2f', '\xfd'}

func Is

func Is(r io.Reader) (bool, error)

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 zstd level 1 for the compression.

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.

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.