package disk
import "github.com/shirou/gopsutil/v3/disk"
Index ¶
- func IOCounters(names ...string) (map[string]IOCountersStat, error)
- func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error)
- func Label(name string) (string, error)
- func LabelWithContext(ctx context.Context, name string) (string, error)
- func SerialNumber(name string) (string, error)
- func SerialNumberWithContext(ctx context.Context, name string) (string, error)
- type IOCountersStat
- type PartitionStat
- func Partitions(all bool) ([]PartitionStat, error)
- func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error)
- func (d PartitionStat) String() string
- type UsageStat
Functions ¶
func IOCounters ¶
func IOCounters(names ...string) (map[string]IOCountersStat, error)
func IOCountersWithContext ¶
func Label ¶
Label returns label of given device or empty string on error. Name of device is expected, eg. /dev/sda Supports label based on devicemapper name See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block-dm
func LabelWithContext ¶
func SerialNumber ¶
SerialNumber returns Serial Number of given device or empty string on error. Name of device is expected, eg. /dev/sda
func SerialNumberWithContext ¶
Types ¶
type IOCountersStat ¶
type IOCountersStat struct { ReadCount uint64 `json:"readCount"` MergedReadCount uint64 `json:"mergedReadCount"` WriteCount uint64 `json:"writeCount"` MergedWriteCount uint64 `json:"mergedWriteCount"` ReadBytes uint64 `json:"readBytes"` WriteBytes uint64 `json:"writeBytes"` ReadTime uint64 `json:"readTime"` WriteTime uint64 `json:"writeTime"` IopsInProgress uint64 `json:"iopsInProgress"` IoTime uint64 `json:"ioTime"` WeightedIO uint64 `json:"weightedIO"` Name string `json:"name"` SerialNumber string `json:"serialNumber"` Label string `json:"label"` }
func (IOCountersStat) String ¶
func (d IOCountersStat) String() string
type PartitionStat ¶
type PartitionStat struct { Device string `json:"device"` Mountpoint string `json:"mountpoint"` Fstype string `json:"fstype"` Opts []string `json:"opts"` }
func Partitions ¶
func Partitions(all bool) ([]PartitionStat, error)
Partitions returns disk partitions. If all is false, returns physical devices only (e.g. hard disks, cd-rom drives, USB keys) and ignore all others (e.g. memory partitions such as /dev/shm)
'all' argument is ignored for BSD, see: https://github.com/giampaolo/psutil/issues/906
func PartitionsWithContext ¶
func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error)
func (PartitionStat) String ¶
func (d PartitionStat) String() string
type UsageStat ¶
type UsageStat struct { Path string `json:"path"` Fstype string `json:"fstype"` Total uint64 `json:"total"` Free uint64 `json:"free"` Used uint64 `json:"used"` UsedPercent float64 `json:"usedPercent"` InodesTotal uint64 `json:"inodesTotal"` InodesUsed uint64 `json:"inodesUsed"` InodesFree uint64 `json:"inodesFree"` InodesUsedPercent float64 `json:"inodesUsedPercent"` }
func Usage ¶
Usage returns a file system usage. path is a filesystem path such as "/", not device file path like "/dev/vda1". If you want to use a return value of disk.Partitions, use "Mountpoint" not "Device".
func UsageWithContext ¶
func (UsageStat) String ¶
Source Files ¶
- Version
- v3.21.1
- Published
- Jan 14, 2021
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 2 days ago –
Tools for package owners.