Documentation ¶
Index ¶
- func Compress(w io.Writer, r io.Reader, level int) error
- func CompressBase64JSON(data any, level int) (string, error)
- func CompressBytes(data []byte, level int) ([]byte, error)
- func CompressFileToBase64String(name string, level int) (string, error)
- func CompressToBase64String(data []byte, level int) (string, error)
- func FixCompressLevel(level int) int
- func Uncompress(w io.Writer, r io.Reader) error
- func UncompressBase64JSON(compressedB64 string, data any) error
- func UncompressBase64String(compressedB64 string) ([]byte, error)
- func UncompressBytes(b []byte) ([]byte, error)
- func UncompressToBytes(r io.Reader) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress 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 CompressBase64JSON ¶
CompressBase64JSON performs a JSON encoding, gzip compression and then base64 encodes the data.
func CompressBytes ¶ added in v0.64.4
CompressBytes performs gzip compression on a byte slice.
func CompressFileToBase64String ¶ added in v0.64.7
CompressFileToBase64String compresses a file to base64 encoded string.
func CompressToBase64String ¶ added in v0.64.4
CompressToBase64String performs gzip compression and then base64 encodes the data. Level includes `compress/gzip.BestSpeed`, `compress/gzip.BestCompression`, and `compress/gzip.DefaultCompression`.
func FixCompressLevel ¶
func Uncompress ¶
Uncompress gunzips a byte slice and writes the results to a `io.Writer`
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. Base64 strings start with `H4sI` to `H4sIAAAAAAAAA`.
func UncompressBytes ¶ added in v0.64.4
Types ¶
This section is empty.