aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/zstd/encoder_options.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-09-10 09:31:28 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-09-10 09:34:31 -0400
commit98620c56d6ad0d896308a4e5858c5d1913476eaf (patch)
treedf24f9bb53b8b455cf79cb57594987c7c0054b16 /vendor/github.com/klauspost/compress/zstd/encoder_options.go
parent08b602043ec07601b9be23c449c7773067683d90 (diff)
downloadpodman-98620c56d6ad0d896308a4e5858c5d1913476eaf.tar.gz
podman-98620c56d6ad0d896308a4e5858c5d1913476eaf.tar.bz2
podman-98620c56d6ad0d896308a4e5858c5d1913476eaf.zip
vendor containers/storage v1.23.5
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/zstd/encoder_options.go')
-rw-r--r--vendor/github.com/klauspost/compress/zstd/encoder_options.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go
index dfac14ddd..579206163 100644
--- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go
+++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go
@@ -24,6 +24,7 @@ type encoderOptions struct {
allLitEntropy bool
customWindow bool
customALEntropy bool
+ dict *dict
}
func (o *encoderOptions) setDefault() {
@@ -265,3 +266,16 @@ func WithSingleSegment(b bool) EOption {
return nil
}
}
+
+// WithEncoderDict allows to register a dictionary that will be used for the encode.
+// The encoder *may* choose to use no dictionary instead for certain payloads.
+func WithEncoderDict(dict []byte) EOption {
+ return func(o *encoderOptions) error {
+ d, err := loadDict(dict)
+ if err != nil {
+ return err
+ }
+ o.dict = d
+ return nil
+ }
+}