[#598] misc: Remove global prefixes

New config package in storage node does not use
application prefix from misc package. Therefore
inner ring node can define prefix in local scope.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-06-09 14:03:09 +03:00 committed by Alex Vanin
parent e50abeab0c
commit caafd973e4
2 changed files with 3 additions and 10 deletions

View file

@ -4,17 +4,18 @@ import (
"strings" "strings"
"time" "time"
"github.com/nspcc-dev/neofs-node/misc"
"github.com/spf13/viper" "github.com/spf13/viper"
) )
func newConfig(path string) (*viper.Viper, error) { func newConfig(path string) (*viper.Viper, error) {
const innerRingPrefix = "neofs_ir"
var ( var (
err error err error
v = viper.New() v = viper.New()
) )
v.SetEnvPrefix(misc.InnerRingPrefix) v.SetEnvPrefix(innerRingPrefix)
v.AutomaticEnv() v.AutomaticEnv()
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))

View file

@ -1,13 +1,5 @@
package misc package misc
const (
// Prefix is a neofs node application prefix.
Prefix = "neofs"
// InnerRingPrefix is an inner ring application prefix.
InnerRingPrefix = "neofs_ir"
)
// These variables are changed in compile time. // These variables are changed in compile time.
var ( var (
// Build is an application build time. // Build is an application build time.