Documentation
¶
Index ¶
Constants ¶
const ( HuffmanOnly = gzip.HuffmanOnly NoCompression = gzip.NoCompression BestSpeed = gzip.BestSpeed BestCompression = gzip.BestCompression DefaultCompression = gzip.DefaultCompression )
Gzip compression levels, re-exported so callers don't depend on the backing gzip implementation.
const NoLimit int64 = math.MaxInt64
NoLimit disables the decompressed-size bound in Gzip64Decode.
Variables ¶
var ErrWriterNotAcquired = errors.New("using writer after release")
Functions ¶
func Gzip64Decode ¶
Gzip64Decode decompress data with a size limit of `maxDecompressedSize`. If decoded data turns out to be bigger an error is retured. Use NoLimit for unbounded decompression.
func Gzip64Encode ¶
Gzip64Encode encodes data with default compression
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a pooled gzip writer. Its gzip writer is permanently wired to proxy, which forwards writes to the caller's dst while the writer is acquired. The indirection lets Release detach the caller's destination in O(1) instead of paying a second flate reset just to re-point the gzip writer at io.Discard.
func GzipWriter ¶
GzipWriter returns a gzip writer reset onto `dst`, compressing at the default level. Once used, it should be sent back to the pool via `Release`
func GzipWriterLevel ¶
GzipWriterLevel returns a gzip writer reset onto `dst`, compressing at `level`. Once used, it should be sent back to the pool via `Release`