commit 1437edd55a989d1613bc8830a5b83fdd20731de9 Author: speatzle Date: Thu Apr 25 21:53:01 2024 +0200 Initial commit diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..65df1c9 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module git.lastassault.de/speatzle/morffix + +go 1.21.8 + +require github.com/BurntSushi/toml v1.3.2 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..ef0f966 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= diff --git a/main.go b/main.go new file mode 100644 index 0000000..9350d03 --- /dev/null +++ b/main.go @@ -0,0 +1,31 @@ +package main + +import ( + "log/slog" + "os" + + "github.com/BurntSushi/toml" +) + +type Config struct { + Server bool +} + +var conf Config + +func main() { + slog.Info("Starting...") + + confPath := "config.toml" + _, err := os.Stat(confPath) + if err != nil { + confPath = "/etc/morffix/config.toml" + } + + _, err = toml.DecodeFile(confPath, &conf) + if err != nil { + slog.Error("Error Loading Config", "err", err) + return + } + +}