Initial commit

This commit is contained in:
Magnus Åhall 2026-02-20 13:26:21 +01:00
commit 36baaf0caf
10 changed files with 961 additions and 0 deletions

40
config.go Normal file
View file

@ -0,0 +1,40 @@
package main
import (
// Standard
"encoding/json"
"os"
)
type Config struct {
Network struct {
Address string
Port int
}
Logging struct {
URL string
System string
Instance string
LogDir string
}
Device struct {
Address string
Port int
Username string
Password string
Timeout int
}
}
func readConfig() (config Config, err error) {
var configData []byte
configData, err = os.ReadFile(flagConfig)
if err != nil {
return
}
err = json.Unmarshal(configData, &config)
return
}