在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:sevlyar/go-daemon开源软件地址:https://github.com/sevlyar/go-daemon开源编程语言:Go 100.0%开源软件介绍:go-daemonLibrary for writing system daemons in Go. Now supported only UNIX-based OS (Windows is not supported). But the library was tested only on Linux and OSX, so that if you have an ability to test the library on other platforms, give me feedback, please (#26). Please, feel free to send me bug reports and fixes. Many thanks to all contributors. Features
Installation
You can use gopkg.in:
If you want to use the library in production project, please use vendoring, because i can not ensure backward compatibility before release v1.0. ExamplesDocumentationgodoc.org/github.com/sevlyar/go-daemon How it worksWe can not use import "log"
func main() {
Pre()
context := new(Context)
child, _ := context.Reborn()
if child != nil {
PostParent()
} else {
defer func() {
if err := context.Release(); err != nil {
log.Printf("Unable to release pid-file: %s", err.Error())
}
}()
PostChild()
}
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论