main.go 378 B

12345678910111213141516171819
  1. package config
  2. import "os"
  3. func GetConfig() config {
  4. if !envLoaded {
  5. loadEnv()
  6. }
  7. return config{
  8. DatabaseUrl: getDatabaseUrl(),
  9. LogLevel: getLogLevel(),
  10. LibraryDirectory: os.Getenv("LIBRARY_DIRECTORY"),
  11. Host: getListenHost(),
  12. Port: getPort(),
  13. RedisUrl: getRedisUrl(),
  14. AllowedOrigins: getAllowedOrigins(),
  15. }
  16. }