1 Star 0 Fork 0

h79/goutils

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
compress.go 397 Bytes
Copy Edit Raw Blame History
huqiuyun authored 2022-11-01 20:57 . 上传文件调整
package compress
import "strings"
type Compressor interface {
Name() string
CompressBound(int) int
Compress(dst, src []byte) (int, error)
Decompress(dst, src []byte) (int, error)
}
func NewCompressor(level string) Compressor {
level = strings.ToLower(level)
switch level {
case "zstd":
return ZStandard{ZstdLevel}
case "lz4":
return LZ4{}
case "":
return noOp{}
}
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/h79/goutils.git
git@gitee.com:h79/goutils.git
h79
goutils
goutils
v1.8.42

Search