26 lines
347 B
Go
26 lines
347 B
Go
|
package services
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"os"
|
||
|
|
||
|
"github.com/joho/godotenv"
|
||
|
)
|
||
|
|
||
|
type EnvConfig struct {
|
||
|
ApiServerUri string
|
||
|
CookieSecret string
|
||
|
}
|
||
|
|
||
|
func NewEnvConfig() EnvConfig {
|
||
|
err := godotenv.Load()
|
||
|
if err != nil {
|
||
|
log.Println(err)
|
||
|
}
|
||
|
|
||
|
return EnvConfig{
|
||
|
ApiServerUri: os.Getenv("ApiServerUri"),
|
||
|
CookieSecret: os.Getenv("CookieSecret"),
|
||
|
}
|
||
|
}
|