main.go 514 B

1234567891011121314151617181920212223242526272829303132
  1. package main
  2. import (
  3. "dhcp/initialize"
  4. "os"
  5. "os/signal"
  6. "syscall"
  7. )
  8. // @title smee
  9. // @version 1.0
  10. // @description ipxe管理.
  11. // @securityDefinitions.apikey ApiKeyAuth
  12. // @in header
  13. // @name Authorization
  14. func main() {
  15. // 初始化日志
  16. initialize.InitLogger("info")
  17. //初始化http服务
  18. r := initialize.InitRouter()
  19. if err := r.Run("0.0.0.0:9999"); err != nil {
  20. panic(err)
  21. }
  22. //优雅退出
  23. quit := make(chan os.Signal)
  24. signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
  25. <-quit
  26. }