frostfs-node/cmd/frostfs-node/config/opts.go
Denis Kirillov 87e69b9349 [#44] node: Support multiple configs
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2023-02-21 10:00:28 +03:00

29 lines
580 B
Go

package config
type opts struct {
path string
configDir string
}
func defaultOpts() *opts {
return new(opts)
}
// Option allows to set an optional parameter of the Config.
type Option func(*opts)
// WithConfigFile returns an option to set the system path
// to the configuration file.
func WithConfigFile(path string) Option {
return func(o *opts) {
o.path = path
}
}
// WithConfigDir returns an option to set the system path
// to the directory with configuration files.
func WithConfigDir(path string) Option {
return func(o *opts) {
o.configDir = path
}
}