39 lines
630 B
Go
39 lines
630 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
"istheinternetonfire.app/internal/cisa"
|
|
"istheinternetonfire.app/internal/config"
|
|
"istheinternetonfire.app/internal/webserver"
|
|
)
|
|
|
|
func forever() {
|
|
c := make(chan os.Signal, 1)
|
|
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
|
|
|
sig := <-c
|
|
log.Printf("[WARNING] shutting down, detected signal: %s", sig)
|
|
}
|
|
|
|
func main() {
|
|
// initialize all parameters
|
|
config.Init()
|
|
|
|
// configure shutdown sequence
|
|
defer func() {
|
|
log.Printf("[TRACE] shutdown sequence complete")
|
|
}()
|
|
|
|
// start webserver
|
|
go webserver.Start()
|
|
|
|
// get remote data
|
|
go cisa.Start()
|
|
|
|
forever()
|
|
}
|