github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/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 "github.com/klauspost/compress/gzip" 8 "github.com/segmentio/kafka-go/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 }