photoprism/internal/config/expand.go
Michael Mayer 61ced7119c Auth: Refactor cluster configuration and provisioning API endpoints #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-24 08:28:38 +02:00

17 lines
351 B
Go

package config
import (
"os"
)
// Vars represents a map of variable names to values.
type Vars = map[string]string
// ExpandVars replaces variables in the format ${NAME} with their corresponding values.
func ExpandVars(s string, vars Vars) string {
if s == "" {
return s
}
return os.Expand(s, func(key string) string { return vars[key] })
}