mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
parent
c53df2dc88
commit
6f24082705
10 changed files with 123 additions and 2 deletions
39
vendor/github.com/okzk/sdnotify/util.go
generated
vendored
Normal file
39
vendor/github.com/okzk/sdnotify/util.go
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package sdnotify
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ErrSdNotifyNoSocket is the error returned when the NOTIFY_SOCKET does not exist.
|
||||
var ErrSdNotifyNoSocket = errors.New("No socket")
|
||||
|
||||
// Ready sends READY=1 to the systemd notify socket.
|
||||
func Ready() error {
|
||||
return SdNotify("READY=1")
|
||||
}
|
||||
|
||||
// Stopping sends STOPPING=1 to the systemd notify socket.
|
||||
func Stopping() error {
|
||||
return SdNotify("STOPPING=1")
|
||||
}
|
||||
|
||||
// Reloading sends RELOADING=1 to the systemd notify socket.
|
||||
func Reloading() error {
|
||||
return SdNotify("RELOADING=1")
|
||||
}
|
||||
|
||||
// Errno sends ERRNO=? to the systemd notify socket.
|
||||
func Errno(errno int) error {
|
||||
return SdNotify(fmt.Sprintf("ERRNO=%d", errno))
|
||||
}
|
||||
|
||||
// Status sends STATUS=? to the systemd notify socket.
|
||||
func Status(status string) error {
|
||||
return SdNotify("STATUS=" + status)
|
||||
}
|
||||
|
||||
// Watchdog sends WATCHDOG=1 to the systemd notify socket.
|
||||
func Watchdog() error {
|
||||
return SdNotify("WATCHDOG=1")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue