Documentation
¶
Overview ¶
Package zstdutil provides utilities for creating and extracting tar.zst archives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TarZstdDir ¶
func TarZstdDir(w io.Writer, sourceDir string, level CompressionLevel) error
TarZstdDir creates a tar.zst archive from a directory and writes it to the provided writer. This is a streaming implementation that doesn't buffer the entire archive in memory.
func TarZstdDirToBytes ¶
func TarZstdDirToBytes(sourceDir string, level CompressionLevel) ([]byte, error)
TarZstdDirToBytes creates a tar.zst archive from a directory and returns it as bytes. This is a convenience function for smaller directories where buffering is acceptable.
Types ¶
type CompressionLevel ¶
type CompressionLevel string
CompressionLevel represents the zstd compression level.
const ( LevelFastest CompressionLevel = "fastest" LevelDefault CompressionLevel = "default" LevelBetter CompressionLevel = "better" LevelBest CompressionLevel = "best" )
func (CompressionLevel) ToZstdLevel ¶
func (l CompressionLevel) ToZstdLevel() zstd.EncoderLevel
ToZstdLevel converts a CompressionLevel to a zstd.EncoderLevel.
Click to show internal directories.
Click to hide internal directories.