1
0
mirror of https://github.com/nxshock/zkv.git synced 2024-11-27 11:21:02 +05:00
zkv/options.go

25 lines
464 B
Go
Raw Permalink Normal View History

package zkv
2022-12-03 12:55:42 +05:00
import "github.com/klauspost/compress/zstd"
type Options struct {
2022-12-03 12:55:42 +05:00
// Maximum number of concurrent reads
2022-12-03 20:59:17 +05:00
MaxParallelReads int
2022-12-03 12:55:42 +05:00
// Compression level
CompressionLevel zstd.EncoderLevel
2022-12-03 20:59:17 +05:00
// Write buffer size in bytes
BufferSize int
}
2022-12-03 12:55:42 +05:00
func (o *Options) setDefaults() {
if o.MaxParallelReads == 0 {
o.MaxParallelReads = defaultOptions.MaxParallelReads
}
2022-12-03 12:55:42 +05:00
if o.CompressionLevel == 0 {
o.CompressionLevel = defaultOptions.CompressionLevel
}
}