Daemon is an easy to start application as a system service.
go get github.com/lawyzheng/daemon
ctl, err := NewController(app, &service.Config{
Name: "My Service Name",
DisplayName: "My Service Display Name",
Description: "My Service Discription",
})
if err != nil {
// handler error
panic(err)
}
// Install Service
ctl.Install()
// Uninstall Service
ctl.Uninstall()
// Start Service
ctl.Start()
// Stop Service
ctl.Stop()
// Restart Service
ctl.Restart()
// Run Service
ctl.Run()