Skip to content

export internal disk package from github.com/minio/minio/internal/disk

Notifications You must be signed in to change notification settings

naughtyGitCat/minio-disk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minio-disk

copy from github.com/minio/minio commit fb4ad000b6fc25e577b9b76402e91d1dc6f4cc0c

usage

install

go get -u github.com/naughtyGitCat/minio-disk
import (
        "github.com/naughtyGitCat/minio-disk"
        humanize "github.com/dustin/go-humanize"
)

func printUsage(path string) error {
        di, err := disk.GetInfo(path)
        if err != nil {
            return err
        }
        percentage := (float64(di.Total-di.Free)/float64(di.Total))*100
        fmt.Printf("%s of %s disk space used (%0.2f%%)\n", 
            humanize.Bytes(di.Total-di.Free), 
            humanize.Bytes(di.Total), 
            percentage,
        )
}

ref

About

export internal disk package from github.com/minio/minio/internal/disk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages