WithEncoderDict allows to register a dictionary that will be used for the encode. The slice dict must be in the [dictionary format] produced by "zstd --train" from the Zstandard reference implementation. The encoder *may* choose to use no dictionary instead for certain payloads. Can be changed wit
(dict []byte)
| 380 | // |
| 381 | // [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format |
| 382 | func WithEncoderDict(dict []byte) EOption { |
| 383 | return func(o *encoderOptions) error { |
| 384 | d, err := loadDict(dict) |
| 385 | if err != nil { |
| 386 | return err |
| 387 | } |
| 388 | o.dict = d |
| 389 | return nil |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | // WithEncoderDictRaw registers a dictionary that may be used by the encoder. |
| 394 | // |
searching dependent graphs…