Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemovePidFile ¶
func RemovePidFile(homePath string)
RemovePidFile deletes the PID file (e.g. on graceful shutdown).
Types ¶
type PidFileData ¶
type PidFileData struct {
PID int `json:"pid"`
Token string `json:"token"`
Version string `json:"version"`
Port int `json:"port"`
Host string `json:"host"`
}
PidFileData is the JSON structure stored in the PID file.
func ReadPidFileWithCheck ¶
func ReadPidFileWithCheck(homePath string) *PidFileData
ReadPidFileWithCheck reads the PID file and additionally checks if the recorded process is still alive. Returns nil if the file is missing, unreadable, or the process has exited.
func WritePidFile ¶
func WritePidFile(homePath, host string, port int) (*PidFileData, error)
WritePidFile creates (or overwrites) the PID file atomically. It returns an error if another gateway instance appears to be running (a valid PID file exists with a live process).
Click to show internal directories.
Click to hide internal directories.