Files
cc-hook/config.go
T

25 lines
437 B
Go
Raw Normal View History

package main
import "os"
type Config struct {
GotifyURL string
GotifyToken string
Port string
}
func LoadConfig() Config {
return Config{
GotifyURL: getEnv("GOTIFY_URL", "http://47.121.181.112:40266"),
GotifyToken: getEnv("GOTIFY_TOKEN", "AiousrPBE4Cn04C"),
Port: getEnv("PORT", ":8082"),
}
}
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}