-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
33 lines (28 loc) · 887 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"github.com/AlexxIT/openmiio_agent/internal/app"
"github.com/AlexxIT/openmiio_agent/internal/cache"
"github.com/AlexxIT/openmiio_agent/internal/central"
"github.com/AlexxIT/openmiio_agent/internal/lua"
"github.com/AlexxIT/openmiio_agent/internal/miio"
"github.com/AlexxIT/openmiio_agent/internal/mqtt"
"github.com/AlexxIT/openmiio_agent/internal/store"
"github.com/AlexxIT/openmiio_agent/internal/zigbee"
"github.com/rs/zerolog/log"
"os"
"os/signal"
"syscall"
)
func main() {
app.Init() // before all
store.Init()
lua.Init() // before mqtt
miio.Init() // optional, before mqtt
zigbee.Init() // optional
cache.Init() // optional, after store
mqtt.Init() // optional
central.Init() // optional
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
log.Log().Stringer("signal", <-sigs).Msg("exit")
}