Documentation
¶
Overview ¶
Package memory reads the memory of the host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gohai ¶ added in v0.3.0
type Gohai struct {
// Sources are what the collector reads. A zero field is the real
// host's.
Sources source.Sources
}
Gohai reads the host's memory with gohai's memory collector, on every Linux family and on macOS.
type Provider ¶
type Provider interface {
// GetStats retrieves memory statistics of the system.
GetStats() (*Result, error)
}
Provider implements the methods to interact with various Mem components.
type Result ¶
type Result struct {
// Total memory in bytes
Total uint64
// Available memory in bytes (free + reclaimable)
Available uint64
// Free memory in bytes
Free uint64
// Cached memory in bytes
Cached uint64
// Changed indicates whether system state was modified.
Changed bool `json:"changed"`
}
Result holds memory information in bytes.