Add capacity to obidistribute to save gzipped files

This commit is contained in:
2023-02-17 12:52:19 +01:00
parent 6fd426d8be
commit 9554a32490
9 changed files with 124 additions and 30 deletions

View File

@ -14,6 +14,7 @@ type __options__ struct {
parallel_workers int
closefile bool
appendfile bool
compressed bool
}
type Options struct {
@ -33,6 +34,7 @@ func MakeOptions(setters []WithOption) Options {
batch_size: 5000,
closefile: false,
appendfile: false,
compressed: false,
}
opt := Options{&o}
@ -80,6 +82,10 @@ func (opt Options) AppendFile() bool {
return opt.pointer.appendfile
}
func (opt Options) CompressedFile() bool {
return opt.pointer.compressed
}
func OptionsBufferSize(size int) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.buffer_size = size
@ -112,6 +118,14 @@ func OptionsAppendFile() WithOption {
return f
}
func OptionsCompressed() WithOption {
f := WithOption(func(opt Options) {
opt.pointer.compressed = true
})
return f
}
func OptionsNewFile() WithOption {
f := WithOption(func(opt Options) {
opt.pointer.appendfile = false