mirror-nourybot/internal/config/config.go

27 lines
448 B
Go
Raw Normal View History

2022-04-26 06:30:53 +02:00
package config
2022-08-06 23:45:02 +02:00
import (
"log"
"os"
"github.com/joho/godotenv"
)
type Config struct {
TwitchUsername string
TwitchOauth string
Environment string
}
func New() *Config {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
twitchUsername := os.Getenv("TWITCH_USERNAME")
twitchOauth := os.Getenv("TWITCH_OAUTH")
environment := "Development"
return &Config{twitchUsername, twitchOauth, environment}
}