dissertation-2-code/main.go
Jake Hillion d65e8d3571
Some checks failed
continuous-integration/drone/push Build is failing
udp testing
2020-11-26 22:10:37 +00:00

44 lines
641 B
Go

package main
import (
"log"
"mpbl3p/config"
"os"
"os/signal"
"syscall"
)
func main() {
log.SetFlags(log.Ldate | log.Ltime | log.Llongfile)
log.Println("loading config...")
var configLoc string
if v, ok := os.LookupEnv("CONFIG_LOC"); ok {
configLoc = v
} else {
configLoc = "config.ini"
}
c, err := config.LoadConfig(configLoc)
if err != nil {
panic(err)
}
log.Println("building config...")
p, err := c.Build()
if err != nil {
panic(err)
}
log.Println("starting...")
p.Start()
log.Println("running")
signals := make(chan os.Signal)
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
<-signals
}