mirror of
https://github.com/sascha-hemi/spaceDevices.git
synced 2026-03-21 03:04:20 +01:00
29 lines
691 B
Go
29 lines
691 B
Go
package main
|
|
|
|
import (
|
|
"github.com/ktt-ol/spaceDevices/conf"
|
|
"github.com/ktt-ol/spaceDevices/db"
|
|
"github.com/ktt-ol/spaceDevices/mqtt"
|
|
"github.com/ktt-ol/spaceDevices/webService"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
const CONFIG_FILE = "config.toml"
|
|
|
|
func main() {
|
|
log.SetLevel(log.DebugLevel)
|
|
log.SetFormatter(&log.TextFormatter{DisableColors: true})
|
|
|
|
config := conf.LoadConfig(CONFIG_FILE)
|
|
|
|
//spaceDevices.EnableMqttDebugLogging()
|
|
|
|
userDb := db.NewUserDb(config.MacDb)
|
|
masterDb := db.NewMasterDb(config.MacDb)
|
|
|
|
mqttHandler := mqtt.NewMqttHandler(config.Mqtt)
|
|
data := mqtt.NewDeviceData(mqttHandler, masterDb, userDb)
|
|
|
|
webService.StartWebService(config.Server, data, userDb)
|
|
}
|