feat: add ability to override the UI configuration with environment variables

This commit is contained in:
Elias Schneider
2025-02-12 14:20:52 +01:00
parent 2d78349b38
commit 4e858420e9
5 changed files with 65 additions and 21 deletions

View File

@@ -5,6 +5,8 @@ import (
"fmt"
"math/big"
"net/url"
"regexp"
"strings"
"unicode"
)
@@ -62,3 +64,12 @@ func CamelCaseToSnakeCase(s string) string {
}
return string(result)
}
func CamelCaseToScreamingSnakeCase(s string) string {
// Insert underscores before uppercase letters (except the first one)
re := regexp.MustCompile(`([a-z0-9])([A-Z])`)
snake := re.ReplaceAllString(s, `${1}_${2}`)
// Convert to uppercase
return strings.ToUpper(snake)
}