diff --git a/cmd/neofs-node/config/config.go b/cmd/neofs-node/config/config.go index fbad8f6ea..080a88f6d 100644 --- a/cmd/neofs-node/config/config.go +++ b/cmd/neofs-node/config/config.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" + "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/internal" "github.com/spf13/viper" ) @@ -19,11 +20,7 @@ type Config struct { path []string } -const ( - separator = "." - envPrefix = "neofs" - envSeparator = "_" -) +const separator = "." // Prm groups required parameters of the Config. type Prm struct{} @@ -36,9 +33,9 @@ type Prm struct{} func New(_ Prm, opts ...Option) *Config { v := viper.New() - v.SetEnvPrefix(EnvPrefix) + v.SetEnvPrefix(internal.EnvPrefix) v.AutomaticEnv() - v.SetEnvKeyReplacer(strings.NewReplacer(separator, EnvSeparator)) + v.SetEnvKeyReplacer(strings.NewReplacer(separator, internal.EnvSeparator)) o := defaultOpts() for i := range opts { diff --git a/cmd/neofs-node/config/internal/env.go b/cmd/neofs-node/config/internal/env.go new file mode 100644 index 000000000..e51742543 --- /dev/null +++ b/cmd/neofs-node/config/internal/env.go @@ -0,0 +1,8 @@ +package internal + +// EnvPrefix is a prefix of ENV variables related +// to storage node configuration. +const EnvPrefix = "neofs" + +// EnvSeparator is a section separator in ENV variables. +const EnvSeparator = "_"