Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type StorageDevice struct {
Model string `json:"model,omitempty"`
Serial string `json:"serial,omitempty"`
Size uint `json:"size,omitempty"` // device size in GB
Removable bool `json:"removable"`
}

func getSerial(name, fullpath string) (serial string) {
Expand Down Expand Up @@ -99,6 +100,9 @@ func (si *SysInfo) getStorageInfo() {
size, _ := strconv.ParseUint(slurpFile(path.Join(fullpath, "size")), 10, 64)
device.Size = uint(size) / 1953125 // GiB

removable, _ := strconv.ParseBool(slurpFile(path.Join(fullpath, "removable")))
device.Removable = removable

si.Storage = append(si.Storage, device)
}
}
Loading