Files
serveg/internal/disk_usage/disk_usage.go
T
2026-11-06 22:58:18 +01:00

22 lines
586 B
Go

package disk_usage
import "errors"
var ErrNotSupported = errors.New("disk_usage: not supported on this OS")
// Used + Free can be less than Total: space reserved for root/admin
// is not free for this process, but not used either.
type Usage struct {
// size of the file system (available to this user, if there are quotas)
Total int64
// Total minus all free space, including reserved
Used int64
// available to this process
Free int64
}
// DiskUsage returns usage of the file system that contains path.
func DiskUsage(path string) (Usage, error) {
return diskUsage(path)
}