adding lots of different stats

This commit is contained in:
Chris Lu
2014-03-26 13:22:27 -07:00
parent 39b774a131
commit 59f6a13609
8 changed files with 123 additions and 31 deletions

View File

@@ -7,13 +7,14 @@ import (
)
type DiskStatus struct {
All uint64 `json:"all"`
Used uint64 `json:"used"`
Free uint64 `json:"free"`
Dir string
All uint64
Used uint64
Free uint64
}
func DiskUsage(path string) (disk *DiskStatus) {
disk = &DiskStatus{}
func NewDiskStatus(path string) (disk *DiskStatus) {
disk = &DiskStatus{Dir: path}
fs := syscall.Statfs_t{}
err := syscall.Statfs(path, &fs)
if err != nil {