proc

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalNeedMonitorPid = make(map[uint32]*ProcessInfo)
View Source
var GlobalPidMutex = &sync.RWMutex{}
View Source
var UserHZ = 100

Functions

func ExecuteInNetNs

func ExecuteInNetNs(newNs, curNs netns.NsHandle, f func() error) error

func GetHostNetNs

func GetHostNetNs() (netns.NsHandle, error)

func GetNetNs

func GetNetNs(pid uint32) (netns.NsHandle, error)

func GetNsIps

func GetNsIps(ns netns.NsHandle) ([]netaddr.IP, error)

func GetPid

func GetPid()

func GetSelfNetNs

func GetSelfNetNs() (netns.NsHandle, error)

func HostPath

func HostPath(p string) string

func Path

func Path(pid uint32, subpath ...string) string

func UpdatePid

func UpdatePid()

Types

type FSStat

type FSStat struct {
	CapacityBytes uint64
	UsedBytes     uint64
	ReservedBytes uint64
}

func StatFS

func StatFS(dirPath string) (FSStat, error)

type Fd

type Fd struct {
	Fd   uint64
	Dest string

	SocketInode string
}

func ReadFds

func ReadFds(pid uint32) ([]Fd, error)

type FdInfo

type FdInfo struct {
	MntId string
	Flags int
	Dest  string
}

func GetFdInfo

func GetFdInfo(pid uint32, fd uint64) *FdInfo

type ProcessInfo

type ProcessInfo struct {
	StartTime time.Time
	ContainId string
}

type Sock

type Sock struct {
	Inode  string
	SAddr  netaddr.IPPort
	DAddr  netaddr.IPPort
	Listen bool
}

func GetSockets

func GetSockets(pid uint32) ([]Sock, error)

Jump to

Keyboard shortcuts

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