update
This commit is contained in:
@ -1,38 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
var DownloadFolder string
|
||||
var HTTPPort string
|
||||
var DBName string
|
||||
var TMDbApiKey string
|
||||
|
||||
func Load() {
|
||||
if err := godotenv.Load(); err != nil {
|
||||
log.Println("Error loading .env file ...")
|
||||
log.Println("Using default configuration")
|
||||
}
|
||||
|
||||
if DownloadFolder = os.Getenv("DOWNLOAD_FOLDER"); DownloadFolder == "" {
|
||||
DownloadFolder = "/home/rouggy/torrents/rtorrent/Race"
|
||||
}
|
||||
|
||||
if HTTPPort = os.Getenv("HTTP_PORT"); HTTPPort == "" {
|
||||
HTTPPort = "9000"
|
||||
}
|
||||
|
||||
if DBName = os.Getenv("DB_NAME"); DBName == "" {
|
||||
DBName = "racerdb"
|
||||
}
|
||||
|
||||
if TMDbApiKey = os.Getenv("TMDB_APIKEY"); TMDbApiKey == "" {
|
||||
log.Println("TMDb Api Key cannot be empty...")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user