feat(proxy): add sd_notify support

This commit is contained in:
KokaKiwi 2025-06-26 02:03:04 +02:00
parent 70974640ab
commit fa5be44b69
No known key found for this signature in database
GPG key ID: FD333F84686EFE78
4 changed files with 43 additions and 0 deletions

23
proxy/lib/systemd.go Normal file
View file

@ -0,0 +1,23 @@
package snowflake_proxy
import (
"fmt"
sdnotify "github.com/coreos/go-systemd/v22/daemon"
)
func sdnotifyReady() {
sdnotify.SdNotify(false, sdnotify.SdNotifyReady)
}
func sdnotifyStopping() {
sdnotify.SdNotify(false, sdnotify.SdNotifyStopping)
}
func sdnotifyStatus(status string) {
sdnotify.SdNotify(false, fmt.Sprintf("STATUS=%s", status))
}
func sdnotifyWatchdog() {
sdnotify.SdNotify(false, sdnotify.SdNotifyWatchdog)
}