2023-12-07 00:22:53 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-12-07 22:42:27 +08:00
|
|
|
"os"
|
|
|
|
"os/signal"
|
|
|
|
"syscall"
|
2023-12-07 00:22:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-12-08 22:02:36 +08:00
|
|
|
httpd := &GoHttp{}
|
|
|
|
httpd.LoadConfig("")
|
|
|
|
httpd.Start()
|
2023-12-07 22:42:27 +08:00
|
|
|
var waiter = make(chan os.Signal, 1) // buffered channel
|
|
|
|
signal.Notify(waiter, syscall.SIGTERM, syscall.SIGINT)
|
|
|
|
|
|
|
|
// blocks here until there's a signal
|
|
|
|
<-waiter
|
2023-12-08 22:02:36 +08:00
|
|
|
|
2023-12-07 00:22:53 +08:00
|
|
|
}
|