Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Host ¶
func Host(opts ...ProviderOption) (types.Host, error)
Host returns information about host on which this process is running. If host information collection is not implemented for this platform then types.ErrNotImplemented is returned. On Darwin (macOS) a types.ErrNotImplemented is returned with cgo disabled.
func Process ¶
func Process(pid int, opts ...ProviderOption) (types.Process, error)
Process returns a types.Process object representing the process associated with the given PID. The types.Process object can be used to query information about the process. If process information collection is not implemented for this platform then types.ErrNotImplemented is returned.
Types ¶
type ProviderOption ¶ added in v1.14.1
type ProviderOption func(*registry.ProviderOptions)
func WithHostFS ¶ added in v1.14.1
func WithHostFS(hostfs string) ProviderOption
WithHostFS returns a provider with a custom HostFS root path, enabling use of the library from within a container, or an alternate root path on linux. For example, WithHostFS("/hostfs") can be used when /hostfs points to the root filesystem of the container host. For full functionality, the alternate hostfs should have:
- /proc
- /var
- /etc
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
providers
|
|
aix
Package aix implements the HostProvider and ProcessProvider interfaces for providing information about IBM AIX on ppc64.
|
Package aix implements the HostProvider and ProcessProvider interfaces for providing information about IBM AIX on ppc64. |
darwin
Package darwin implements the HostProvider and ProcessProvider interfaces for providing information about MacOS.
|
Package darwin implements the HostProvider and ProcessProvider interfaces for providing information about MacOS. |
linux
Package linux implements the HostProvider and ProcessProvider interfaces for providing information about Linux.
|
Package linux implements the HostProvider and ProcessProvider interfaces for providing information about Linux. |
windows
Package windows implements the HostProvider and ProcessProvider interfaces for providing information about Windows.
|
Package windows implements the HostProvider and ProcessProvider interfaces for providing information about Windows. |