Documentation
¶
Index ¶
- func BaseDir() string
- func CheckAndClean(name string) (bool, error)
- func Delete(name string) error
- func EnsureLogDir() error
- func IsRunning(state *DaemonState) bool
- func KillDaemon(state *DaemonState) error
- func LockPath(name string) string
- func LogDir() string
- func LogPath(name string) string
- func Save(state *DaemonState) error
- func StateDir() string
- func StatePath(name string) string
- func VerifyPID(pid int) bool
- func WithLock(name string, timeout time.Duration, fn func() error) error
- type DaemonState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndClean ¶
CheckAndClean checks if a state file exists and if the process is running. If the process is dead, it removes the state file and returns true (cleaned). If the process is running, it returns false (not cleaned). If no state file exists, it returns false.
func EnsureLogDir ¶
func EnsureLogDir() error
EnsureLogDir creates the log directory if it doesn't exist.
func IsRunning ¶
func IsRunning(state *DaemonState) bool
IsRunning checks if the daemon process is still running.
func KillDaemon ¶
func KillDaemon(state *DaemonState) error
KillDaemon sends SIGTERM to the daemon process, waits up to 5 seconds for graceful shutdown, then sends SIGKILL if the process is still running.
func StateDir ¶
func StateDir() string
StateDir returns the directory for state files (~/.gridctl/state/).
Types ¶
Click to show internal directories.
Click to hide internal directories.