Versions in this module Expand all Collapse all v2 v2.49.202 Sep 19, 2023 v2.49.201 Sep 19, 2023 Changes in this version + const CTLKern — darwin/amd64 + const ClockTicks — darwin/amd64, linux/amd64 + const KernProc — darwin/amd64 + const KernProcAll — darwin/amd64 + const KernProcPID — darwin/amd64 + const KernProcPathname — darwin/amd64 + const KernProcProc — darwin/amd64 + const PrioProcess — linux/amd64 + const RLIMIT_AS + const RLIMIT_CORE + const RLIMIT_CPU + const RLIMIT_DATA + const RLIMIT_FSIZE + const RLIMIT_LOCKS + const RLIMIT_MEMLOCK + const RLIMIT_MSGQUEUE + const RLIMIT_NICE + const RLIMIT_NOFILE + const RLIMIT_NPROC + const RLIMIT_RSS + const RLIMIT_RTPRIO + const RLIMIT_RTTIME + const RLIMIT_SIGPENDING + const RLIMIT_STACK + var ErrorNoChildren = errors.New("process does not have children") + var ErrorProcessNotRunning = errors.New("process does not exist") + var PageSize = uint64(os.Getpagesize()) — linux/amd64 + func PidExists(pid int32) (bool, error) + func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) + func Pids() ([]int32, error) + func PidsWithContext(ctx context.Context) ([]int32, error) + type AuMask struct — darwin/amd64 + Failure uint32 + Success uint32 + type AuTidAddr struct — darwin/amd64 + Addr [4]uint32 + Port int32 + Type uint32 + type Au_session struct — darwin/amd64 + Aia_p *AuditinfoAddr + Mask AuMask + type AuditinfoAddr struct — darwin/amd64 + Asid int32 + Auid uint32 + Flags uint64 + Mask AuMask + Termid AuTidAddr + type Eproc struct — darwin/amd64 + Flag int32 + Jobc int16 + Login [12]int8 + Pad_cgo_0 [4]byte + Pad_cgo_1 [2]byte + Pad_cgo_2 [4]byte + Pad_cgo_3 [2]byte + Pad_cgo_4 [4]byte + Paddr *uint64 + Pcred Upcred + Pgid int32 + Ppid int32 + Sess *Session + Spare [4]int32 + Tdev int32 + Tpgid int32 + Tsess *Session + Ucred Uucred + Vm Vmspace + Wmesg [8]int8 + Xccount int16 + Xrssize int16 + Xsize int32 + Xswrss int16 + type ExternProc struct — darwin/amd64 + Exit_thread uint64 + P_acflag uint16 + P_addr uint64 + P_comm [17]int8 + P_cpticks int32 + P_debugger int32 + P_dupfd int32 + P_estcpu uint32 + P_flag int32 + P_holdcnt int32 + P_iticks uint64 + P_nice int8 + P_oppid int32 + P_pctcpu uint32 + P_pgrp uint64 + P_pid int32 + P_priority uint8 + P_realtimer Itimerval + P_rtime Timeval + P_ru uint64 + P_sigacts uint64 + P_sigcatch uint32 + P_sigignore uint32 + P_siglist int32 + P_sigmask uint32 + P_slptime uint32 + P_stat int8 + P_sticks uint64 + P_swtime uint32 + P_textvp uint64 + P_traceflag int32 + P_tracep uint64 + P_un [16]byte + P_usrpri uint8 + P_uticks uint64 + P_vmspace uint64 + P_wchan uint64 + P_wmesg uint64 + P_xstat uint16 + Pad_cgo_0 [3]byte + Pad_cgo_1 [4]byte + Pad_cgo_2 [4]byte + Pad_cgo_3 [4]byte + Pad_cgo_4 [4]byte + Pad_cgo_5 [4]byte + Pad_cgo_6 [4]byte + Sigwait int32 + User_stack uint64 + type IOCountersStat struct + ReadBytes uint64 + ReadCount uint64 + WriteBytes uint64 + WriteCount uint64 + func (i IOCountersStat) String() string + type Itimerval struct — darwin/amd64 + Interval Timeval + Value Timeval + type KinfoProc struct — darwin/amd64 + Eproc Eproc + Proc ExternProc + type Label struct — darwin/amd64 + type MemoryInfoExStat struct — darwin/amd64, js/wasm, windows/amd64 + type MemoryInfoExStat struct — linux/amd64 + Data uint64 + Dirty uint64 + Lib uint64 + RSS uint64 + Shared uint64 + Text uint64 + VMS uint64 + func (m MemoryInfoExStat) String() string + type MemoryInfoStat struct + Data uint64 + HWM uint64 + Locked uint64 + RSS uint64 + Stack uint64 + Swap uint64 + VMS uint64 + func (m MemoryInfoStat) String() string + type MemoryMapsStat struct — darwin/amd64, windows/amd64 + type MemoryMapsStat struct — js/wasm, linux/amd64 + Anonymous uint64 + Path string + PrivateClean uint64 + PrivateDirty uint64 + Pss uint64 + Referenced uint64 + Rss uint64 + SharedClean uint64 + SharedDirty uint64 + Size uint64 + Swap uint64 + func (m MemoryMapsStat) String() string + type NumCtxSwitchesStat struct + Involuntary int64 + Voluntary int64 + func (p NumCtxSwitchesStat) String() string + type OpenFilesStat struct + Fd uint64 + Path string + func (o OpenFilesStat) String() string + type PROCESS_MEMORY_COUNTERS struct — windows/amd64 + CB uint32 + PageFaultCount uint32 + PagefileUsage uint64 + PeakPagefileUsage uint64 + PeakWorkingSetSize uint64 + QuotaNonPagedPoolUsage uint64 + QuotaPagedPoolUsage uint64 + QuotaPeakNonPagedPoolUsage uint64 + QuotaPeakPagedPoolUsage uint64 + WorkingSetSize uint64 + type PageFaultsStat struct + ChildMajorFaults uint64 + ChildMinorFaults uint64 + MajorFaults uint64 + MinorFaults uint64 + type Pgrp struct — darwin/amd64 + type Posix_cred struct — darwin/amd64 + Flags int32 + Gmuid uint32 + Groups [16]uint32 + Ngroups int16 + Pad_cgo_0 [2]byte + Rgid uint32 + Ruid uint32 + Svgid uint32 + Svuid uint32 + UID uint32 + type Proc struct — darwin/amd64 + type Process struct + Pid int32 + func NewProcess(pid int32) (*Process, error) + func Processes() ([]*Process, error) + func ProcessesWithContext(ctx context.Context) ([]*Process, error) + func (p *Process) Background() (bool, error) + func (p *Process) BackgroundWithContext(ctx context.Context) (bool, error) + func (p *Process) CPUAffinity() ([]int32, error) + func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) + func (p *Process) CPUPercent() (float64, error) + func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) + func (p *Process) Children() ([]*Process, error) + func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) + func (p *Process) Cmdline() (string, error) + func (p *Process) CmdlineSlice() ([]string, error) + func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) + func (p *Process) CmdlineWithContext(_ context.Context) (string, error) + func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) + func (p *Process) Connections() ([]net.ConnectionStat, error) + func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) + func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) + func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) + func (p *Process) CreateTime() (int64, error) + func (p *Process) CreateTimeWithContext(ctx context.Context) (int64, error) + func (p *Process) Cwd() (string, error) + func (p *Process) CwdWithContext(ctx context.Context) (string, error) + func (p *Process) Exe() (string, error) + func (p *Process) ExeWithContext(ctx context.Context) (string, error) + func (p *Process) Foreground() (bool, error) + func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) + func (p *Process) Gids() ([]int32, error) + func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) + func (p *Process) Groups() ([]int32, error) + func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) + func (p *Process) IOCounters() (*IOCountersStat, error) + func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) + func (p *Process) IOnice() (int32, error) + func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) + func (p *Process) IsRunning() (bool, error) + func (p *Process) IsRunningWithContext(ctx context.Context) (bool, error) + func (p *Process) Kill() error + func (p *Process) KillWithContext(ctx context.Context) error + func (p *Process) MemoryInfo() (*MemoryInfoStat, error) + func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) + func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) + func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) + func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) + func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) + func (p *Process) MemoryPercent() (float32, error) + func (p *Process) MemoryPercentWithContext(ctx context.Context) (float32, error) + func (p *Process) Name() (string, error) + func (p *Process) NameWithContext(ctx context.Context) (string, error) + func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) + func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) + func (p *Process) Nice() (int32, error) + func (p *Process) NiceWithContext(ctx context.Context) (int32, error) + func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) + func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) + func (p *Process) NumFDs() (int32, error) + func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) + func (p *Process) NumThreads() (int32, error) + func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) + func (p *Process) OpenFiles() ([]OpenFilesStat, error) + func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) + func (p *Process) PageFaults() (*PageFaultsStat, error) + func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) + func (p *Process) Parent() (*Process, error) + func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) + func (p *Process) Percent(interval time.Duration) (float64, error) + func (p *Process) PercentWithContext(ctx context.Context, interval time.Duration) (float64, error) + func (p *Process) Ppid() (int32, error) + func (p *Process) PpidWithContext(ctx context.Context) (int32, error) + func (p *Process) Resume() error + func (p *Process) ResumeWithContext(ctx context.Context) error + func (p *Process) Rlimit() ([]RlimitStat, error) + func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) + func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) + func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) + func (p *Process) SendSignal(sig syscall.Signal) error + func (p *Process) SendSignal(sig windows.Signal) error + func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error + func (p *Process) SendSignalWithContext(ctx context.Context, sig windows.Signal) error + func (p *Process) Status() (string, error) + func (p *Process) StatusWithContext(ctx context.Context) (string, error) + func (p *Process) Suspend() error + func (p *Process) SuspendWithContext(ctx context.Context) error + func (p *Process) Terminal() (string, error) + func (p *Process) TerminalWithContext(ctx context.Context) (string, error) + func (p *Process) Terminate() error + func (p *Process) TerminateWithContext(ctx context.Context) error + func (p *Process) Tgid() (int32, error) + func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) + func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) + func (p *Process) Times() (*cpu.TimesStat, error) + func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) + func (p *Process) Uids() ([]int32, error) + func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) + func (p *Process) Username() (string, error) + func (p *Process) UsernameWithContext(ctx context.Context) (string, error) + func (p Process) String() string + type Rlimit struct — darwin/amd64 + Cur uint64 + Max uint64 + type RlimitStat struct + Hard int32 + Resource int32 + Soft int32 + Used uint64 + func (r RlimitStat) String() string + type Rusage struct — darwin/amd64 + Idrss int64 + Inblock int64 + Isrss int64 + Ixrss int64 + Majflt int64 + Maxrss int64 + Minflt int64 + Msgrcv int64 + Msgsnd int64 + Nivcsw int64 + Nsignals int64 + Nswap int64 + Nvcsw int64 + Oublock int64 + Stime Timeval + Utime Timeval + type SYSTEM_TIMES struct — windows/amd64 + CreateTime syscall.Filetime + ExitTime syscall.Filetime + KernelTime syscall.Filetime + UserTime syscall.Filetime + type Session struct — darwin/amd64 + type Sigacts struct — darwin/amd64 + type SignalInfoStat struct + Blocked uint64 + Caught uint64 + Ignored uint64 + PendingProcess uint64 + PendingThread uint64 + type SystemProcessInformation struct — windows/amd64 + HandleCount uint64 + NextEntryOffset uint64 + NumberOfThreads uint64 + PeakPagefileUsage uint64 + PrivatePageCount uint64 + Reserved1 [48]byte + Reserved2 [3]byte + Reserved3 uintptr + Reserved4 [4]byte + Reserved5 [11]byte + Reserved6 [6]uint64 + UniqueProcessID uintptr + type Timespec struct — darwin/amd64 + Nsec int64 + Sec int64 + type Timeval struct — darwin/amd64 + Pad_cgo_0 [4]byte + Sec int64 + Usec int32 + type UGid_t uint32 — darwin/amd64 + type UcredQueue struct — darwin/amd64 + Next *ucred + Prev **ucred + type Upcred struct — darwin/amd64 + P_refcnt int32 + P_rgid uint32 + P_ruid uint32 + P_svgid uint32 + P_svuid uint32 + Pad_cgo_0 [4]byte + Pc_lock [72]int8 + Pc_ucred *ucred + type UserStruct struct — darwin/amd64 + type Uucred struct — darwin/amd64 + Groups [16]uint32 + Ngroups int16 + Pad_cgo_0 [2]byte + Ref int32 + UID uint32 + type Vmspace struct — darwin/amd64 + Dummy int32 + Dummy2 *int8 + Dummy3 [5]int32 + Dummy4 [3]*int8 + Pad_cgo_0 [4]byte + Pad_cgo_1 [4]byte + type Vnode struct — darwin/amd64