compress

package
v1.8.1-0...-0157f87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(w io.Writer, compression CompressionType, level *int) (io.WriteCloser, error)

Compress makes a compressed writer from the given one

func Decompress

func Decompress(r io.Reader, c CompressionType) (io.ReadCloser, error)

Decompress wraps given reader by the decompressing io.ReadCloser

func IsValidCompressionType

func IsValidCompressionType(s string) bool

Types

type CompressionType

type CompressionType string
const (
	CompressionTypeNone      CompressionType = "none"
	CompressionTypeGZIP      CompressionType = "gzip"
	CompressionTypePGZIP     CompressionType = "pgzip"
	CompressionTypeSNAPPY    CompressionType = "snappy"
	CompressionTypeLZ4       CompressionType = "lz4"
	CompressionTypeS2        CompressionType = "s2"
	CompressionTypeZstandard CompressionType = "zstd"
)

func FileCompression

func FileCompression(ext string) CompressionType

FileCompression return compression alg based on given file extension

func (CompressionType) Suffix

func (c CompressionType) Suffix() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL