main.go 366 B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "log"
  4. "os"
  5. "os/signal"
  6. "net/http"
  7. _ "net/http/pprof"
  8. )
  9. const version = "2.0.0"
  10. type ctxKey string
  11. func main() {
  12. go func() {
  13. log.Println(http.ListenAndServe("localhost:6060", nil))
  14. }()
  15. s := startServer()
  16. stop := make(chan os.Signal, 1)
  17. signal.Notify(stop, os.Interrupt, os.Kill)
  18. <-stop
  19. shutdownServer(s)
  20. shutdownVips()
  21. }