package sysinfo
import "github.com/elastic/go-sysinfo"
Index ¶
- func Go() types.GoInfo
- func Host(opts ...ProviderOption) (types.Host, error)
- func Process(pid int, opts ...ProviderOption) (types.Process, error)
- func Processes(opts ...ProviderOption) ([]types.Process, error)
- func Self(opts ...ProviderOption) (types.Process, error)
- type ProviderOption
Functions ¶
func Go ¶
Go returns information about the Go runtime.
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.
func Processes ¶
func Processes(opts ...ProviderOption) ([]types.Process, error)
Processes return a list of all processes. If process information collection is not implemented for this platform then types.ErrNotImplemented is returned.
func Self ¶
func Self(opts ...ProviderOption) (types.Process, error)
Self return a types.Process object representing this process. If process information collection is not implemented for this platform then types.ErrNotImplemented is returned.
Types ¶
type ProviderOption ¶
type ProviderOption func(*registry.ProviderOptions)
func WithHostFS ¶
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
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal | |
providers | |
providers/aix | Package aix implements the HostProvider and ProcessProvider interfaces for providing information about IBM AIX on ppc64. |
providers/darwin | Package darwin implements the HostProvider and ProcessProvider interfaces for providing information about MacOS. |
providers/linux | Package linux implements the HostProvider and ProcessProvider interfaces for providing information about Linux. |
providers/shared | |
providers/windows | Package windows implements the HostProvider and ProcessProvider interfaces for providing information about Windows. |
types |
- Version
- v1.15.3 (latest)
- Published
- Mar 28, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 hour ago –
Tools for package owners.