forked from TrueCloudLab/frostfs-node
f564430b90
Make O_SYNC the default and allow to opt-out explicitly. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
37 lines
492 B
Go
37 lines
492 B
Go
package fstree
|
|
|
|
import (
|
|
"io/fs"
|
|
)
|
|
|
|
type Option func(*FSTree)
|
|
|
|
func WithDepth(d uint64) Option {
|
|
return func(f *FSTree) {
|
|
f.Depth = d
|
|
}
|
|
}
|
|
|
|
func WithDirNameLen(l int) Option {
|
|
return func(f *FSTree) {
|
|
f.DirNameLen = l
|
|
}
|
|
}
|
|
|
|
func WithPerm(p fs.FileMode) Option {
|
|
return func(f *FSTree) {
|
|
f.Permissions = p
|
|
}
|
|
}
|
|
|
|
func WithPath(p string) Option {
|
|
return func(f *FSTree) {
|
|
f.RootPath = p
|
|
}
|
|
}
|
|
|
|
func WithNoSync(noSync bool) Option {
|
|
return func(f *FSTree) {
|
|
f.noSync = noSync
|
|
}
|
|
}
|