This commit is contained in:
33
src/tsm/tsm.go
Normal file
33
src/tsm/tsm.go
Normal file
@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"tsm/config"
|
||||
"tsm/mqtt"
|
||||
"tsm/tsmq"
|
||||
)
|
||||
|
||||
|
||||
func main() {
|
||||
log.SetPrefix("TSM: ")
|
||||
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
|
||||
|
||||
log.Println("starting")
|
||||
|
||||
config.LoadConfiguration()
|
||||
|
||||
mqtt.Start()
|
||||
defer mqtt.Stop()
|
||||
|
||||
tsmq.Start()
|
||||
defer tsmq.Stop()
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, os.Kill)
|
||||
<- c
|
||||
|
||||
log.Println("terminating")
|
||||
}
|
Reference in New Issue
Block a user