Documentation
¶
Overview ¶
Package encoder implements pure Go chunk encoders independently of storage, worker protocols, and the corresponding decoders.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder interface {
Name() string
Encode(ctx context.Context, raw []byte, dst io.Writer) (Stats, error)
}
Encoder compresses one bounded, read-only chunk.
type Gzip ¶
type Gzip struct {
Level int
// contains filtered or unexported fields
}
Gzip encodes standard gzip with pure Go and retains at most four idle encoders. Level may change between calls, but not during concurrent calls.
type LZ4 ¶
type LZ4 struct{}
LZ4 encodes standard checksummed independent-block frames without cgo.
type MinLZ ¶
type MinLZ struct {
Level int
// contains filtered or unexported fields
}
MinLZ encodes independent, checksummed streams without cgo. A zero Level selects Fastest; -1, 1, 2 and 3 are the official levels. Level may change between calls, but must not change during concurrent calls. Do not copy a MinLZ after its first use.
type Zstd ¶
type Zstd struct {
Level int
}
Zstd is the pure-Go Zstandard chunk encoder. Level is expressed using the usual zstd scale: values below 3 select the fastest mode, 3-5 select the default mode, 6-9 select better compression, and higher values select the best available mode. A zero level selects the fastest mode for write-back workloads.
func NewZstd ¶
NewZstd creates a Zstandard encoder. The implementation maps the numeric zstd level to the stable encoder modes provided by klauspost/compress, so upgrades do not silently depend on its internal level table.