hoster/internals/conf/loader.go

25 lines
395 B
Go
Raw Permalink Normal View History

2024-08-28 12:31:17 +02:00
package conf
import (
"github.com/gookit/config/v2"
"github.com/gookit/config/v2/yaml"
"github.com/kataras/golog"
)
var cfgPath string
var App *config.Config
func LoadConfig(path string) *config.Config {
App = config.New("appCfg")
cfgPath = path
App.AddDriver(yaml.Driver)
err := App.LoadFiles(path)
if err != nil {
golog.Fatalf("Error loading config: %v", err)
}
return App
}