github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/zstd/zstd.go (about) 1 // Package zstd 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 zstd 5 6 import "github.com/segmentio/kafka-go/compress/zstd" 7 8 const ( 9 Code = 4 10 DefaultCompressionLevel = 3 11 ) 12 13 type CompressionCodec = zstd.Codec 14 15 func NewCompressionCodec() *CompressionCodec { 16 return NewCompressionCodecWith(DefaultCompressionLevel) 17 } 18 19 func NewCompressionCodecWith(level int) *CompressionCodec { 20 return &CompressionCodec{Level: level} 21 }