mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
20 lines
404 B
Go
20 lines
404 B
Go
package controllerutils
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/formancehq/operator/internal/collectionutils"
|
|
)
|
|
|
|
func EnvVarPlaceholder(key, prefix string) string {
|
|
return fmt.Sprintf("$(%s%s)", prefix, key)
|
|
}
|
|
|
|
func ComputeEnvVar(prefix, format string, keys ...string) string {
|
|
return fmt.Sprintf(format,
|
|
collectionutils.Map(keys, func(key string) any {
|
|
return EnvVarPlaceholder(key, prefix)
|
|
})...,
|
|
)
|
|
}
|