-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1107 from giuseppe/revert-zstd-encoder
revert usage of github.com/valyala/gozstd
- Loading branch information
Showing
40 changed files
with
38 additions
and
4,846 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 8 additions & 11 deletions
19
pkg/archive/archive_zstd_cgo.go → pkg/archive/archive_zstd.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
// +build linux,cgo | ||
|
||
package archive | ||
|
||
import ( | ||
"io" | ||
|
||
zstd "github.com/valyala/gozstd" | ||
"github.com/klauspost/compress/zstd" | ||
) | ||
|
||
type wrapperZstdDecoder struct { | ||
decoder *zstd.Reader | ||
decoder *zstd.Decoder | ||
} | ||
|
||
func (w *wrapperZstdDecoder) Close() error { | ||
w.decoder.Release() | ||
w.decoder.Close() | ||
return nil | ||
} | ||
|
||
func (w *wrapperZstdDecoder) DecodeAll(input, dst []byte) ([]byte, error) { | ||
return zstd.Decompress(dst, input) | ||
return w.decoder.DecodeAll(input, dst) | ||
} | ||
|
||
func (w *wrapperZstdDecoder) Read(p []byte) (int, error) { | ||
return w.decoder.Read(p) | ||
} | ||
|
||
func (w *wrapperZstdDecoder) Reset(r io.Reader) error { | ||
w.decoder.Reset(r, nil) | ||
return nil | ||
return w.decoder.Reset(r) | ||
} | ||
|
||
func (w *wrapperZstdDecoder) WriteTo(wr io.Writer) (int64, error) { | ||
return w.decoder.WriteTo(wr) | ||
} | ||
|
||
func zstdReader(buf io.Reader) (io.ReadCloser, error) { | ||
decoder := zstd.NewReader(buf) | ||
return &wrapperZstdDecoder{decoder: decoder}, nil | ||
decoder, err := zstd.NewReader(buf) | ||
return &wrapperZstdDecoder{decoder: decoder}, err | ||
} | ||
|
||
func zstdWriter(dest io.Writer) (io.WriteCloser, error) { | ||
return zstd.NewWriter(dest), nil | ||
return zstd.NewWriter(dest) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.