Documentation
¶
Index ¶
- Variables
- type CPUTimer
- type CPUTimes
- type Capabilities
- type CapabilityInfo
- type Environment
- type GoInfo
- type Host
- type HostInfo
- type HostMemoryInfo
- type LoadAverage
- type LoadAverageInfo
- type MemoryInfo
- type OSInfo
- type OpenHandleCounter
- type OpenHandleEnumerator
- type Process
- type ProcessInfo
- type Seccomp
- type SeccompInfo
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("unimplemented")
Functions ¶
This section is empty.
Types ¶
type CPUTimes ¶
type CPUTimes struct {
User time.Duration `json:"user"`
System time.Duration `json:"system"`
Idle time.Duration `json:"idle,omitempty"`
IOWait time.Duration `json:"iowait,omitempty"`
IRQ time.Duration `json:"irq,omitempty"`
Nice time.Duration `json:"nice,omitempty"`
SoftIRQ time.Duration `json:"soft_irq,omitempty"`
Steal time.Duration `json:"steal,omitempty"`
}
type Capabilities ¶
type Capabilities interface {
Capabilities() (*CapabilityInfo, error)
}
type CapabilityInfo ¶
type Environment ¶
type HostInfo ¶
type HostInfo struct {
Architecture string `json:"architecture"` // Hardware architecture (e.g. x86_64, arm, ppc, mips).
BootTime time.Time `json:"boot_time"` // Host boot time.
Containerized *bool `json:"containerized,omitempty"` // Is the process containerized.
Hostname string `json:"name"` // Hostname
IPs []string `json:"ip,omitempty"` // List of all IPs.
KernelVersion string `json:"kernel_version"` // Kernel version.
MACs []string `json:"mac"` // List of MAC addresses.
OS *OSInfo `json:"os"` // OS information.
Timezone string `json:"timezone"` // System timezone.
TimezoneOffsetSec int `json:"timezone_offset_sec"` // Timezone offset (seconds from UTC).
UniqueID string `json:"id,omitempty"` // Unique ID of the host (optional).
}
type HostMemoryInfo ¶
type HostMemoryInfo struct {
Total uint64 `json:"total_bytes"` // Total physical memory.
Used uint64 `json:"used_bytes"` // Total - Free
Available uint64 `json:"available_bytes"` // Amount of memory available without swapping.
Free uint64 `json:"free_bytes"` // Amount of memory not used by the system.
VirtualTotal uint64 `json:"virtual_total_bytes"` // Total virtual memory.
VirtualUsed uint64 `json:"virtual_used_bytes"` // VirtualTotal - VirtualFree
VirtualFree uint64 `json:"virtual_free_bytes"` // Virtual memory that is not used.
Metrics map[string]uint64 `json:"raw,omitempty"` // Other memory related metrics.
}
HostMemoryInfo (all values are specified in bytes).
type LoadAverage ¶
type LoadAverage interface {
LoadAverage() LoadAverageInfo
}
type LoadAverageInfo ¶
type MemoryInfo ¶
type OSInfo ¶
type OSInfo struct {
Family string `json:"family"` // OS Family (e.g. redhat, debian, freebsd, windows).
Platform string `json:"platform"` // OS platform (e.g. centos, ubuntu, windows).
Name string `json:"name"` // OS Name (e.g. Mac OS X, CentOS).
Version string `json:"version"` // OS version (e.g. 10.12.6).
Major int `json:"major"` // Major release version.
Minor int `json:"minor"` // Minor release version.
Patch int `json:"patch"` // Patch release version.
Build string `json:"build,omitempty"` // Build (e.g. 16G1114).
Codename string `json:"codename,omitempty"` // OS codename (e.g. jessie).
}
type OpenHandleCounter ¶
OpenHandleCount returns the number the open file handles.
type OpenHandleEnumerator ¶
OpenHandleEnumerator lists the open file handles.
type Process ¶
type Process interface {
CPUTimer
Info() (ProcessInfo, error)
Memory() (MemoryInfo, error)
User() (UserInfo, error)
Parent() (Process, error)
PID() int
}
type ProcessInfo ¶
type Seccomp ¶
type Seccomp interface {
Seccomp() (*SeccompInfo, error)
}
type SeccompInfo ¶
type UserInfo ¶
type UserInfo struct {
// UID is the user ID.
// On Linux and Darwin (macOS) this is the real user ID.
// On Windows, this is the security identifier (SID) of the
// user account of the process access token.
UID string `json:"uid"`
// On Linux and Darwin (macOS) this is the effective user ID.
// On Windows, this is empty.
EUID string `json:"euid"`
// On Linux and Darwin (macOS) this is the saved user ID.
// On Windows, this is empty.
SUID string `json:"suid"`
// GID is the primary group ID.
// On Linux and Darwin (macOS) this is the real group ID.
// On Windows, this is the security identifier (SID) of the
// primary group of the process access token.
GID string `json:"gid"`
// On Linux and Darwin (macOS) this is the effective group ID.
// On Windows, this is empty.
EGID string `json:"egid"`
// On Linux and Darwin (macOS) this is the saved group ID.
// On Windows, this is empty.
SGID string `json:"sgid"`
}
UserInfo contains information about the UID and GID values of a process.
Click to show internal directories.
Click to hide internal directories.