us-dop-api/config/config.go
2024-07-21 11:30:05 -04:00

26 lines
387 B
Go

package config
import (
"log"
"os"
)
func GetNatsURI() string {
return getEnvVariable("NATSURI")
}
func GetDollarServiceURL() string {
return getEnvVariable("DOLLAR_SERVICE_URL")
}
func GetEnvironment() string {
return getEnvVariable("ENV")
}
func getEnvVariable(key string) string {
if os.Getenv(key) == "" {
log.Fatal("error getting key", key)
}
return os.Getenv(key)
}