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{} )
maps of registered compressors by header ID and name.
Functions ¶
func RegisterCompressor ¶
func RegisterCompressor(name Name, c Compressor)
RegisterCompressor registers the provided compressor implementation
Types ¶
type Compressor ¶
type Compressor interface { HeaderID() HeaderID Compress(output *bytes.Buffer, input []byte) error Decompress(output *bytes.Buffer, input []byte) error }
Compressor implements compression and decompression of a byte slice.
type HeaderID ¶
type HeaderID uint32
HeaderID is a unique identifier of the compressor stored in the compressed block header.
func IDFromHeader ¶
IDFromHeader retrieves compression ID from content header
Click to show internal directories.
Click to hide internal directories.