procfs

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package procfs implements utility functions relating to the /proc mount.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PKill

func PKill(name string, sig syscall.Signal) error

PKill finds process(es) using a regular expression and send a specified signal to each process.

func PidOf

func PidOf(name string) ([]int, error)

PidOf finds process(es) with a specified name (regexp match) and return their pid(s).

Types

type FakeProcFS

type FakeProcFS struct{}

func (*FakeProcFS) GetFullContainerName

func (fakePfs *FakeProcFS) GetFullContainerName(pid int) (string, error)

GetFullContainerName gets the container name given the root process id of the container. E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.

type ProcFS

type ProcFS struct{}

ProcFS provides a helper for getting container name via pid.

func (*ProcFS) GetFullContainerName

func (pfs *ProcFS) GetFullContainerName(pid int) (string, error)

GetFullContainerName gets the container name given the root process id of the container. E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.

type ProcFSInterface

type ProcFSInterface interface {
	// GetFullContainerName gets the container name given the root process id of the container.
	GetFullContainerName(pid int) (string, error)
}

func NewFakeProcFS

func NewFakeProcFS() ProcFSInterface

func NewProcFS

func NewProcFS() ProcFSInterface

NewProcFS returns a ProcFS object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL