Documentation
¶
Index ¶
- func DetachProcess(cmd *exec.Cmd)
- func HideWindow(_ *exec.Cmd)
- func LockFile(f *os.File) error
- func LooksAbsolutePath(path string) bool
- func NormalizePathForCompare(p string) string
- func SafeRename(src, dst string) error
- func SetProcessGroup(cmd *exec.Cmd)
- func TermSignals() []os.Signal
- func UnlockFile(f *os.File) error
- func WithoutLoopbackProxies(env []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetachProcess ¶
DetachProcess configures cmd to run in a new session, detached from the parent. The child survives the parent exiting.
func HideWindow ¶ added in v0.3.2
HideWindow is a no-op on Unix. On Windows it suppresses console window creation for subprocess invocations from detached workers.
func LooksAbsolutePath ¶
LooksAbsolutePath returns true if path looks like an absolute path on any OS. Unlike filepath.IsAbs, this recognizes POSIX-style absolute paths (/workspace/...) even on Windows, which is needed for file paths from agent payloads that may use POSIX conventions regardless of host OS.
func NormalizePathForCompare ¶ added in v0.3.2
NormalizePathForCompare returns a path suitable for case-aware prefix matching. On Windows, paths are lowercased because the filesystem is case-insensitive (C:\Users and c:\Users are the same path). On macOS/Linux, the path is returned unchanged.
func SafeRename ¶
SafeRename moves src to dst, replacing dst if it exists. On Windows, removes dst first (os.Rename cannot overwrite) and retries only on transient sharing-violation errors from antivirus or search indexing. Non-transient errors fail immediately. This is NOT atomic on Windows.
func SetProcessGroup ¶
SetProcessGroup configures cmd to run in a new process group.
func TermSignals ¶
TermSignals returns the signals to listen for graceful shutdown.
func WithoutLoopbackProxies ¶ added in v0.3.5
WithoutLoopbackProxies returns a copy of env with any proxy variable whose value points at a literal loopback host removed. Other entries are preserved in their original order.
This drops short-lived localhost proxies inherited from the parent process while keeping real forward proxies in place.
Loopback recognition is syntactic only - no DNS resolution is performed, keeping the function deterministic and side-effect free on the spawn path. A host is treated as loopback when it is exactly "localhost" or when it parses as an IP inside 127.0.0.0/8 or equal to "::1". Scheme-less values like "127.0.0.1:64788" are parsed as if they had an "http://" prefix for inspection only.
Types ¶
This section is empty.