Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockFile ¶
type LockFile struct {
// contains filtered or unexported fields
}
LockFile represents an exclusive file lock.
func ForSubscribe ¶
ForSubscribe returns a LockFile scoped to the event subscribe command for a given App ID. Lock path: {configDir}/locks/subscribe_{appID}.lock
The appID is sanitized to prevent path traversal: any character outside [a-zA-Z0-9._-] is replaced with "_", and filepath.Base strips directory components, so a malicious appID like "../../tmp/evil" becomes a flat filename under the locks directory.
func (*LockFile) TryLock ¶
TryLock attempts to acquire an exclusive, non-blocking lock. Returns nil on success. Returns an error if the lock is already held by another process (or on any other failure). The lock is automatically released when the process exits.