go1.20.5
GoThrough

gzip.BestCompression

// These constants are copied from the flate package, so that code that imports // "compress/gzip" does not also have to import "compress/flate". const BestCompression = flate.BestCompression

gzip.BestSpeed

// These constants are copied from the flate package, so that code that imports // "compress/gzip" does not also have to import "compress/flate". const BestSpeed = flate.BestSpeed

gzip.DefaultCompression

// These constants are copied from the flate package, so that code that imports // "compress/gzip" does not also have to import "compress/flate". const DefaultCompression = flate.DefaultCompression

gzip.HuffmanOnly

// These constants are copied from the flate package, so that code that imports // "compress/gzip" does not also have to import "compress/flate". const HuffmanOnly = flate.HuffmanOnly

gzip.NoCompression

// These constants are copied from the flate package, so that code that imports // "compress/gzip" does not also have to import "compress/flate". const NoCompression = flate.NoCompression

gzip.ErrChecksum

// ErrChecksum is returned when reading GZIP data that has an invalid checksum. var ErrChecksum = errors.New("gzip: invalid checksum")

gzip.ErrHeader

// ErrHeader is returned when reading GZIP data that has an invalid header. var ErrHeader = errors.New("gzip: invalid header")

gzip.NewReader

// NewReader creates a new Reader reading the given reader. // If r does not also implement io.ByteReader, // the decompressor may read more data than necessary from r. // // It is the caller's responsibility to call Close on the Reader when done. // // The Reader.Header fields will be valid in the Reader returned. func NewReader(r io.Reader) (*Reader, error)

gzip.NewWriter

// NewWriter returns a new Writer. // Writes to the returned writer are compressed and written to w. // // It is the caller's responsibility to call Close on the Writer when done. // Writes may be buffered and not flushed until Close. // // Callers that wish to set the fields in Writer.Header must do so before // the first call to Write, Flush, or Close. func NewWriter(w io.Writer) *Writer

gzip.NewWriterLevel

// NewWriterLevel is like NewWriter but specifies the compression level instead // of assuming DefaultCompression. // // The compression level can be DefaultCompression, NoCompression, HuffmanOnly // or any integer value between BestSpeed and BestCompression inclusive. // The error returned will be nil if the level is valid. func NewWriterLevel(w io.Writer, level int) (*Writer, error)