feat: initial goget release — modern IPv6-first download utility
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package compression
|
||||
|
||||
import (
|
||||
"compress/zlib"
|
||||
"io"
|
||||
)
|
||||
|
||||
type zlibDecompressor struct{ *BaseDecompressor }
|
||||
|
||||
func NewZlibDecompressor() *zlibDecompressor {
|
||||
return &zlibDecompressor{NewBaseDecompressor("zlib", []string{"deflate"}, []string{".zlib", ".zz"})}
|
||||
}
|
||||
|
||||
// ✅ Oprava: returns (io.Reader, error)
|
||||
func (z *zlibDecompressor) Reader(r io.Reader) (io.ReadCloser, error) {
|
||||
return zlib.NewReader(r)
|
||||
}
|
||||
|
||||
type zlibCompressor struct{ name string }
|
||||
|
||||
func NewZlibCompressor() *zlibCompressor { return &zlibCompressor{name: "zlib"} }
|
||||
func (z *zlibCompressor) Name() string { return z.name }
|
||||
func (z *zlibCompressor) Writer(w io.Writer) (io.WriteCloser, error) {
|
||||
return zlib.NewWriter(w), nil
|
||||
}
|
||||
|
||||
func init() { Register(NewZlibDecompressor()) }
|
||||
Reference in New Issue
Block a user