func (l LZWCompressor) Compress(value []byte) ([]byte, error) {
	var b bytes.Buffer
	w := lzw.NewWriter(&b, lzw.LSB, l.litWidth)
	_, _ = w.Write(value)
	w.Close()
	return b.Bytes(), nil
}
Compress compresses a series of bytes, and returns the compressed data in bytes
package compressor
import (
	"bytes"
	"compress/lzw"
	"compress/zlib"
	"github.com/Sirupsen/logrus"
)
type Compressor interface {
	Compress(value []byte) ([]byte, error)
	Decompress(value []byte) ([]byte, error)
}
func NewZlibCompressor() ZlibCompressor {
	return ZlibCompressor{}
}
type ZlibCompressor struct {
}
func (z ZlibCompressor) Compress(value []byte) ([]byte, error) {
	var b bytes.Buffer
	w := zlib.NewWriter(&b)
	_, err := w.Write(value)
	w.Close()
	return b.Bytes(), err
}
func (z ZlibCompressor) Decompress(value []byte) ([]byte, error) {
	b := bytes.NewReader(value)
	r, err := zlib.NewReader(b)
	if err != nil {
		logrus.Error("Error decompressing data: ", err)
		return make([]byte, 0), err
	}
	buf := new(bytes.Buffer)
	buf.ReadFrom(r)
	r.Close()
	return buf.Bytes(), err
}
type LZWCompressor struct {
	litWidth int
}
func NewLZWCompressor(width int) LZWCompressor {
	return LZWCompressor{
		litWidth: width,
	}
}