frostfs-locode-db/pkg/locode/table/csv/opts.go
George Bartolomey 840b20538b
[#7] Add local tool for building database file
Added frostfs-locode-db CLI utility that can generate and view UN/LOCODE
database files. Go package
git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/locode copied to
this repository to eliminate interdependency between frostfs-node and
frostfs-locode-db projects. The process of building database files
reduced to starting make command.

Signed-off-by: George Bartolomey <george@bh4.ru>
2024-07-09 18:54:05 +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...)
}
}