-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy pathtypes.go
42 lines (35 loc) · 974 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package fs
type DeviceInfo struct {
Device string
Major uint
Minor uint
}
type Fs struct {
DeviceInfo
Capacity uint64
Free uint64
DiskStats DiskStats
}
type DiskStats struct {
ReadsCompleted uint64
ReadsMerged uint64
SectorsRead uint64
ReadTime uint64
WritesCompleted uint64
WritesMerged uint64
SectorsWritten uint64
WriteTime uint64
IoInProgress uint64
IoTime uint64
WeightedIoTime uint64
}
type FsInfo interface {
// Returns capacity and free space, in bytes, of all the ext2, ext3, ext4 filesystems on the host.
GetGlobalFsInfo() ([]Fs, error)
// Returns capacity and free space, in bytes, of the set of mounts passed.
GetFsInfoForPath(mountSet map[string]struct{}) ([]Fs, error)
// Returns number of bytes occupied by 'dir'.
GetDirUsage(dir string) (uint64, error)
// Returns the block device info of the filesystem on which 'dir' resides.
GetDirFsDevice(dir string) (*DeviceInfo, error)
}