func main() { prg := &entranced{} //注册运行windows服务svc.Service接口 if err := svc.Run(prg); err != nil { log.Fatal(err) } }
func main() { defer glog.Flush() prg := &program{} if err := svc.Run(prg, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGINT); err != nil { log.Fatal(err) } }
func main() { prg := &program{} if err := svc.Run(prg, syscall.SIGINT, syscall.SIGTERM); err != nil { log.Fatal(err) } }
func main() { prg := &program{} if err := svc.Run(prg); err != nil { log.Fatal(err) } }