Documentation
¶
Index ¶
- func FindProcessByCmdline(cmdline string) ([]*os.Process, error)
- func FindProcessByName(name string) (*os.Process, error)
- func GetHostNamespaceDirectory(hostProcDir string) string
- func GetHostNamespacePID(hostProcDir string) uint64
- func GetNamespaceDirectory(procDir, pid string) string
- func GetProcessAncestorNamespaceDirectory(process, procDir string) (string, error)
- func GetProcessNamespaceDirectory(processName, procDir string) (string, error)
- func GetProcessPIDs(processName, procDir string) ([]uint64, error)
- type ProcessFinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindProcessByCmdline ¶
FindProcessByCmdline finds the processes with matching cmdline
func FindProcessByName ¶
FindProcessByName finds a process by name and returns the process
func GetHostNamespaceDirectory ¶
GetHostNamespaceDirectory returns the namespace directory for the host namespace.
func GetHostNamespacePID ¶
GetHostNamespacePID returns the PID of the host namespace.
func GetNamespaceDirectory ¶
GetNamespaceDirectory returns the namespace directory for the given PID.
func GetProcessAncestorNamespaceDirectory ¶
GetProcessAncestorNamespaceDirectory returns the namespace directory for the ancestor of the given process.
func GetProcessNamespaceDirectory ¶
GetProcessNamespaceDirectory returns the namespace directory for the given process. If processName is ProcessNone, it returns the host namespace directory.
func GetProcessPIDs ¶
GetProcessPIDs returns the PIDs for the given process name.
Types ¶
type ProcessFinder ¶
type ProcessFinder struct {
// contains filtered or unexported fields
}
ProcessFinder is a struct to find process information.
func NewProcFinder ¶
func NewProcFinder(procDir string) *ProcessFinder
func (*ProcessFinder) FindAncestorByName ¶
func (p *ProcessFinder) FindAncestorByName(ancestorProcess, pid string) (*linux.ProcessStatus, error)
FindAncestorByName returns the ancestor process status for the given process.
func (*ProcessFinder) GetProcessStatus ¶
func (p *ProcessFinder) GetProcessStatus(proc string) (*linux.ProcessStatus, error)
GetProcessStatus returns the process status for the given process.