forked from TrueCloudLab/frostfs-node
[#493] 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>
This commit is contained in:
parent
270b147205
commit
099ceeae50
2 changed files with 29 additions and 0 deletions
|
@ -1,8 +1,22 @@
|
|||
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,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue