Documentation
¶
Index ¶
- func ActivateDevelopmentEnvironment() error
- func ConfigPath() string
- func DevelopmentEnvironmentTempDir() (string, bool)
- func DirOrHome(dir string) string
- func ProcessArgv(pid int) ([]string, error)
- func ProcessComm(pid int) (string, error)
- func ProcessCwd(pid int) (string, error)
- func ProcessGroupArgv(pgid int, shellPid int) ([]string, error)
- func RuntimeDirFor(getenv func(string) string, cwd string) string
- func StateDir() string
- type ProcessInspector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateDevelopmentEnvironment ¶
func ActivateDevelopmentEnvironment() error
ActivateDevelopmentEnvironment redirects vev's XDG roots into an isolated development tree when VEV_ENV is set. The absolute .dev base is retained in VEV_ENV_ROOT so re-executed roles do not rebase after changing directory.
func ConfigPath ¶
func ConfigPath() string
ConfigPath returns the user config file path: $XDG_CONFIG_HOME/vev/config if set, else ~/.config/vev/config.
func DevelopmentEnvironmentTempDir ¶
DevelopmentEnvironmentTempDir returns the private temporary-file directory for an activated development environment. Ordinary invocations use the existing os.TempDir fallback in the daemon.
func DirOrHome ¶
DirOrHome returns dir when it names an existing directory. Otherwise it falls back to the current user's home directory, then to / as a last resort.
func ProcessArgv ¶
ProcessArgv returns argv from /proc/<pid>/cmdline.
func ProcessComm ¶
ProcessComm returns the command name from /proc/<pid>/comm.
func ProcessCwd ¶
ProcessCwd returns the current working directory for a Linux process.
func ProcessGroupArgv ¶
ProcessGroupArgv returns argv for a restorable foreground process in pgid. A bare pane shell (the only process in its foreground group) returns nil argv.
func RuntimeDirFor ¶
RuntimeDirFor returns the XDG_RUNTIME_DIR a vev process with environment getenv and working directory cwd uses once VEV_ENV is activated. It lets a caller resolve another process' runtime from its initial environment.
Types ¶
type ProcessInspector ¶
type ProcessInspector struct {
// contains filtered or unexported fields
}
ProcessInspector implements ports.ProcessInspector using Linux /proc.
func NewProcessInspector ¶
func NewProcessInspector() *ProcessInspector
NewProcessInspector returns a Linux /proc-backed process inspector.
func (*ProcessInspector) Argv ¶
func (p *ProcessInspector) Argv(pid int) ([]string, error)
func (*ProcessInspector) Comm ¶
func (p *ProcessInspector) Comm(pid int) (string, error)
func (*ProcessInspector) Cwd ¶
func (p *ProcessInspector) Cwd(pid int) (string, error)
Source Files
¶
- dir.go
- proc_linux.go
- process.go
- process_linux.go