Documentation
¶
Overview ¶
Package disk reads the local disks of the host through gohai.
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 usage of the host's local disks with gohai's filesystem collector, on every Linux family and on macOS.
func (*Gohai) GetLocalUsageStats ¶ added in v0.3.0
GetLocalUsageStats is the total, used and free bytes of each local disk's mount. A mount without sizes, such as one that df cannot read, is left out.
type Provider ¶
type Provider interface {
// GetLocalUsageStats retrieves disk space statistics.
GetLocalUsageStats() ([]Result, error)
}
Provider implements the methods to interact with various Disk components.
type Result ¶
type Result struct {
// Disk identifier, e.g., "/dev/sda1"
Name string
// Total disk space in bytes
Total uint64
// Used disk space in bytes
Used uint64
// Free disk space in bytes
Free uint64
// Changed indicates whether system state was modified.
Changed bool `json:"changed"`
}
Result holds information about disk space usage.