Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressStringArray ¶ added in v0.3.30
func CompressStringArray(input []string, compressor Compressor) ([]byte, error)
func DecompressStringArray ¶ added in v0.3.30
func DecompressStringArray(input []byte, decompressor Decompressor) ([]string, error)
Types ¶
type Compressor ¶
type Compressor interface { // Compress compresses the byte array Compress(b []byte) ([]byte, error) }
Compressor is a fast, single threaded compressor. This type allows us to reuse buffers etc for performance
type Decompressor ¶
type Decompressor interface { // Decompress decompresses the byte array Decompress(b []byte) ([]byte, error) }
Decompressor is a fast, single threaded compressor. This type allows us to reuse buffers etc for performance
type NoOpCompressor ¶
type NoOpCompressor struct{}
NoOpCompressor is a Compressor that does nothing. Useful for tests.
type NoOpDecompressor ¶
type NoOpDecompressor struct{}
NoOpDecompressor is a DeCompressor that does nothing. Useful for tests.
func (*NoOpDecompressor) DeCompress ¶
func (c *NoOpDecompressor) DeCompress(b []byte) ([]byte, error)
type ZlibCompressor ¶
type ZlibCompressor struct {
// contains filtered or unexported fields
}
ZlibCompressor compresses to Zlib, which for KB size payloads seems more (cpu) efficient than the newer formats such as zstd. The compressor will only compress if the msg is greater than minCompressSize
func NewZlibCompressor ¶
func NewZlibCompressor(minCompressSize int) (*ZlibCompressor, error)
type ZlibDecompressor ¶
type ZlibDecompressor struct {
// contains filtered or unexported fields
}
ZlibDecompressor decompresses Zlib,
func NewZlibDecompressor ¶
func NewZlibDecompressor() (*ZlibDecompressor, error)
func (*ZlibDecompressor) Decompress ¶
func (d *ZlibDecompressor) Decompress(b []byte) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.