frostfs-node/cmd/neofs-node/config/internal/env.go
Leonard Lyubich 099ceeae50 [] node/config: Implement ENV variable key constructor
Add `internal.Env` function which converts path to config value to ENV
variable key.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-01 11:45:38 +03:00

22 lines
443 B
Go

package internal
import (
"strings"
)
// 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 = "_"
// Env returns ENV variable key for particular config parameter.
func Env(path ...string) string {
return strings.ToUpper(
strings.Join(
append([]string{EnvPrefix}, path...),
EnvSeparator,
),
)
}