Documentation ¶
Index ¶
- func Compress(data []byte, level int) []byte
- func CompressBase64(data []byte, level int) string
- func CompressBase64JSON(data interface{}, level int) (string, error)
- func CompressWriter(w io.Writer, data []byte, level int) error
- func FixCompressLevel(level int) int
- func Uncompress(compressed []byte) ([]byte, error)
- func UncompressBase64(compressedB64 string) ([]byte, error)
- func UncompressBase64JSON(compressedB64 string, data interface{}) error
- func UncompressBase64String(compressedB64 string) (string, error)
- func UncompressWriter(w io.Writer, compressed []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressBase64 ¶
CompressBase64 performs gzip compression and then base64 encodes the data. Level includes `compress/gzip.BestSpeed`, `compress/gzip.BestCompression`, and `compress/gzip.DefaultCompression`.
func CompressBase64JSON ¶
CompressBase64JSON performs a JSON encoding, gzip compression and then base64 encodes the data.
func CompressWriter ¶
CompressWriter compresses a byte slide and writes the results to the supplied `io.Writer`. When writing to a file, a `*os.File` from `os.Create()` can be used as the `io.Writer`.
func FixCompressLevel ¶
func Uncompress ¶
Uncompress gunzips a byte slice.
func UncompressBase64 ¶
UncompressBase64 base 64 decodes an input string and then gunzips the results.
func UncompressBase64JSON ¶
UncompressBase64JSON JSON encodes data, compresses it and then base 64 compresses the data.
func UncompressBase64String ¶
UncompressBase64String base 64 decodes an input string and then gunzips the results, returning a decoded string.
Types ¶
This section is empty.