frostfs-node/pkg/util/locode/table/csv/opts.go
Dmitrii Stepanov 79088baa06 [#772] node: Apply gofumpt
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-10-31 17:03:03 +03:00

28 lines
462 B
Go

package csvlocode
import (
"io/fs"
)
// Option sets an optional parameter of Table.
type Option func(*options)
type options struct {
mode fs.FileMode
extraPaths []string
}
func defaultOpts() *options {
return &options{
mode: 0o700,
}
}
// WithExtraPaths returns an option to add extra paths
// to UN/LOCODE tables in csv format.
func WithExtraPaths(ps ...string) Option {
return func(o *options) {
o.extraPaths = append(o.extraPaths, ps...)
}
}