|
package main
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
)
|
|
|
|
func main() {
|
|
httpd := &GoHttp{}
|
|
httpd.LoadConfig("")
|
|
httpd.Start()
|
|
var waiter = make(chan os.Signal, 1) // buffered channel
|
|
signal.Notify(waiter, syscall.SIGTERM, syscall.SIGINT)
|
|
|
|
// blocks here until there's a signal
|
|
<-waiter
|
|
|
|
}
|