github.com/QuangHoangHao/kafka-go@v0.4.36/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 gz "compress/gzip" 8 9 "github.com/QuangHoangHao/kafka-go/compress/gzip" 10 ) 11 12 const ( 13 Code = 1 14 DefaultCompressionLevel = gz.DefaultCompression 15 ) 16 17 type CompressionCodec = gzip.Codec 18 19 func NewCompressionCodec() *CompressionCodec { 20 return NewCompressionCodecLevel(DefaultCompressionLevel) 21 } 22 23 func NewCompressionCodecLevel(level int) *CompressionCodec { 24 return &CompressionCodec{Level: level} 25 }