github.com/hoveychen/kafka-go@v0.4.42/gzip/gzip.go (about)

     1  // Package gzip does nothing, it's kept for backward compatibility to avoid
     2  // breaking the majority of programs that imported it to install the compression
     3  // codec, which is now always included.
     4  package gzip
     5  
     6  import (
     7  	"github.com/hoveychen/kafka-go/compress/gzip"
     8  	gz "github.com/klauspost/compress/gzip"
     9  )
    10  
    11  const (
    12  	Code                    = 1
    13  	DefaultCompressionLevel = gz.DefaultCompression
    14  )
    15  
    16  type CompressionCodec = gzip.Codec
    17  
    18  func NewCompressionCodec() *CompressionCodec {
    19  	return NewCompressionCodecLevel(DefaultCompressionLevel)
    20  }
    21  
    22  func NewCompressionCodecLevel(level int) *CompressionCodec {
    23  	return &CompressionCodec{Level: level}
    24  }