Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressStream ¶
func CompressStream(dest io.Writer, compression Compression) (io.WriteCloser, error)
CompressStream compresses the dest with specified compression algorithm.
func DecompressStream ¶
func DecompressStream(archive io.Reader) (io.ReadCloser, error)
DecompressStream decompresses the archive and returns a ReaderCloser with the decompressed archive.
Types ¶
type Compression ¶
type Compression int
Compression is the state represents if compressed or not.
const ( None Compression = 0 // None represents the uncompressed. Bzip2 Compression = 1 // Bzip2 is bzip2 compression algorithm. Gzip Compression = 2 // Gzip is gzip compression algorithm. Xz Compression = 3 // Xz is xz compression algorithm. Zstd Compression = 4 // Zstd is zstd compression algorithm. )
func Detect ¶
func Detect(source []byte) Compression
Detect detects the compression algorithm of the source.
func (*Compression) Extension ¶
func (c *Compression) Extension() string
Extension returns the extension of a file that uses the specified compression algorithm.
Click to show internal directories.
Click to hide internal directories.