us-dop-bot/config/config.go
maximo tejeda ceb402a65d
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s
INITIAL COMMIT
2024-07-21 11:40:07 -04:00

38 lines
598 B
Go

package config
import (
"log"
"os"
)
func GetToken() string {
return getEnvVariable("TOKEN")
}
func GetDBUSERURI() string {
return getEnvVariable("DBURIUSER")
}
func GetNatsURI() string {
return getEnvVariable("NATSURI")
}
func GetDollarServiceURL() string {
return getEnvVariable("DOLLAR_SERVICE_URL")
}
func GetUserServiceURL() string {
return getEnvVariable("TGBUSER_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)
}