Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm int
Algorithm is the compression algorithm to use.
const ( // Zstandard uses the zstd algorithm Zstandard Algorithm // DefaultAlgorithm is the default compression algorithm to use DefaultAlgorithm = Zstandard )
func AutoDetect ¶
func AutoDetect(r io.ReadSeeker) (Algorithm, error)
AutoDetect attempts to detect the compression algorithm used
type Compressor ¶
type Compressor interface { io.WriteCloser Algorithm() Algorithm }
Compressor is a generic interface for compressors
func NewCompressor ¶
func NewCompressor(w io.Writer, a Algorithm, opts ...CompressorOption) (Compressor, error)
NewCompressor returns a new compressor
type CompressorOption ¶
type CompressorOption interface {
Apply(compressor interface{}) error
}
CompressorOption applies an option to a compressor
func WithCompressionLevel ¶
func WithCompressionLevel(l Level) CompressorOption
WithCompressionLevel optionally sets the compression level
type Decompressor ¶
type Decompressor interface { io.ReadCloser Algorithm() Algorithm }
Decompressor is a generic interface for decompressors
func NewDecompressor ¶
func NewDecompressor(r io.Reader, a Algorithm, opts ...DecompressorOption) (Decompressor, error)
NewDecompressor returns a new decompressor
type DecompressorOption ¶
type DecompressorOption interface {
Apply(decompressor interface{}) error
}
DecompressorOption applies an option to a decompressor
type Level ¶
type Level int
Level defines the level of compression
const ( // SpeedFastest will choose the fastest reasonable compression. SpeedFastest Level // SpeedDefault is the default "pretty fast" compression option. SpeedDefault // SpeedBetterCompression will yield better compression than the default. SpeedBetterCompression // SpeedBestCompression will choose the best available compression option. SpeedBestCompression )
Click to show internal directories.
Click to hide internal directories.