mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Start to use leveled log
This commit is contained in:
@ -9,6 +9,7 @@ type __options__ struct {
|
||||
bufferSize int
|
||||
batchSize int
|
||||
parallelWorkers int
|
||||
noSingleton bool
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
@ -27,6 +28,7 @@ func MakeOptions(setters []WithOption) Options {
|
||||
bufferSize: 2,
|
||||
batchSize: 5000,
|
||||
parallelWorkers: 4,
|
||||
noSingleton: false,
|
||||
}
|
||||
|
||||
opt := Options{&o}
|
||||
@ -79,6 +81,10 @@ func (opt Options) SortOnDisk() bool {
|
||||
return opt.pointer.cacheOnDisk
|
||||
}
|
||||
|
||||
func (opt Options) NoSingleton() bool {
|
||||
return opt.pointer.noSingleton
|
||||
}
|
||||
|
||||
func OptionSortOnDisk() WithOption {
|
||||
f := WithOption(func(opt Options) {
|
||||
opt.pointer.cacheOnDisk = true
|
||||
@ -149,3 +155,19 @@ func OptionsBufferSize(size int) WithOption {
|
||||
|
||||
return f
|
||||
}
|
||||
|
||||
func OptionsNoSingleton() WithOption {
|
||||
f := WithOption(func(opt Options) {
|
||||
opt.pointer.noSingleton = true
|
||||
})
|
||||
|
||||
return f
|
||||
}
|
||||
|
||||
func OptionsWithSingleton() WithOption {
|
||||
f := WithOption(func(opt Options) {
|
||||
opt.pointer.noSingleton = false
|
||||
})
|
||||
|
||||
return f
|
||||
}
|
||||
|
Reference in New Issue
Block a user