Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringCompressorAlgorithm ¶
func StringCompressorAlgorithm(a CompressorAlgorithm) string
StringCompressorAlgorithm return the string value of algorithm selected
Types ¶
type Compressor ¶
type Compressor struct { Algorithm CompressorAlgorithm MinimumSize int }
Compressor is a simple compressor to work with relative small size of bytes (all is in memory)
func (*Compressor) Compress ¶
func (mc *Compressor) Compress(bs []byte) ([]byte, error)
Compress compress bs input based on Algorithm and return the data compressed
func (*Compressor) StringAlgoritm ¶
func (mc *Compressor) StringAlgoritm() string
StringAlgoritm return the string value of algorithm selected in Compressor object
type CompressorAlgorithm ¶
type CompressorAlgorithm int
CompressorAlgorithm define the compression algorithm used bye Compressor
const ( // CompressorNoComprs means compression disabled CompressorNoComprs CompressorAlgorithm = iota // CompressorGzip set GZIP compression CompressorGzip // CompressorZlib is Deprecated: This is not properly working if more than one message is send by same connection CompressorZlib )
func ParseAlgorithm ¶
func ParseAlgorithm(s string) (CompressorAlgorithm, error)
ParseAlgorithm is the inverse func of StringCompressorAlgorithm. Error is returned if s value is not matching with none valid algorithm
Click to show internal directories.
Click to hide internal directories.