adding lots of different stats
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user