Documentation ¶
Overview ¶
Package compression manages compression algorithm implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ByHeaderID = map[HeaderID]Compressor{} ByName = map[Name]Compressor{} HeaderIDToName = map[HeaderID]Name{} IsDeprecated = map[Name]bool{} )
maps of registered compressors by header ID and name.
Functions ¶
func DecompressByHeader ¶ added in v0.9.0
DecompressByHeader decodes compression header from the provided input and decompresses the remainder.
func RegisterCompressor ¶
func RegisterCompressor(name Name, c Compressor)
RegisterCompressor registers the provided compressor implementation.
func RegisterDeprecatedCompressor ¶ added in v0.11.0
func RegisterDeprecatedCompressor(name Name, c Compressor)
RegisterDeprecatedCompressor registers the provided compressor implementation.
Types ¶
type Compressor ¶
type Compressor interface { HeaderID() HeaderID Compress(output io.Writer, input io.Reader) error Decompress(output io.Writer, input io.Reader, withHeader bool) error }
Compressor implements compression and decompression of a byte slice.
Click to show internal directories.
Click to hide internal directories.