Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileLock ¶
type FileLock struct {
// contains filtered or unexported fields
}
FileLock manages exclusive file locking for single-instance enforcement. The lock is automatically released when the process dies, even if it crashes. It also stores the current process PID for signal-based shutdown.
func NewFileLock ¶
NewFileLock creates a new file lock instance. The lock file will be created in the specified config directory.
func (*FileLock) GetLockFilePath ¶
GetLockFilePath returns the lock file path for debugging purposes.
func (*FileLock) GetPID ¶
GetPID returns the PID stored in the lock file. Returns error if the lock file doesn't exist or contains invalid data.
func (*FileLock) IsLocked ¶
IsLocked checks if the lock is currently held by another process. Returns false if the lock is available or if this process holds it.