Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompressorFunc ¶
CompressorFunc is the function the prototype for compression.
var PassthroughCompressor CompressorFunc = func(data []byte) ([]byte, error) { return []byte(hex.EncodeToString(data)), nil }
PassthroughCompressor is a dummy function for development and testing *ONLY*.
* WARNING: DO NOT USE IN PRODUCTION. * PassthroughCompressor is *NOT* compression and *DOES NOT* compress data.
type DecompressorFunc ¶
DecompressorFunc is the function the prototype for decompression.
var PassthroughDecompressor DecompressorFunc = func(compressed []byte) ([]byte, error) { return hex.DecodeString(string(compressed)) }
PassthroughDecompressor is a dummy function for development and testing *ONLY*.
* WARNING: DO NOT USE IN PRODUCTION. * PassthroughDecompressor is *NOT* decompression and *DOES NOT* decompress data.
type Format ¶
type Format string
Format is the supporter compression algorithm type.
const ( // None no compression. None Format = "" // Custom a custom compression format is being used. Custom Format = "custom" // Zstd Zstandard compression https://facebook.github.io/zstd/. Zstd Format = "zstd" )
TODO: support additional compression algorithms besides
Zstandard from https://github.com/klauspost/compress
func DecodeFormat ¶
DecodeFormat removes and returns the compression format from the compressed data. If no compression format is found DecodeFormat returns the original the data.