migrate orion repo into monorepo structure

This commit is contained in:
talksik
2026-02-21 08:48:34 -08:00
parent 144596fcaa
commit b5f90709de
91 changed files with 19775 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
package utils
import (
"os"
"github.com/sirupsen/logrus"
)
// enum of environment variables
type EnvVar string
const ()
// MustGetEnv returns the value of the environment variable with the given key.
// panics if the variable is not set.
func MustGetEnv[T string | EnvVar](key T) string {
keyString := string(key)
value := os.Getenv(keyString)
if value == "" {
logrus.Errorf("Missing required environment variable %s", key)
panic("Missing required environment variable")
}
return value
}
// GetEnv returns the value of the environment variable with the given key.
// returns an empty string if the variable is not set.
func GetEnv(key string) string {
value := os.Getenv(key)
if value == "" {
logrus.Warnf("Missing optional environment variable %s", key)
}
return value
}